From 183c038dde5d49727ebc066990c3217629d3fa61 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Sat, 28 Sep 2024 12:35:44 -0700 Subject: [PATCH] fix: annotate PipelineJob and PipelineTaskRerunConfig fields as optional (#5698) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add TunedModelRef and RebaseTunedModel Api for Vertex GenAiTuningService docs: limit comment `SupervisedTuningSpec` for 1p tuning PiperOrigin-RevId: 676969679 Source-Link: https://github.com/googleapis/googleapis/commit/2a98f797cb083b632a6c03b8472f850a8a674fb0 Source-Link: https://github.com/googleapis/googleapis-gen/commit/eb6e7f595a86b385f1f4593e43cbe1015c29ef79 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFpcGxhdGZvcm0vLk93bEJvdC55YW1sIiwiaCI6ImViNmU3ZjU5NWE4NmIzODVmMWY0NTkzZTQzY2JlMTAxNWMyOWVmNzkifQ== * feat: add TunedModelRef and RebaseTunedModel Api for Vertex GenAiTuningService docs: limit comment `SupervisedTuningSpec` for 1p tuning PiperOrigin-RevId: 676970579 Source-Link: https://github.com/googleapis/googleapis/commit/30009c9ff2c33e402dad98da9bc656c72df30bc4 Source-Link: https://github.com/googleapis/googleapis-gen/commit/6d9cc8d60aff651a6c48fb0a951dd8a83e06a267 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFpcGxhdGZvcm0vLk93bEJvdC55YW1sIiwiaCI6IjZkOWNjOGQ2MGFmZjY1MWE2YzQ4ZmIwYTk1MWRkOGE4M2UwNmEyNjcifQ== * fix: annotate PipelineJob and PipelineTaskRerunConfig fields as optional PiperOrigin-RevId: 679707420 Source-Link: https://github.com/googleapis/googleapis/commit/d6f184876ec67295addccbb70aa4af622e049a7e Source-Link: https://github.com/googleapis/googleapis-gen/commit/f6c16c2000b0df1581daf23e655f3fa4e33dff99 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFpcGxhdGZvcm0vLk93bEJvdC55YW1sIiwiaCI6ImY2YzE2YzIwMDBiMGRmMTU4MWRhZjIzZTY1NWYzZmE0ZTMzZGZmOTkifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot Co-authored-by: Daniel Bankhead --- packages/google-cloud-aiplatform/README.md | 2 + .../aiplatform/v1/genai_tuning_service.proto | 55 + .../cloud/aiplatform/v1/tuning_job.proto | 25 +- .../v1beta1/genai_tuning_service.proto | 55 + .../aiplatform/v1beta1/pipeline_job.proto | 44 +- .../cloud/aiplatform/v1beta1/tuning_job.proto | 25 +- .../protos/protos.d.ts | 702 ++++++ .../google-cloud-aiplatform/protos/protos.js | 1662 +++++++++++++ .../protos/protos.json | 240 +- .../google-cloud-aiplatform/samples/README.md | 36 + ...en_ai_tuning_service.rebase_tuned_model.js | 83 + ...t_metadata_google.cloud.aiplatform.v1.json | 56 + ...en_ai_tuning_service.rebase_tuned_model.js | 83 + ...adata_google.cloud.aiplatform.v1beta1.json | 56 + .../src/v1/gapic_metadata.json | 10 + .../src/v1/gen_ai_tuning_service_client.ts | 1881 ++++++++++++++- .../gen_ai_tuning_service_client_config.json | 4 + .../src/v1beta1/gapic_metadata.json | 10 + .../v1beta1/gen_ai_tuning_service_client.ts | 2097 ++++++++++++++++- .../gen_ai_tuning_service_client_config.json | 4 + .../test/gapic_gen_ai_tuning_service_v1.ts | 539 ++++- .../gapic_gen_ai_tuning_service_v1beta1.ts | 556 ++++- 22 files changed, 8186 insertions(+), 39 deletions(-) create mode 100644 packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.rebase_tuned_model.js create mode 100644 packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.rebase_tuned_model.js diff --git a/packages/google-cloud-aiplatform/README.md b/packages/google-cloud-aiplatform/README.md index c4398961d1c..7151e70bc03 100644 --- a/packages/google-cloud-aiplatform/README.md +++ b/packages/google-cloud-aiplatform/README.md @@ -189,6 +189,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Gen_ai_tuning_service.create_tuning_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.create_tuning_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.create_tuning_job.js,packages/google-cloud-aiplatform/samples/README.md) | | Gen_ai_tuning_service.get_tuning_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.get_tuning_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.get_tuning_job.js,packages/google-cloud-aiplatform/samples/README.md) | | Gen_ai_tuning_service.list_tuning_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.list_tuning_jobs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.list_tuning_jobs.js,packages/google-cloud-aiplatform/samples/README.md) | +| Gen_ai_tuning_service.rebase_tuned_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.rebase_tuned_model.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.rebase_tuned_model.js,packages/google-cloud-aiplatform/samples/README.md) | | Index_endpoint_service.create_index_endpoint | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.create_index_endpoint.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.create_index_endpoint.js,packages/google-cloud-aiplatform/samples/README.md) | | Index_endpoint_service.delete_index_endpoint | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.delete_index_endpoint.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.delete_index_endpoint.js,packages/google-cloud-aiplatform/samples/README.md) | | Index_endpoint_service.deploy_index | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.deploy_index.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.deploy_index.js,packages/google-cloud-aiplatform/samples/README.md) | @@ -499,6 +500,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Gen_ai_tuning_service.create_tuning_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.create_tuning_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.create_tuning_job.js,packages/google-cloud-aiplatform/samples/README.md) | | Gen_ai_tuning_service.get_tuning_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.get_tuning_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.get_tuning_job.js,packages/google-cloud-aiplatform/samples/README.md) | | Gen_ai_tuning_service.list_tuning_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.list_tuning_jobs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.list_tuning_jobs.js,packages/google-cloud-aiplatform/samples/README.md) | +| Gen_ai_tuning_service.rebase_tuned_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.rebase_tuned_model.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.rebase_tuned_model.js,packages/google-cloud-aiplatform/samples/README.md) | | Index_endpoint_service.create_index_endpoint | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.create_index_endpoint.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.create_index_endpoint.js,packages/google-cloud-aiplatform/samples/README.md) | | Index_endpoint_service.delete_index_endpoint | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.delete_index_endpoint.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.delete_index_endpoint.js,packages/google-cloud-aiplatform/samples/README.md) | | Index_endpoint_service.deploy_index | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.deploy_index.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.deploy_index.js,packages/google-cloud-aiplatform/samples/README.md) | diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/genai_tuning_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/genai_tuning_service.proto index d0c369d3b4e..d5202362163 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/genai_tuning_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/genai_tuning_service.proto @@ -20,7 +20,10 @@ import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/io.proto"; +import "google/cloud/aiplatform/v1/operation.proto"; import "google/cloud/aiplatform/v1/tuning_job.proto"; +import "google/longrunning/operations.proto"; import "google/protobuf/empty.proto"; option csharp_namespace = "Google.Cloud.AIPlatform.V1"; @@ -82,6 +85,22 @@ service GenAiTuningService { }; option (google.api.method_signature) = "name"; } + + // Rebase a TunedModel. + // Creates a LongRunningOperation that takes a legacy Tuned GenAI model + // Reference and creates a TuningJob based on newly available model. + rpc RebaseTunedModel(RebaseTunedModelRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/tuningJobs:rebaseTunedModel" + body: "*" + }; + option (google.api.method_signature) = "parent,tuned_model_ref"; + option (google.longrunning.operation_info) = { + response_type: "TuningJob" + metadata_type: "RebaseTunedModelOperationMetadata" + }; + } } // Request message for @@ -162,3 +181,39 @@ message CancelTuningJobRequest { } ]; } + +// Request message for +// [GenAiTuningService.RebaseTunedModel][google.cloud.aiplatform.v1.GenAiTuningService.RebaseTunedModel]. +message RebaseTunedModelRequest { + // Required. The resource name of the Location into which to rebase the Model. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. TunedModel reference to retrieve the legacy model information. + TunedModelRef tuned_model_ref = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The TuningJob to be updated. Users can use this TuningJob field + // to overwrite tuning configs. + TuningJob tuning_job = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Google Cloud Storage location to write the artifacts. + GcsDestination artifact_destination = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // 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. + bool deploy_to_same_endpoint = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Runtime operation information for +// [GenAiTuningService.RebaseTunedModel][google.cloud.aiplatform.v1.GenAiTuningService.RebaseTunedModel]. +message RebaseTunedModelOperationMetadata { + // The common part of the operation generic information. + GenericOperationMetadata generic_metadata = 1; +} diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/tuning_job.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/tuning_job.proto index 8cd6d71ae8f..db18992327a 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/tuning_job.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/tuning_job.proto @@ -285,7 +285,7 @@ message SupervisedHyperParameters { AdapterSize adapter_size = 3 [(google.api.field_behavior) = OPTIONAL]; } -// Tuning Spec for Supervised Tuning. +// Tuning Spec for Supervised Tuning for first party models. message SupervisedTuningSpec { // Required. Cloud Storage path to file containing training dataset for // tuning. The dataset must be formatted as a JSONL file. @@ -299,3 +299,26 @@ message SupervisedTuningSpec { SupervisedHyperParameters hyper_parameters = 3 [(google.api.field_behavior) = OPTIONAL]; } + +// TunedModel Reference for legacy model migration. +message TunedModelRef { + // The Tuned Model Reference for the model. + oneof tuned_model_ref { + // Support migration from model registry. + string tuned_model = 1 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + }]; + + // Support migration from tuning job list page, from gemini-1.0-pro-002 + // to 1.5 and above. + string tuning_job = 2 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TuningJob" + }]; + + // Support migration from tuning job list page, from bison model to gemini + // model. + string pipeline_job = 3 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/PipelineJob" + }]; + } +} diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto index cc44a829f9b..124db6e52e2 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto @@ -20,7 +20,10 @@ import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/io.proto"; +import "google/cloud/aiplatform/v1beta1/operation.proto"; import "google/cloud/aiplatform/v1beta1/tuning_job.proto"; +import "google/longrunning/operations.proto"; import "google/protobuf/empty.proto"; option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; @@ -82,6 +85,22 @@ service GenAiTuningService { }; option (google.api.method_signature) = "name"; } + + // Rebase a TunedModel. + // Creates a LongRunningOperation that takes a legacy Tuned GenAI model + // Reference and creates a TuningJob based on newly available model. + rpc RebaseTunedModel(RebaseTunedModelRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/tuningJobs:rebaseTunedModel" + body: "*" + }; + option (google.api.method_signature) = "parent,tuned_model_ref"; + option (google.longrunning.operation_info) = { + response_type: "TuningJob" + metadata_type: "RebaseTunedModelOperationMetadata" + }; + } } // Request message for @@ -162,3 +181,39 @@ message CancelTuningJobRequest { } ]; } + +// Request message for +// [GenAiTuningService.RebaseTunedModel][google.cloud.aiplatform.v1beta1.GenAiTuningService.RebaseTunedModel]. +message RebaseTunedModelRequest { + // Required. The resource name of the Location into which to rebase the Model. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. TunedModel reference to retrieve the legacy model information. + TunedModelRef tuned_model_ref = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The TuningJob to be updated. Users can use this TuningJob field + // to overwrite tuning configs. + TuningJob tuning_job = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Google Cloud Storage location to write the artifacts. + GcsDestination artifact_destination = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // 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. + bool deploy_to_same_endpoint = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Runtime operation information for +// [GenAiTuningService.RebaseTunedModel][google.cloud.aiplatform.v1beta1.GenAiTuningService.RebaseTunedModel]. +message RebaseTunedModelOperationMetadata { + // The common part of the operation generic information. + GenericOperationMetadata generic_metadata = 1; +} diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto index 7e55278baf5..74efa33cdea 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto @@ -224,12 +224,11 @@ message PipelineJob { // Output only. Reserved for future use. bool satisfies_pzi = 28 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. The original pipeline job id if this pipeline job is a rerun - // of a previous pipeline job. - int64 original_pipeline_job_id = 29 - [(google.api.field_behavior) = OUTPUT_ONLY]; + // Optional. The original pipeline job id if this pipeline job is a rerun of a + // previous pipeline job. + int64 original_pipeline_job_id = 29 [(google.api.field_behavior) = OPTIONAL]; - // Output only. The rerun configs for each task in the pipeline job. + // Optional. The rerun configs for each task in the pipeline job. // By default, the rerun will: // 1. Use the same input artifacts as the original run. // 2. Use the same input parameters as the original run. @@ -238,7 +237,7 @@ message PipelineJob { // By providing this field, users can override the default behavior and // specify the rerun config for each task. repeated PipelineTaskRerunConfig pipeline_task_rerun_configs = 30 - [(google.api.field_behavior) = OUTPUT_ONLY]; + [(google.api.field_behavior) = OPTIONAL]; } // Pipeline template metadata if @@ -459,35 +458,34 @@ message PipelineTaskExecutorDetail { message PipelineTaskRerunConfig { // A list of artifact metadata. message ArtifactList { - // Output only. A list of artifact metadata. + // Optional. A list of artifact metadata. repeated RuntimeArtifact artifacts = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; + [(google.api.field_behavior) = OPTIONAL]; } // Runtime inputs data of the task. message Inputs { - // Output only. Input artifacts. + // Optional. Input artifacts. map artifacts = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; + [(google.api.field_behavior) = OPTIONAL]; - // Output only. Input parameters. + // Optional. Input parameters. map parameter_values = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; + [(google.api.field_behavior) = OPTIONAL]; } - // Output only. The system generated ID of the task. Retrieved from original - // run. - int64 task_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Optional. The system generated ID of the task. Retrieved from original run. + int64 task_id = 1 [(google.api.field_behavior) = OPTIONAL]; - // Output only. The name of the task. - string task_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Optional. The name of the task. + string task_name = 2 [(google.api.field_behavior) = OPTIONAL]; - // Output only. The runtime input of the task overridden by the user. - Inputs inputs = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Optional. The runtime input of the task overridden by the user. + Inputs inputs = 3 [(google.api.field_behavior) = OPTIONAL]; - // Output only. Whether to skip this task. Default value is False. - bool skip_task = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Optional. Whether to skip this task. Default value is False. + bool skip_task = 4 [(google.api.field_behavior) = OPTIONAL]; - // Output only. Whether to skip downstream tasks. Default value is False. - bool skip_downstream_tasks = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Optional. Whether to skip downstream tasks. Default value is False. + bool skip_downstream_tasks = 5 [(google.api.field_behavior) = OPTIONAL]; } diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/tuning_job.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/tuning_job.proto index 308b2bc9640..06939146414 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/tuning_job.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/tuning_job.proto @@ -384,7 +384,7 @@ message SupervisedHyperParameters { AdapterSize adapter_size = 3 [(google.api.field_behavior) = OPTIONAL]; } -// Tuning Spec for Supervised Tuning. +// Tuning Spec for Supervised Tuning for first party models. message SupervisedTuningSpec { // Required. Cloud Storage path to file containing training dataset for // tuning. The dataset must be formatted as a JSONL file. @@ -450,3 +450,26 @@ message DistillationHyperParameters { SupervisedHyperParameters.AdapterSize adapter_size = 3 [(google.api.field_behavior) = OPTIONAL]; } + +// TunedModel Reference for legacy model migration. +message TunedModelRef { + // The Tuned Model Reference for the model. + oneof tuned_model_ref { + // Support migration from model registry. + string tuned_model = 1 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + }]; + + // Support migration from tuning job list page, from gemini-1.0-pro-002 + // to 1.5 and above. + string tuning_job = 2 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TuningJob" + }]; + + // Support migration from tuning job list page, from bison model to gemini + // model. + string pipeline_job = 3 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/PipelineJob" + }]; + } +} diff --git a/packages/google-cloud-aiplatform/protos/protos.d.ts b/packages/google-cloud-aiplatform/protos/protos.d.ts index 508cfe35ac3..110af600711 100644 --- a/packages/google-cloud-aiplatform/protos/protos.d.ts +++ b/packages/google-cloud-aiplatform/protos/protos.d.ts @@ -53071,6 +53071,20 @@ export namespace google { * @returns Promise */ public cancelTuningJob(request: google.cloud.aiplatform.v1.ICancelTuningJobRequest): Promise; + + /** + * Calls RebaseTunedModel. + * @param request RebaseTunedModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public rebaseTunedModel(request: google.cloud.aiplatform.v1.IRebaseTunedModelRequest, callback: google.cloud.aiplatform.v1.GenAiTuningService.RebaseTunedModelCallback): void; + + /** + * Calls RebaseTunedModel. + * @param request RebaseTunedModelRequest message or plain object + * @returns Promise + */ + public rebaseTunedModel(request: google.cloud.aiplatform.v1.IRebaseTunedModelRequest): Promise; } namespace GenAiTuningService { @@ -53102,6 +53116,13 @@ export namespace google { * @param [response] Empty */ type CancelTuningJobCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.GenAiTuningService|rebaseTunedModel}. + * @param error Error, if any + * @param [response] Operation + */ + type RebaseTunedModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; } /** Properties of a CreateTuningJobRequest. */ @@ -53619,6 +53640,224 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a RebaseTunedModelRequest. */ + interface IRebaseTunedModelRequest { + + /** RebaseTunedModelRequest parent */ + parent?: (string|null); + + /** RebaseTunedModelRequest tunedModelRef */ + tunedModelRef?: (google.cloud.aiplatform.v1.ITunedModelRef|null); + + /** RebaseTunedModelRequest tuningJob */ + tuningJob?: (google.cloud.aiplatform.v1.ITuningJob|null); + + /** RebaseTunedModelRequest artifactDestination */ + artifactDestination?: (google.cloud.aiplatform.v1.IGcsDestination|null); + + /** RebaseTunedModelRequest deployToSameEndpoint */ + deployToSameEndpoint?: (boolean|null); + } + + /** Represents a RebaseTunedModelRequest. */ + class RebaseTunedModelRequest implements IRebaseTunedModelRequest { + + /** + * Constructs a new RebaseTunedModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IRebaseTunedModelRequest); + + /** RebaseTunedModelRequest parent. */ + public parent: string; + + /** RebaseTunedModelRequest tunedModelRef. */ + public tunedModelRef?: (google.cloud.aiplatform.v1.ITunedModelRef|null); + + /** RebaseTunedModelRequest tuningJob. */ + public tuningJob?: (google.cloud.aiplatform.v1.ITuningJob|null); + + /** RebaseTunedModelRequest artifactDestination. */ + public artifactDestination?: (google.cloud.aiplatform.v1.IGcsDestination|null); + + /** RebaseTunedModelRequest deployToSameEndpoint. */ + public deployToSameEndpoint: boolean; + + /** + * Creates a new RebaseTunedModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RebaseTunedModelRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IRebaseTunedModelRequest): google.cloud.aiplatform.v1.RebaseTunedModelRequest; + + /** + * Encodes the specified RebaseTunedModelRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.RebaseTunedModelRequest.verify|verify} messages. + * @param message RebaseTunedModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IRebaseTunedModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RebaseTunedModelRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RebaseTunedModelRequest.verify|verify} messages. + * @param message RebaseTunedModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IRebaseTunedModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RebaseTunedModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RebaseTunedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.RebaseTunedModelRequest; + + /** + * Decodes a RebaseTunedModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RebaseTunedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.RebaseTunedModelRequest; + + /** + * Verifies a RebaseTunedModelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RebaseTunedModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RebaseTunedModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.RebaseTunedModelRequest; + + /** + * Creates a plain object from a RebaseTunedModelRequest message. Also converts values to other types if specified. + * @param message RebaseTunedModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.RebaseTunedModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RebaseTunedModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RebaseTunedModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RebaseTunedModelOperationMetadata. */ + interface IRebaseTunedModelOperationMetadata { + + /** RebaseTunedModelOperationMetadata genericMetadata */ + genericMetadata?: (google.cloud.aiplatform.v1.IGenericOperationMetadata|null); + } + + /** Represents a RebaseTunedModelOperationMetadata. */ + class RebaseTunedModelOperationMetadata implements IRebaseTunedModelOperationMetadata { + + /** + * Constructs a new RebaseTunedModelOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IRebaseTunedModelOperationMetadata); + + /** RebaseTunedModelOperationMetadata genericMetadata. */ + public genericMetadata?: (google.cloud.aiplatform.v1.IGenericOperationMetadata|null); + + /** + * Creates a new RebaseTunedModelOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns RebaseTunedModelOperationMetadata instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IRebaseTunedModelOperationMetadata): google.cloud.aiplatform.v1.RebaseTunedModelOperationMetadata; + + /** + * Encodes the specified RebaseTunedModelOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.RebaseTunedModelOperationMetadata.verify|verify} messages. + * @param message RebaseTunedModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IRebaseTunedModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RebaseTunedModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RebaseTunedModelOperationMetadata.verify|verify} messages. + * @param message RebaseTunedModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IRebaseTunedModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RebaseTunedModelOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RebaseTunedModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.RebaseTunedModelOperationMetadata; + + /** + * Decodes a RebaseTunedModelOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RebaseTunedModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.RebaseTunedModelOperationMetadata; + + /** + * Verifies a RebaseTunedModelOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RebaseTunedModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RebaseTunedModelOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.RebaseTunedModelOperationMetadata; + + /** + * Creates a plain object from a RebaseTunedModelOperationMetadata message. Also converts values to other types if specified. + * @param message RebaseTunedModelOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.RebaseTunedModelOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RebaseTunedModelOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RebaseTunedModelOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a TuningJob. */ interface ITuningJob { @@ -54659,6 +54898,118 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a TunedModelRef. */ + interface ITunedModelRef { + + /** TunedModelRef tunedModel */ + tunedModel?: (string|null); + + /** TunedModelRef tuningJob */ + tuningJob?: (string|null); + + /** TunedModelRef pipelineJob */ + pipelineJob?: (string|null); + } + + /** Represents a TunedModelRef. */ + class TunedModelRef implements ITunedModelRef { + + /** + * Constructs a new TunedModelRef. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.ITunedModelRef); + + /** TunedModelRef tunedModel. */ + public tunedModel?: (string|null); + + /** TunedModelRef tuningJob. */ + public tuningJob?: (string|null); + + /** TunedModelRef pipelineJob. */ + public pipelineJob?: (string|null); + + /** TunedModelRef tunedModelRef. */ + public tunedModelRef?: ("tunedModel"|"tuningJob"|"pipelineJob"); + + /** + * Creates a new TunedModelRef instance using the specified properties. + * @param [properties] Properties to set + * @returns TunedModelRef instance + */ + public static create(properties?: google.cloud.aiplatform.v1.ITunedModelRef): google.cloud.aiplatform.v1.TunedModelRef; + + /** + * Encodes the specified TunedModelRef message. Does not implicitly {@link google.cloud.aiplatform.v1.TunedModelRef.verify|verify} messages. + * @param message TunedModelRef message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.ITunedModelRef, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TunedModelRef message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TunedModelRef.verify|verify} messages. + * @param message TunedModelRef message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.ITunedModelRef, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TunedModelRef message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TunedModelRef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.TunedModelRef; + + /** + * Decodes a TunedModelRef message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TunedModelRef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.TunedModelRef; + + /** + * Verifies a TunedModelRef message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TunedModelRef message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TunedModelRef + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.TunedModelRef; + + /** + * Creates a plain object from a TunedModelRef message. Also converts values to other types if specified. + * @param message TunedModelRef + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.TunedModelRef, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TunedModelRef to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TunedModelRef + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a HyperparameterTuningJob. */ interface IHyperparameterTuningJob { @@ -181745,6 +182096,20 @@ export namespace google { * @returns Promise */ public cancelTuningJob(request: google.cloud.aiplatform.v1beta1.ICancelTuningJobRequest): Promise; + + /** + * Calls RebaseTunedModel. + * @param request RebaseTunedModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public rebaseTunedModel(request: google.cloud.aiplatform.v1beta1.IRebaseTunedModelRequest, callback: google.cloud.aiplatform.v1beta1.GenAiTuningService.RebaseTunedModelCallback): void; + + /** + * Calls RebaseTunedModel. + * @param request RebaseTunedModelRequest message or plain object + * @returns Promise + */ + public rebaseTunedModel(request: google.cloud.aiplatform.v1beta1.IRebaseTunedModelRequest): Promise; } namespace GenAiTuningService { @@ -181776,6 +182141,13 @@ export namespace google { * @param [response] Empty */ type CancelTuningJobCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1beta1.GenAiTuningService|rebaseTunedModel}. + * @param error Error, if any + * @param [response] Operation + */ + type RebaseTunedModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; } /** Properties of a CreateTuningJobRequest. */ @@ -182293,6 +182665,224 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a RebaseTunedModelRequest. */ + interface IRebaseTunedModelRequest { + + /** RebaseTunedModelRequest parent */ + parent?: (string|null); + + /** RebaseTunedModelRequest tunedModelRef */ + tunedModelRef?: (google.cloud.aiplatform.v1beta1.ITunedModelRef|null); + + /** RebaseTunedModelRequest tuningJob */ + tuningJob?: (google.cloud.aiplatform.v1beta1.ITuningJob|null); + + /** RebaseTunedModelRequest artifactDestination */ + artifactDestination?: (google.cloud.aiplatform.v1beta1.IGcsDestination|null); + + /** RebaseTunedModelRequest deployToSameEndpoint */ + deployToSameEndpoint?: (boolean|null); + } + + /** Represents a RebaseTunedModelRequest. */ + class RebaseTunedModelRequest implements IRebaseTunedModelRequest { + + /** + * Constructs a new RebaseTunedModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IRebaseTunedModelRequest); + + /** RebaseTunedModelRequest parent. */ + public parent: string; + + /** RebaseTunedModelRequest tunedModelRef. */ + public tunedModelRef?: (google.cloud.aiplatform.v1beta1.ITunedModelRef|null); + + /** RebaseTunedModelRequest tuningJob. */ + public tuningJob?: (google.cloud.aiplatform.v1beta1.ITuningJob|null); + + /** RebaseTunedModelRequest artifactDestination. */ + public artifactDestination?: (google.cloud.aiplatform.v1beta1.IGcsDestination|null); + + /** RebaseTunedModelRequest deployToSameEndpoint. */ + public deployToSameEndpoint: boolean; + + /** + * Creates a new RebaseTunedModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RebaseTunedModelRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IRebaseTunedModelRequest): google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest; + + /** + * Encodes the specified RebaseTunedModelRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest.verify|verify} messages. + * @param message RebaseTunedModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IRebaseTunedModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RebaseTunedModelRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest.verify|verify} messages. + * @param message RebaseTunedModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IRebaseTunedModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RebaseTunedModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RebaseTunedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest; + + /** + * Decodes a RebaseTunedModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RebaseTunedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest; + + /** + * Verifies a RebaseTunedModelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RebaseTunedModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RebaseTunedModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest; + + /** + * Creates a plain object from a RebaseTunedModelRequest message. Also converts values to other types if specified. + * @param message RebaseTunedModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RebaseTunedModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RebaseTunedModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RebaseTunedModelOperationMetadata. */ + interface IRebaseTunedModelOperationMetadata { + + /** RebaseTunedModelOperationMetadata genericMetadata */ + genericMetadata?: (google.cloud.aiplatform.v1beta1.IGenericOperationMetadata|null); + } + + /** Represents a RebaseTunedModelOperationMetadata. */ + class RebaseTunedModelOperationMetadata implements IRebaseTunedModelOperationMetadata { + + /** + * Constructs a new RebaseTunedModelOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IRebaseTunedModelOperationMetadata); + + /** RebaseTunedModelOperationMetadata genericMetadata. */ + public genericMetadata?: (google.cloud.aiplatform.v1beta1.IGenericOperationMetadata|null); + + /** + * Creates a new RebaseTunedModelOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns RebaseTunedModelOperationMetadata instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IRebaseTunedModelOperationMetadata): google.cloud.aiplatform.v1beta1.RebaseTunedModelOperationMetadata; + + /** + * Encodes the specified RebaseTunedModelOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RebaseTunedModelOperationMetadata.verify|verify} messages. + * @param message RebaseTunedModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IRebaseTunedModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RebaseTunedModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RebaseTunedModelOperationMetadata.verify|verify} messages. + * @param message RebaseTunedModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IRebaseTunedModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RebaseTunedModelOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RebaseTunedModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1beta1.RebaseTunedModelOperationMetadata; + + /** + * Decodes a RebaseTunedModelOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RebaseTunedModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1beta1.RebaseTunedModelOperationMetadata; + + /** + * Verifies a RebaseTunedModelOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RebaseTunedModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RebaseTunedModelOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.RebaseTunedModelOperationMetadata; + + /** + * Creates a plain object from a RebaseTunedModelOperationMetadata message. Also converts values to other types if specified. + * @param message RebaseTunedModelOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.RebaseTunedModelOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RebaseTunedModelOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RebaseTunedModelOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a TuningJob. */ interface ITuningJob { @@ -184095,6 +184685,118 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a TunedModelRef. */ + interface ITunedModelRef { + + /** TunedModelRef tunedModel */ + tunedModel?: (string|null); + + /** TunedModelRef tuningJob */ + tuningJob?: (string|null); + + /** TunedModelRef pipelineJob */ + pipelineJob?: (string|null); + } + + /** Represents a TunedModelRef. */ + class TunedModelRef implements ITunedModelRef { + + /** + * Constructs a new TunedModelRef. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.ITunedModelRef); + + /** TunedModelRef tunedModel. */ + public tunedModel?: (string|null); + + /** TunedModelRef tuningJob. */ + public tuningJob?: (string|null); + + /** TunedModelRef pipelineJob. */ + public pipelineJob?: (string|null); + + /** TunedModelRef tunedModelRef. */ + public tunedModelRef?: ("tunedModel"|"tuningJob"|"pipelineJob"); + + /** + * Creates a new TunedModelRef instance using the specified properties. + * @param [properties] Properties to set + * @returns TunedModelRef instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.ITunedModelRef): google.cloud.aiplatform.v1beta1.TunedModelRef; + + /** + * Encodes the specified TunedModelRef message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.TunedModelRef.verify|verify} messages. + * @param message TunedModelRef message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.ITunedModelRef, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TunedModelRef message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.TunedModelRef.verify|verify} messages. + * @param message TunedModelRef message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.ITunedModelRef, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TunedModelRef message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TunedModelRef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1beta1.TunedModelRef; + + /** + * Decodes a TunedModelRef message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TunedModelRef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1beta1.TunedModelRef; + + /** + * Verifies a TunedModelRef message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TunedModelRef message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TunedModelRef + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.TunedModelRef; + + /** + * Creates a plain object from a TunedModelRef message. Also converts values to other types if specified. + * @param message TunedModelRef + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.TunedModelRef, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TunedModelRef to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TunedModelRef + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a HyperparameterTuningJob. */ interface IHyperparameterTuningJob { diff --git a/packages/google-cloud-aiplatform/protos/protos.js b/packages/google-cloud-aiplatform/protos/protos.js index d4a6a7c79b1..7810b64f1b9 100644 --- a/packages/google-cloud-aiplatform/protos/protos.js +++ b/packages/google-cloud-aiplatform/protos/protos.js @@ -131487,6 +131487,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.aiplatform.v1.GenAiTuningService|rebaseTunedModel}. + * @memberof google.cloud.aiplatform.v1.GenAiTuningService + * @typedef RebaseTunedModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RebaseTunedModel. + * @function rebaseTunedModel + * @memberof google.cloud.aiplatform.v1.GenAiTuningService + * @instance + * @param {google.cloud.aiplatform.v1.IRebaseTunedModelRequest} request RebaseTunedModelRequest message or plain object + * @param {google.cloud.aiplatform.v1.GenAiTuningService.RebaseTunedModelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GenAiTuningService.prototype.rebaseTunedModel = function rebaseTunedModel(request, callback) { + return this.rpcCall(rebaseTunedModel, $root.google.cloud.aiplatform.v1.RebaseTunedModelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RebaseTunedModel" }); + + /** + * Calls RebaseTunedModel. + * @function rebaseTunedModel + * @memberof google.cloud.aiplatform.v1.GenAiTuningService + * @instance + * @param {google.cloud.aiplatform.v1.IRebaseTunedModelRequest} request RebaseTunedModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return GenAiTuningService; })(); @@ -132649,6 +132682,525 @@ return CancelTuningJobRequest; })(); + v1.RebaseTunedModelRequest = (function() { + + /** + * Properties of a RebaseTunedModelRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface IRebaseTunedModelRequest + * @property {string|null} [parent] RebaseTunedModelRequest parent + * @property {google.cloud.aiplatform.v1.ITunedModelRef|null} [tunedModelRef] RebaseTunedModelRequest tunedModelRef + * @property {google.cloud.aiplatform.v1.ITuningJob|null} [tuningJob] RebaseTunedModelRequest tuningJob + * @property {google.cloud.aiplatform.v1.IGcsDestination|null} [artifactDestination] RebaseTunedModelRequest artifactDestination + * @property {boolean|null} [deployToSameEndpoint] RebaseTunedModelRequest deployToSameEndpoint + */ + + /** + * Constructs a new RebaseTunedModelRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a RebaseTunedModelRequest. + * @implements IRebaseTunedModelRequest + * @constructor + * @param {google.cloud.aiplatform.v1.IRebaseTunedModelRequest=} [properties] Properties to set + */ + function RebaseTunedModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RebaseTunedModelRequest parent. + * @member {string} parent + * @memberof google.cloud.aiplatform.v1.RebaseTunedModelRequest + * @instance + */ + RebaseTunedModelRequest.prototype.parent = ""; + + /** + * RebaseTunedModelRequest tunedModelRef. + * @member {google.cloud.aiplatform.v1.ITunedModelRef|null|undefined} tunedModelRef + * @memberof google.cloud.aiplatform.v1.RebaseTunedModelRequest + * @instance + */ + RebaseTunedModelRequest.prototype.tunedModelRef = null; + + /** + * RebaseTunedModelRequest tuningJob. + * @member {google.cloud.aiplatform.v1.ITuningJob|null|undefined} tuningJob + * @memberof google.cloud.aiplatform.v1.RebaseTunedModelRequest + * @instance + */ + RebaseTunedModelRequest.prototype.tuningJob = null; + + /** + * RebaseTunedModelRequest artifactDestination. + * @member {google.cloud.aiplatform.v1.IGcsDestination|null|undefined} artifactDestination + * @memberof google.cloud.aiplatform.v1.RebaseTunedModelRequest + * @instance + */ + RebaseTunedModelRequest.prototype.artifactDestination = null; + + /** + * RebaseTunedModelRequest deployToSameEndpoint. + * @member {boolean} deployToSameEndpoint + * @memberof google.cloud.aiplatform.v1.RebaseTunedModelRequest + * @instance + */ + RebaseTunedModelRequest.prototype.deployToSameEndpoint = false; + + /** + * Creates a new RebaseTunedModelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.RebaseTunedModelRequest + * @static + * @param {google.cloud.aiplatform.v1.IRebaseTunedModelRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.RebaseTunedModelRequest} RebaseTunedModelRequest instance + */ + RebaseTunedModelRequest.create = function create(properties) { + return new RebaseTunedModelRequest(properties); + }; + + /** + * Encodes the specified RebaseTunedModelRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.RebaseTunedModelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.RebaseTunedModelRequest + * @static + * @param {google.cloud.aiplatform.v1.IRebaseTunedModelRequest} message RebaseTunedModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RebaseTunedModelRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.tunedModelRef != null && Object.hasOwnProperty.call(message, "tunedModelRef")) + $root.google.cloud.aiplatform.v1.TunedModelRef.encode(message.tunedModelRef, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.tuningJob != null && Object.hasOwnProperty.call(message, "tuningJob")) + $root.google.cloud.aiplatform.v1.TuningJob.encode(message.tuningJob, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.artifactDestination != null && Object.hasOwnProperty.call(message, "artifactDestination")) + $root.google.cloud.aiplatform.v1.GcsDestination.encode(message.artifactDestination, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.deployToSameEndpoint != null && Object.hasOwnProperty.call(message, "deployToSameEndpoint")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.deployToSameEndpoint); + return writer; + }; + + /** + * Encodes the specified RebaseTunedModelRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RebaseTunedModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.RebaseTunedModelRequest + * @static + * @param {google.cloud.aiplatform.v1.IRebaseTunedModelRequest} message RebaseTunedModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RebaseTunedModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RebaseTunedModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.RebaseTunedModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.RebaseTunedModelRequest} RebaseTunedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RebaseTunedModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.RebaseTunedModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.tunedModelRef = $root.google.cloud.aiplatform.v1.TunedModelRef.decode(reader, reader.uint32()); + break; + } + case 3: { + message.tuningJob = $root.google.cloud.aiplatform.v1.TuningJob.decode(reader, reader.uint32()); + break; + } + case 4: { + message.artifactDestination = $root.google.cloud.aiplatform.v1.GcsDestination.decode(reader, reader.uint32()); + break; + } + case 5: { + message.deployToSameEndpoint = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RebaseTunedModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.RebaseTunedModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.RebaseTunedModelRequest} RebaseTunedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RebaseTunedModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RebaseTunedModelRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.RebaseTunedModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RebaseTunedModelRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.tunedModelRef != null && message.hasOwnProperty("tunedModelRef")) { + var error = $root.google.cloud.aiplatform.v1.TunedModelRef.verify(message.tunedModelRef); + if (error) + return "tunedModelRef." + error; + } + if (message.tuningJob != null && message.hasOwnProperty("tuningJob")) { + var error = $root.google.cloud.aiplatform.v1.TuningJob.verify(message.tuningJob); + if (error) + return "tuningJob." + error; + } + if (message.artifactDestination != null && message.hasOwnProperty("artifactDestination")) { + var error = $root.google.cloud.aiplatform.v1.GcsDestination.verify(message.artifactDestination); + if (error) + return "artifactDestination." + error; + } + if (message.deployToSameEndpoint != null && message.hasOwnProperty("deployToSameEndpoint")) + if (typeof message.deployToSameEndpoint !== "boolean") + return "deployToSameEndpoint: boolean expected"; + return null; + }; + + /** + * Creates a RebaseTunedModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.RebaseTunedModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.RebaseTunedModelRequest} RebaseTunedModelRequest + */ + RebaseTunedModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.RebaseTunedModelRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.RebaseTunedModelRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.tunedModelRef != null) { + if (typeof object.tunedModelRef !== "object") + throw TypeError(".google.cloud.aiplatform.v1.RebaseTunedModelRequest.tunedModelRef: object expected"); + message.tunedModelRef = $root.google.cloud.aiplatform.v1.TunedModelRef.fromObject(object.tunedModelRef); + } + if (object.tuningJob != null) { + if (typeof object.tuningJob !== "object") + throw TypeError(".google.cloud.aiplatform.v1.RebaseTunedModelRequest.tuningJob: object expected"); + message.tuningJob = $root.google.cloud.aiplatform.v1.TuningJob.fromObject(object.tuningJob); + } + if (object.artifactDestination != null) { + if (typeof object.artifactDestination !== "object") + throw TypeError(".google.cloud.aiplatform.v1.RebaseTunedModelRequest.artifactDestination: object expected"); + message.artifactDestination = $root.google.cloud.aiplatform.v1.GcsDestination.fromObject(object.artifactDestination); + } + if (object.deployToSameEndpoint != null) + message.deployToSameEndpoint = Boolean(object.deployToSameEndpoint); + return message; + }; + + /** + * Creates a plain object from a RebaseTunedModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.RebaseTunedModelRequest + * @static + * @param {google.cloud.aiplatform.v1.RebaseTunedModelRequest} message RebaseTunedModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RebaseTunedModelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.tunedModelRef = null; + object.tuningJob = null; + object.artifactDestination = null; + object.deployToSameEndpoint = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.tunedModelRef != null && message.hasOwnProperty("tunedModelRef")) + object.tunedModelRef = $root.google.cloud.aiplatform.v1.TunedModelRef.toObject(message.tunedModelRef, options); + if (message.tuningJob != null && message.hasOwnProperty("tuningJob")) + object.tuningJob = $root.google.cloud.aiplatform.v1.TuningJob.toObject(message.tuningJob, options); + if (message.artifactDestination != null && message.hasOwnProperty("artifactDestination")) + object.artifactDestination = $root.google.cloud.aiplatform.v1.GcsDestination.toObject(message.artifactDestination, options); + if (message.deployToSameEndpoint != null && message.hasOwnProperty("deployToSameEndpoint")) + object.deployToSameEndpoint = message.deployToSameEndpoint; + return object; + }; + + /** + * Converts this RebaseTunedModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.RebaseTunedModelRequest + * @instance + * @returns {Object.} JSON object + */ + RebaseTunedModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RebaseTunedModelRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.RebaseTunedModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RebaseTunedModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.RebaseTunedModelRequest"; + }; + + return RebaseTunedModelRequest; + })(); + + v1.RebaseTunedModelOperationMetadata = (function() { + + /** + * Properties of a RebaseTunedModelOperationMetadata. + * @memberof google.cloud.aiplatform.v1 + * @interface IRebaseTunedModelOperationMetadata + * @property {google.cloud.aiplatform.v1.IGenericOperationMetadata|null} [genericMetadata] RebaseTunedModelOperationMetadata genericMetadata + */ + + /** + * Constructs a new RebaseTunedModelOperationMetadata. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a RebaseTunedModelOperationMetadata. + * @implements IRebaseTunedModelOperationMetadata + * @constructor + * @param {google.cloud.aiplatform.v1.IRebaseTunedModelOperationMetadata=} [properties] Properties to set + */ + function RebaseTunedModelOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RebaseTunedModelOperationMetadata genericMetadata. + * @member {google.cloud.aiplatform.v1.IGenericOperationMetadata|null|undefined} genericMetadata + * @memberof google.cloud.aiplatform.v1.RebaseTunedModelOperationMetadata + * @instance + */ + RebaseTunedModelOperationMetadata.prototype.genericMetadata = null; + + /** + * Creates a new RebaseTunedModelOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.RebaseTunedModelOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1.IRebaseTunedModelOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.RebaseTunedModelOperationMetadata} RebaseTunedModelOperationMetadata instance + */ + RebaseTunedModelOperationMetadata.create = function create(properties) { + return new RebaseTunedModelOperationMetadata(properties); + }; + + /** + * Encodes the specified RebaseTunedModelOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.RebaseTunedModelOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.RebaseTunedModelOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1.IRebaseTunedModelOperationMetadata} message RebaseTunedModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RebaseTunedModelOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.genericMetadata != null && Object.hasOwnProperty.call(message, "genericMetadata")) + $root.google.cloud.aiplatform.v1.GenericOperationMetadata.encode(message.genericMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RebaseTunedModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RebaseTunedModelOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.RebaseTunedModelOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1.IRebaseTunedModelOperationMetadata} message RebaseTunedModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RebaseTunedModelOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RebaseTunedModelOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.RebaseTunedModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.RebaseTunedModelOperationMetadata} RebaseTunedModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RebaseTunedModelOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.RebaseTunedModelOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RebaseTunedModelOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.RebaseTunedModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.RebaseTunedModelOperationMetadata} RebaseTunedModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RebaseTunedModelOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RebaseTunedModelOperationMetadata message. + * @function verify + * @memberof google.cloud.aiplatform.v1.RebaseTunedModelOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RebaseTunedModelOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) { + var error = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.verify(message.genericMetadata); + if (error) + return "genericMetadata." + error; + } + return null; + }; + + /** + * Creates a RebaseTunedModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.RebaseTunedModelOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.RebaseTunedModelOperationMetadata} RebaseTunedModelOperationMetadata + */ + RebaseTunedModelOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.RebaseTunedModelOperationMetadata) + return object; + var message = new $root.google.cloud.aiplatform.v1.RebaseTunedModelOperationMetadata(); + if (object.genericMetadata != null) { + if (typeof object.genericMetadata !== "object") + throw TypeError(".google.cloud.aiplatform.v1.RebaseTunedModelOperationMetadata.genericMetadata: object expected"); + message.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.fromObject(object.genericMetadata); + } + return message; + }; + + /** + * Creates a plain object from a RebaseTunedModelOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.RebaseTunedModelOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1.RebaseTunedModelOperationMetadata} message RebaseTunedModelOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RebaseTunedModelOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.genericMetadata = null; + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) + object.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.toObject(message.genericMetadata, options); + return object; + }; + + /** + * Converts this RebaseTunedModelOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.RebaseTunedModelOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + RebaseTunedModelOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RebaseTunedModelOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.RebaseTunedModelOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RebaseTunedModelOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.RebaseTunedModelOperationMetadata"; + }; + + return RebaseTunedModelOperationMetadata; + })(); + v1.TuningJob = (function() { /** @@ -135688,6 +136240,285 @@ return SupervisedTuningSpec; })(); + v1.TunedModelRef = (function() { + + /** + * Properties of a TunedModelRef. + * @memberof google.cloud.aiplatform.v1 + * @interface ITunedModelRef + * @property {string|null} [tunedModel] TunedModelRef tunedModel + * @property {string|null} [tuningJob] TunedModelRef tuningJob + * @property {string|null} [pipelineJob] TunedModelRef pipelineJob + */ + + /** + * Constructs a new TunedModelRef. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a TunedModelRef. + * @implements ITunedModelRef + * @constructor + * @param {google.cloud.aiplatform.v1.ITunedModelRef=} [properties] Properties to set + */ + function TunedModelRef(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TunedModelRef tunedModel. + * @member {string|null|undefined} tunedModel + * @memberof google.cloud.aiplatform.v1.TunedModelRef + * @instance + */ + TunedModelRef.prototype.tunedModel = null; + + /** + * TunedModelRef tuningJob. + * @member {string|null|undefined} tuningJob + * @memberof google.cloud.aiplatform.v1.TunedModelRef + * @instance + */ + TunedModelRef.prototype.tuningJob = null; + + /** + * TunedModelRef pipelineJob. + * @member {string|null|undefined} pipelineJob + * @memberof google.cloud.aiplatform.v1.TunedModelRef + * @instance + */ + TunedModelRef.prototype.pipelineJob = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TunedModelRef tunedModelRef. + * @member {"tunedModel"|"tuningJob"|"pipelineJob"|undefined} tunedModelRef + * @memberof google.cloud.aiplatform.v1.TunedModelRef + * @instance + */ + Object.defineProperty(TunedModelRef.prototype, "tunedModelRef", { + get: $util.oneOfGetter($oneOfFields = ["tunedModel", "tuningJob", "pipelineJob"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TunedModelRef instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.TunedModelRef + * @static + * @param {google.cloud.aiplatform.v1.ITunedModelRef=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.TunedModelRef} TunedModelRef instance + */ + TunedModelRef.create = function create(properties) { + return new TunedModelRef(properties); + }; + + /** + * Encodes the specified TunedModelRef message. Does not implicitly {@link google.cloud.aiplatform.v1.TunedModelRef.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.TunedModelRef + * @static + * @param {google.cloud.aiplatform.v1.ITunedModelRef} message TunedModelRef message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TunedModelRef.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tunedModel != null && Object.hasOwnProperty.call(message, "tunedModel")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tunedModel); + if (message.tuningJob != null && Object.hasOwnProperty.call(message, "tuningJob")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tuningJob); + if (message.pipelineJob != null && Object.hasOwnProperty.call(message, "pipelineJob")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pipelineJob); + return writer; + }; + + /** + * Encodes the specified TunedModelRef message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TunedModelRef.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.TunedModelRef + * @static + * @param {google.cloud.aiplatform.v1.ITunedModelRef} message TunedModelRef message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TunedModelRef.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TunedModelRef message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.TunedModelRef + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.TunedModelRef} TunedModelRef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TunedModelRef.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.TunedModelRef(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tunedModel = reader.string(); + break; + } + case 2: { + message.tuningJob = reader.string(); + break; + } + case 3: { + message.pipelineJob = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TunedModelRef message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.TunedModelRef + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.TunedModelRef} TunedModelRef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TunedModelRef.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TunedModelRef message. + * @function verify + * @memberof google.cloud.aiplatform.v1.TunedModelRef + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TunedModelRef.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tunedModel != null && message.hasOwnProperty("tunedModel")) { + properties.tunedModelRef = 1; + if (!$util.isString(message.tunedModel)) + return "tunedModel: string expected"; + } + if (message.tuningJob != null && message.hasOwnProperty("tuningJob")) { + if (properties.tunedModelRef === 1) + return "tunedModelRef: multiple values"; + properties.tunedModelRef = 1; + if (!$util.isString(message.tuningJob)) + return "tuningJob: string expected"; + } + if (message.pipelineJob != null && message.hasOwnProperty("pipelineJob")) { + if (properties.tunedModelRef === 1) + return "tunedModelRef: multiple values"; + properties.tunedModelRef = 1; + if (!$util.isString(message.pipelineJob)) + return "pipelineJob: string expected"; + } + return null; + }; + + /** + * Creates a TunedModelRef message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.TunedModelRef + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.TunedModelRef} TunedModelRef + */ + TunedModelRef.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.TunedModelRef) + return object; + var message = new $root.google.cloud.aiplatform.v1.TunedModelRef(); + if (object.tunedModel != null) + message.tunedModel = String(object.tunedModel); + if (object.tuningJob != null) + message.tuningJob = String(object.tuningJob); + if (object.pipelineJob != null) + message.pipelineJob = String(object.pipelineJob); + return message; + }; + + /** + * Creates a plain object from a TunedModelRef message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.TunedModelRef + * @static + * @param {google.cloud.aiplatform.v1.TunedModelRef} message TunedModelRef + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TunedModelRef.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.tunedModel != null && message.hasOwnProperty("tunedModel")) { + object.tunedModel = message.tunedModel; + if (options.oneofs) + object.tunedModelRef = "tunedModel"; + } + if (message.tuningJob != null && message.hasOwnProperty("tuningJob")) { + object.tuningJob = message.tuningJob; + if (options.oneofs) + object.tunedModelRef = "tuningJob"; + } + if (message.pipelineJob != null && message.hasOwnProperty("pipelineJob")) { + object.pipelineJob = message.pipelineJob; + if (options.oneofs) + object.tunedModelRef = "pipelineJob"; + } + return object; + }; + + /** + * Converts this TunedModelRef to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.TunedModelRef + * @instance + * @returns {Object.} JSON object + */ + TunedModelRef.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TunedModelRef + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.TunedModelRef + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TunedModelRef.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.TunedModelRef"; + }; + + return TunedModelRef; + })(); + v1.HyperparameterTuningJob = (function() { /** @@ -444416,6 +445247,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.aiplatform.v1beta1.GenAiTuningService|rebaseTunedModel}. + * @memberof google.cloud.aiplatform.v1beta1.GenAiTuningService + * @typedef RebaseTunedModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RebaseTunedModel. + * @function rebaseTunedModel + * @memberof google.cloud.aiplatform.v1beta1.GenAiTuningService + * @instance + * @param {google.cloud.aiplatform.v1beta1.IRebaseTunedModelRequest} request RebaseTunedModelRequest message or plain object + * @param {google.cloud.aiplatform.v1beta1.GenAiTuningService.RebaseTunedModelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GenAiTuningService.prototype.rebaseTunedModel = function rebaseTunedModel(request, callback) { + return this.rpcCall(rebaseTunedModel, $root.google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RebaseTunedModel" }); + + /** + * Calls RebaseTunedModel. + * @function rebaseTunedModel + * @memberof google.cloud.aiplatform.v1beta1.GenAiTuningService + * @instance + * @param {google.cloud.aiplatform.v1beta1.IRebaseTunedModelRequest} request RebaseTunedModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return GenAiTuningService; })(); @@ -445578,6 +446442,525 @@ return CancelTuningJobRequest; })(); + v1beta1.RebaseTunedModelRequest = (function() { + + /** + * Properties of a RebaseTunedModelRequest. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IRebaseTunedModelRequest + * @property {string|null} [parent] RebaseTunedModelRequest parent + * @property {google.cloud.aiplatform.v1beta1.ITunedModelRef|null} [tunedModelRef] RebaseTunedModelRequest tunedModelRef + * @property {google.cloud.aiplatform.v1beta1.ITuningJob|null} [tuningJob] RebaseTunedModelRequest tuningJob + * @property {google.cloud.aiplatform.v1beta1.IGcsDestination|null} [artifactDestination] RebaseTunedModelRequest artifactDestination + * @property {boolean|null} [deployToSameEndpoint] RebaseTunedModelRequest deployToSameEndpoint + */ + + /** + * Constructs a new RebaseTunedModelRequest. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a RebaseTunedModelRequest. + * @implements IRebaseTunedModelRequest + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IRebaseTunedModelRequest=} [properties] Properties to set + */ + function RebaseTunedModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RebaseTunedModelRequest parent. + * @member {string} parent + * @memberof google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest + * @instance + */ + RebaseTunedModelRequest.prototype.parent = ""; + + /** + * RebaseTunedModelRequest tunedModelRef. + * @member {google.cloud.aiplatform.v1beta1.ITunedModelRef|null|undefined} tunedModelRef + * @memberof google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest + * @instance + */ + RebaseTunedModelRequest.prototype.tunedModelRef = null; + + /** + * RebaseTunedModelRequest tuningJob. + * @member {google.cloud.aiplatform.v1beta1.ITuningJob|null|undefined} tuningJob + * @memberof google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest + * @instance + */ + RebaseTunedModelRequest.prototype.tuningJob = null; + + /** + * RebaseTunedModelRequest artifactDestination. + * @member {google.cloud.aiplatform.v1beta1.IGcsDestination|null|undefined} artifactDestination + * @memberof google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest + * @instance + */ + RebaseTunedModelRequest.prototype.artifactDestination = null; + + /** + * RebaseTunedModelRequest deployToSameEndpoint. + * @member {boolean} deployToSameEndpoint + * @memberof google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest + * @instance + */ + RebaseTunedModelRequest.prototype.deployToSameEndpoint = false; + + /** + * Creates a new RebaseTunedModelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IRebaseTunedModelRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest} RebaseTunedModelRequest instance + */ + RebaseTunedModelRequest.create = function create(properties) { + return new RebaseTunedModelRequest(properties); + }; + + /** + * Encodes the specified RebaseTunedModelRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IRebaseTunedModelRequest} message RebaseTunedModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RebaseTunedModelRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.tunedModelRef != null && Object.hasOwnProperty.call(message, "tunedModelRef")) + $root.google.cloud.aiplatform.v1beta1.TunedModelRef.encode(message.tunedModelRef, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.tuningJob != null && Object.hasOwnProperty.call(message, "tuningJob")) + $root.google.cloud.aiplatform.v1beta1.TuningJob.encode(message.tuningJob, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.artifactDestination != null && Object.hasOwnProperty.call(message, "artifactDestination")) + $root.google.cloud.aiplatform.v1beta1.GcsDestination.encode(message.artifactDestination, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.deployToSameEndpoint != null && Object.hasOwnProperty.call(message, "deployToSameEndpoint")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.deployToSameEndpoint); + return writer; + }; + + /** + * Encodes the specified RebaseTunedModelRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IRebaseTunedModelRequest} message RebaseTunedModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RebaseTunedModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RebaseTunedModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest} RebaseTunedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RebaseTunedModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.tunedModelRef = $root.google.cloud.aiplatform.v1beta1.TunedModelRef.decode(reader, reader.uint32()); + break; + } + case 3: { + message.tuningJob = $root.google.cloud.aiplatform.v1beta1.TuningJob.decode(reader, reader.uint32()); + break; + } + case 4: { + message.artifactDestination = $root.google.cloud.aiplatform.v1beta1.GcsDestination.decode(reader, reader.uint32()); + break; + } + case 5: { + message.deployToSameEndpoint = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RebaseTunedModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest} RebaseTunedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RebaseTunedModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RebaseTunedModelRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RebaseTunedModelRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.tunedModelRef != null && message.hasOwnProperty("tunedModelRef")) { + var error = $root.google.cloud.aiplatform.v1beta1.TunedModelRef.verify(message.tunedModelRef); + if (error) + return "tunedModelRef." + error; + } + if (message.tuningJob != null && message.hasOwnProperty("tuningJob")) { + var error = $root.google.cloud.aiplatform.v1beta1.TuningJob.verify(message.tuningJob); + if (error) + return "tuningJob." + error; + } + if (message.artifactDestination != null && message.hasOwnProperty("artifactDestination")) { + var error = $root.google.cloud.aiplatform.v1beta1.GcsDestination.verify(message.artifactDestination); + if (error) + return "artifactDestination." + error; + } + if (message.deployToSameEndpoint != null && message.hasOwnProperty("deployToSameEndpoint")) + if (typeof message.deployToSameEndpoint !== "boolean") + return "deployToSameEndpoint: boolean expected"; + return null; + }; + + /** + * Creates a RebaseTunedModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest} RebaseTunedModelRequest + */ + RebaseTunedModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.tunedModelRef != null) { + if (typeof object.tunedModelRef !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest.tunedModelRef: object expected"); + message.tunedModelRef = $root.google.cloud.aiplatform.v1beta1.TunedModelRef.fromObject(object.tunedModelRef); + } + if (object.tuningJob != null) { + if (typeof object.tuningJob !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest.tuningJob: object expected"); + message.tuningJob = $root.google.cloud.aiplatform.v1beta1.TuningJob.fromObject(object.tuningJob); + } + if (object.artifactDestination != null) { + if (typeof object.artifactDestination !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest.artifactDestination: object expected"); + message.artifactDestination = $root.google.cloud.aiplatform.v1beta1.GcsDestination.fromObject(object.artifactDestination); + } + if (object.deployToSameEndpoint != null) + message.deployToSameEndpoint = Boolean(object.deployToSameEndpoint); + return message; + }; + + /** + * Creates a plain object from a RebaseTunedModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest} message RebaseTunedModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RebaseTunedModelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.tunedModelRef = null; + object.tuningJob = null; + object.artifactDestination = null; + object.deployToSameEndpoint = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.tunedModelRef != null && message.hasOwnProperty("tunedModelRef")) + object.tunedModelRef = $root.google.cloud.aiplatform.v1beta1.TunedModelRef.toObject(message.tunedModelRef, options); + if (message.tuningJob != null && message.hasOwnProperty("tuningJob")) + object.tuningJob = $root.google.cloud.aiplatform.v1beta1.TuningJob.toObject(message.tuningJob, options); + if (message.artifactDestination != null && message.hasOwnProperty("artifactDestination")) + object.artifactDestination = $root.google.cloud.aiplatform.v1beta1.GcsDestination.toObject(message.artifactDestination, options); + if (message.deployToSameEndpoint != null && message.hasOwnProperty("deployToSameEndpoint")) + object.deployToSameEndpoint = message.deployToSameEndpoint; + return object; + }; + + /** + * Converts this RebaseTunedModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest + * @instance + * @returns {Object.} JSON object + */ + RebaseTunedModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RebaseTunedModelRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RebaseTunedModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest"; + }; + + return RebaseTunedModelRequest; + })(); + + v1beta1.RebaseTunedModelOperationMetadata = (function() { + + /** + * Properties of a RebaseTunedModelOperationMetadata. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IRebaseTunedModelOperationMetadata + * @property {google.cloud.aiplatform.v1beta1.IGenericOperationMetadata|null} [genericMetadata] RebaseTunedModelOperationMetadata genericMetadata + */ + + /** + * Constructs a new RebaseTunedModelOperationMetadata. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a RebaseTunedModelOperationMetadata. + * @implements IRebaseTunedModelOperationMetadata + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IRebaseTunedModelOperationMetadata=} [properties] Properties to set + */ + function RebaseTunedModelOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RebaseTunedModelOperationMetadata genericMetadata. + * @member {google.cloud.aiplatform.v1beta1.IGenericOperationMetadata|null|undefined} genericMetadata + * @memberof google.cloud.aiplatform.v1beta1.RebaseTunedModelOperationMetadata + * @instance + */ + RebaseTunedModelOperationMetadata.prototype.genericMetadata = null; + + /** + * Creates a new RebaseTunedModelOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.RebaseTunedModelOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1beta1.IRebaseTunedModelOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.RebaseTunedModelOperationMetadata} RebaseTunedModelOperationMetadata instance + */ + RebaseTunedModelOperationMetadata.create = function create(properties) { + return new RebaseTunedModelOperationMetadata(properties); + }; + + /** + * Encodes the specified RebaseTunedModelOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RebaseTunedModelOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.RebaseTunedModelOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1beta1.IRebaseTunedModelOperationMetadata} message RebaseTunedModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RebaseTunedModelOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.genericMetadata != null && Object.hasOwnProperty.call(message, "genericMetadata")) + $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.encode(message.genericMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RebaseTunedModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RebaseTunedModelOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.RebaseTunedModelOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1beta1.IRebaseTunedModelOperationMetadata} message RebaseTunedModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RebaseTunedModelOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RebaseTunedModelOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.RebaseTunedModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1beta1.RebaseTunedModelOperationMetadata} RebaseTunedModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RebaseTunedModelOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1beta1.RebaseTunedModelOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.genericMetadata = $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RebaseTunedModelOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.RebaseTunedModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.RebaseTunedModelOperationMetadata} RebaseTunedModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RebaseTunedModelOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RebaseTunedModelOperationMetadata message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.RebaseTunedModelOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RebaseTunedModelOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) { + var error = $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.verify(message.genericMetadata); + if (error) + return "genericMetadata." + error; + } + return null; + }; + + /** + * Creates a RebaseTunedModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.RebaseTunedModelOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.RebaseTunedModelOperationMetadata} RebaseTunedModelOperationMetadata + */ + RebaseTunedModelOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.RebaseTunedModelOperationMetadata) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.RebaseTunedModelOperationMetadata(); + if (object.genericMetadata != null) { + if (typeof object.genericMetadata !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.RebaseTunedModelOperationMetadata.genericMetadata: object expected"); + message.genericMetadata = $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.fromObject(object.genericMetadata); + } + return message; + }; + + /** + * Creates a plain object from a RebaseTunedModelOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.RebaseTunedModelOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1beta1.RebaseTunedModelOperationMetadata} message RebaseTunedModelOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RebaseTunedModelOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.genericMetadata = null; + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) + object.genericMetadata = $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.toObject(message.genericMetadata, options); + return object; + }; + + /** + * Converts this RebaseTunedModelOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.RebaseTunedModelOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + RebaseTunedModelOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RebaseTunedModelOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.RebaseTunedModelOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RebaseTunedModelOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.RebaseTunedModelOperationMetadata"; + }; + + return RebaseTunedModelOperationMetadata; + })(); + v1beta1.TuningJob = (function() { /** @@ -450761,6 +452144,285 @@ return DistillationHyperParameters; })(); + v1beta1.TunedModelRef = (function() { + + /** + * Properties of a TunedModelRef. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface ITunedModelRef + * @property {string|null} [tunedModel] TunedModelRef tunedModel + * @property {string|null} [tuningJob] TunedModelRef tuningJob + * @property {string|null} [pipelineJob] TunedModelRef pipelineJob + */ + + /** + * Constructs a new TunedModelRef. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a TunedModelRef. + * @implements ITunedModelRef + * @constructor + * @param {google.cloud.aiplatform.v1beta1.ITunedModelRef=} [properties] Properties to set + */ + function TunedModelRef(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TunedModelRef tunedModel. + * @member {string|null|undefined} tunedModel + * @memberof google.cloud.aiplatform.v1beta1.TunedModelRef + * @instance + */ + TunedModelRef.prototype.tunedModel = null; + + /** + * TunedModelRef tuningJob. + * @member {string|null|undefined} tuningJob + * @memberof google.cloud.aiplatform.v1beta1.TunedModelRef + * @instance + */ + TunedModelRef.prototype.tuningJob = null; + + /** + * TunedModelRef pipelineJob. + * @member {string|null|undefined} pipelineJob + * @memberof google.cloud.aiplatform.v1beta1.TunedModelRef + * @instance + */ + TunedModelRef.prototype.pipelineJob = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TunedModelRef tunedModelRef. + * @member {"tunedModel"|"tuningJob"|"pipelineJob"|undefined} tunedModelRef + * @memberof google.cloud.aiplatform.v1beta1.TunedModelRef + * @instance + */ + Object.defineProperty(TunedModelRef.prototype, "tunedModelRef", { + get: $util.oneOfGetter($oneOfFields = ["tunedModel", "tuningJob", "pipelineJob"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TunedModelRef instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.TunedModelRef + * @static + * @param {google.cloud.aiplatform.v1beta1.ITunedModelRef=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.TunedModelRef} TunedModelRef instance + */ + TunedModelRef.create = function create(properties) { + return new TunedModelRef(properties); + }; + + /** + * Encodes the specified TunedModelRef message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.TunedModelRef.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.TunedModelRef + * @static + * @param {google.cloud.aiplatform.v1beta1.ITunedModelRef} message TunedModelRef message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TunedModelRef.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tunedModel != null && Object.hasOwnProperty.call(message, "tunedModel")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tunedModel); + if (message.tuningJob != null && Object.hasOwnProperty.call(message, "tuningJob")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tuningJob); + if (message.pipelineJob != null && Object.hasOwnProperty.call(message, "pipelineJob")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pipelineJob); + return writer; + }; + + /** + * Encodes the specified TunedModelRef message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.TunedModelRef.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.TunedModelRef + * @static + * @param {google.cloud.aiplatform.v1beta1.ITunedModelRef} message TunedModelRef message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TunedModelRef.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TunedModelRef message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.TunedModelRef + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1beta1.TunedModelRef} TunedModelRef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TunedModelRef.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1beta1.TunedModelRef(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tunedModel = reader.string(); + break; + } + case 2: { + message.tuningJob = reader.string(); + break; + } + case 3: { + message.pipelineJob = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TunedModelRef message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.TunedModelRef + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.TunedModelRef} TunedModelRef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TunedModelRef.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TunedModelRef message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.TunedModelRef + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TunedModelRef.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tunedModel != null && message.hasOwnProperty("tunedModel")) { + properties.tunedModelRef = 1; + if (!$util.isString(message.tunedModel)) + return "tunedModel: string expected"; + } + if (message.tuningJob != null && message.hasOwnProperty("tuningJob")) { + if (properties.tunedModelRef === 1) + return "tunedModelRef: multiple values"; + properties.tunedModelRef = 1; + if (!$util.isString(message.tuningJob)) + return "tuningJob: string expected"; + } + if (message.pipelineJob != null && message.hasOwnProperty("pipelineJob")) { + if (properties.tunedModelRef === 1) + return "tunedModelRef: multiple values"; + properties.tunedModelRef = 1; + if (!$util.isString(message.pipelineJob)) + return "pipelineJob: string expected"; + } + return null; + }; + + /** + * Creates a TunedModelRef message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.TunedModelRef + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.TunedModelRef} TunedModelRef + */ + TunedModelRef.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.TunedModelRef) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.TunedModelRef(); + if (object.tunedModel != null) + message.tunedModel = String(object.tunedModel); + if (object.tuningJob != null) + message.tuningJob = String(object.tuningJob); + if (object.pipelineJob != null) + message.pipelineJob = String(object.pipelineJob); + return message; + }; + + /** + * Creates a plain object from a TunedModelRef message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.TunedModelRef + * @static + * @param {google.cloud.aiplatform.v1beta1.TunedModelRef} message TunedModelRef + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TunedModelRef.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.tunedModel != null && message.hasOwnProperty("tunedModel")) { + object.tunedModel = message.tunedModel; + if (options.oneofs) + object.tunedModelRef = "tunedModel"; + } + if (message.tuningJob != null && message.hasOwnProperty("tuningJob")) { + object.tuningJob = message.tuningJob; + if (options.oneofs) + object.tunedModelRef = "tuningJob"; + } + if (message.pipelineJob != null && message.hasOwnProperty("pipelineJob")) { + object.pipelineJob = message.pipelineJob; + if (options.oneofs) + object.tunedModelRef = "pipelineJob"; + } + return object; + }; + + /** + * Converts this TunedModelRef to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.TunedModelRef + * @instance + * @returns {Object.} JSON object + */ + TunedModelRef.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TunedModelRef + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.TunedModelRef + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TunedModelRef.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.TunedModelRef"; + }; + + return TunedModelRef; + })(); + v1beta1.HyperparameterTuningJob = (function() { /** diff --git a/packages/google-cloud-aiplatform/protos/protos.json b/packages/google-cloud-aiplatform/protos/protos.json index a3ef53c6002..2ede6d76bd6 100644 --- a/packages/google-cloud-aiplatform/protos/protos.json +++ b/packages/google-cloud-aiplatform/protos/protos.json @@ -14378,6 +14378,34 @@ "(google.api.method_signature)": "name" } ] + }, + "RebaseTunedModel": { + "requestType": "RebaseTunedModelRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/tuningJobs:rebaseTunedModel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,tuned_model_ref", + "(google.longrunning.operation_info).response_type": "TuningJob", + "(google.longrunning.operation_info).metadata_type": "RebaseTunedModelOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/tuningJobs:rebaseTunedModel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,tuned_model_ref" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "TuningJob", + "metadata_type": "RebaseTunedModelOperationMetadata" + } + } + ] } } }, @@ -14470,6 +14498,54 @@ } } }, + "RebaseTunedModelRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "tunedModelRef": { + "type": "TunedModelRef", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "tuningJob": { + "type": "TuningJob", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "artifactDestination": { + "type": "GcsDestination", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "deployToSameEndpoint": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RebaseTunedModelOperationMetadata": { + "fields": { + "genericMetadata": { + "type": "GenericOperationMetadata", + "id": 1 + } + } + }, "TuningJob": { "options": { "(google.api.resource).type": "aiplatform.googleapis.com/TuningJob", @@ -14866,6 +14942,40 @@ } } }, + "TunedModelRef": { + "oneofs": { + "tunedModelRef": { + "oneof": [ + "tunedModel", + "tuningJob", + "pipelineJob" + ] + } + }, + "fields": { + "tunedModel": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "aiplatform.googleapis.com/Model" + } + }, + "tuningJob": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "aiplatform.googleapis.com/TuningJob" + } + }, + "pipelineJob": { + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).type": "aiplatform.googleapis.com/PipelineJob" + } + } + } + }, "HyperparameterTuningJob": { "options": { "(google.api.resource).type": "aiplatform.googleapis.com/HyperparameterTuningJob", @@ -48668,6 +48778,34 @@ "(google.api.method_signature)": "name" } ] + }, + "RebaseTunedModel": { + "requestType": "RebaseTunedModelRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{parent=projects/*/locations/*}/tuningJobs:rebaseTunedModel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,tuned_model_ref", + "(google.longrunning.operation_info).response_type": "TuningJob", + "(google.longrunning.operation_info).metadata_type": "RebaseTunedModelOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=projects/*/locations/*}/tuningJobs:rebaseTunedModel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,tuned_model_ref" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "TuningJob", + "metadata_type": "RebaseTunedModelOperationMetadata" + } + } + ] } } }, @@ -48760,6 +48898,54 @@ } } }, + "RebaseTunedModelRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "tunedModelRef": { + "type": "TunedModelRef", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "tuningJob": { + "type": "TuningJob", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "artifactDestination": { + "type": "GcsDestination", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "deployToSameEndpoint": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RebaseTunedModelOperationMetadata": { + "fields": { + "genericMetadata": { + "type": "GenericOperationMetadata", + "id": 1 + } + } + }, "TuningJob": { "options": { "(google.api.resource).type": "aiplatform.googleapis.com/TuningJob", @@ -49445,6 +49631,40 @@ } } }, + "TunedModelRef": { + "oneofs": { + "tunedModelRef": { + "oneof": [ + "tunedModel", + "tuningJob", + "pipelineJob" + ] + } + }, + "fields": { + "tunedModel": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "aiplatform.googleapis.com/Model" + } + }, + "tuningJob": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "aiplatform.googleapis.com/TuningJob" + } + }, + "pipelineJob": { + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).type": "aiplatform.googleapis.com/PipelineJob" + } + } + } + }, "HyperparameterTuningJob": { "options": { "(google.api.resource).type": "aiplatform.googleapis.com/HyperparameterTuningJob", @@ -61384,7 +61604,7 @@ "type": "int64", "id": 29, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL" } }, "pipelineTaskRerunConfigs": { @@ -61392,7 +61612,7 @@ "type": "PipelineTaskRerunConfig", "id": 30, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL" } } }, @@ -61724,35 +61944,35 @@ "type": "int64", "id": 1, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL" } }, "taskName": { "type": "string", "id": 2, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL" } }, "inputs": { "type": "Inputs", "id": 3, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL" } }, "skipTask": { "type": "bool", "id": 4, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL" } }, "skipDownstreamTasks": { "type": "bool", "id": 5, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL" } } }, @@ -61764,7 +61984,7 @@ "type": "RuntimeArtifact", "id": 1, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL" } } } @@ -61776,7 +61996,7 @@ "type": "ArtifactList", "id": 1, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL" } }, "parameterValues": { @@ -61784,7 +62004,7 @@ "type": "google.protobuf.Value", "id": 2, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL" } } } diff --git a/packages/google-cloud-aiplatform/samples/README.md b/packages/google-cloud-aiplatform/samples/README.md index 6e940ea4e84..e8332bbdcc4 100644 --- a/packages/google-cloud-aiplatform/samples/README.md +++ b/packages/google-cloud-aiplatform/samples/README.md @@ -99,6 +99,7 @@ * [Gen_ai_tuning_service.create_tuning_job](#gen_ai_tuning_service.create_tuning_job) * [Gen_ai_tuning_service.get_tuning_job](#gen_ai_tuning_service.get_tuning_job) * [Gen_ai_tuning_service.list_tuning_jobs](#gen_ai_tuning_service.list_tuning_jobs) + * [Gen_ai_tuning_service.rebase_tuned_model](#gen_ai_tuning_service.rebase_tuned_model) * [Index_endpoint_service.create_index_endpoint](#index_endpoint_service.create_index_endpoint) * [Index_endpoint_service.delete_index_endpoint](#index_endpoint_service.delete_index_endpoint) * [Index_endpoint_service.deploy_index](#index_endpoint_service.deploy_index) @@ -409,6 +410,7 @@ * [Gen_ai_tuning_service.create_tuning_job](#gen_ai_tuning_service.create_tuning_job) * [Gen_ai_tuning_service.get_tuning_job](#gen_ai_tuning_service.get_tuning_job) * [Gen_ai_tuning_service.list_tuning_jobs](#gen_ai_tuning_service.list_tuning_jobs) + * [Gen_ai_tuning_service.rebase_tuned_model](#gen_ai_tuning_service.rebase_tuned_model) * [Index_endpoint_service.create_index_endpoint](#index_endpoint_service.create_index_endpoint) * [Index_endpoint_service.delete_index_endpoint](#index_endpoint_service.delete_index_endpoint) * [Index_endpoint_service.deploy_index](#index_endpoint_service.deploy_index) @@ -2146,6 +2148,23 @@ __Usage:__ +### Gen_ai_tuning_service.rebase_tuned_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.rebase_tuned_model.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.rebase_tuned_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.rebase_tuned_model.js` + + +----- + + + + ### Index_endpoint_service.create_index_endpoint View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.create_index_endpoint.js). @@ -7416,6 +7435,23 @@ __Usage:__ +### Gen_ai_tuning_service.rebase_tuned_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.rebase_tuned_model.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.rebase_tuned_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.rebase_tuned_model.js` + + +----- + + + + ### Index_endpoint_service.create_index_endpoint View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.create_index_endpoint.js). diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.rebase_tuned_model.js b/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.rebase_tuned_model.js new file mode 100644 index 00000000000..9a62b1e5108 --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.rebase_tuned_model.js @@ -0,0 +1,83 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, tunedModelRef) { + // [START aiplatform_v1_generated_GenAiTuningService_RebaseTunedModel_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the Location into which to rebase the Model. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Required. TunedModel reference to retrieve the legacy model information. + */ + // const tunedModelRef = {} + /** + * Optional. The TuningJob to be updated. Users can use this TuningJob field + * to overwrite tuning configs. + */ + // const tuningJob = {} + /** + * Optional. The Google Cloud Storage location to write the artifacts. + */ + // const artifactDestination = {} + /** + * 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. + */ + // const deployToSameEndpoint = true + + // Imports the Aiplatform library + const {GenAiTuningServiceClient} = require('@google-cloud/aiplatform').v1; + + // Instantiates a client + const aiplatformClient = new GenAiTuningServiceClient(); + + async function callRebaseTunedModel() { + // Construct request + const request = { + parent, + tunedModelRef, + }; + + // Run request + const [operation] = await aiplatformClient.rebaseTunedModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRebaseTunedModel(); + // [END aiplatform_v1_generated_GenAiTuningService_RebaseTunedModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata_google.cloud.aiplatform.v1.json b/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata_google.cloud.aiplatform.v1.json index 8a7e728d0da..24b3dcd3579 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata_google.cloud.aiplatform.v1.json +++ b/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata_google.cloud.aiplatform.v1.json @@ -4267,6 +4267,62 @@ } } }, + { + "regionTag": "aiplatform_v1_generated_GenAiTuningService_RebaseTunedModel_async", + "title": "DatasetService rebaseTunedModel Sample", + "origin": "API_DEFINITION", + "description": " Rebase a TunedModel. Creates a LongRunningOperation that takes a legacy Tuned GenAI model Reference and creates a TuningJob based on newly available model.", + "canonical": true, + "file": "gen_ai_tuning_service.rebase_tuned_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RebaseTunedModel", + "fullName": "google.cloud.aiplatform.v1.GenAiTuningService.RebaseTunedModel", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "tuned_model_ref", + "type": ".google.cloud.aiplatform.v1.TunedModelRef" + }, + { + "name": "tuning_job", + "type": ".google.cloud.aiplatform.v1.TuningJob" + }, + { + "name": "artifact_destination", + "type": ".google.cloud.aiplatform.v1.GcsDestination" + }, + { + "name": "deploy_to_same_endpoint", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "GenAiTuningServiceClient", + "fullName": "google.cloud.aiplatform.v1.GenAiTuningServiceClient" + }, + "method": { + "shortName": "RebaseTunedModel", + "fullName": "google.cloud.aiplatform.v1.GenAiTuningService.RebaseTunedModel", + "service": { + "shortName": "GenAiTuningService", + "fullName": "google.cloud.aiplatform.v1.GenAiTuningService" + } + } + } + }, { "regionTag": "aiplatform_v1_generated_IndexEndpointService_CreateIndexEndpoint_async", "title": "DatasetService createIndexEndpoint Sample", diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.rebase_tuned_model.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.rebase_tuned_model.js new file mode 100644 index 00000000000..070ceeab9e4 --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.rebase_tuned_model.js @@ -0,0 +1,83 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, tunedModelRef) { + // [START aiplatform_v1beta1_generated_GenAiTuningService_RebaseTunedModel_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the Location into which to rebase the Model. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Required. TunedModel reference to retrieve the legacy model information. + */ + // const tunedModelRef = {} + /** + * Optional. The TuningJob to be updated. Users can use this TuningJob field + * to overwrite tuning configs. + */ + // const tuningJob = {} + /** + * Optional. The Google Cloud Storage location to write the artifacts. + */ + // const artifactDestination = {} + /** + * 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. + */ + // const deployToSameEndpoint = true + + // Imports the Aiplatform library + const {GenAiTuningServiceClient} = require('@google-cloud/aiplatform').v1beta1; + + // Instantiates a client + const aiplatformClient = new GenAiTuningServiceClient(); + + async function callRebaseTunedModel() { + // Construct request + const request = { + parent, + tunedModelRef, + }; + + // Run request + const [operation] = await aiplatformClient.rebaseTunedModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRebaseTunedModel(); + // [END aiplatform_v1beta1_generated_GenAiTuningService_RebaseTunedModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/snippet_metadata_google.cloud.aiplatform.v1beta1.json b/packages/google-cloud-aiplatform/samples/generated/v1beta1/snippet_metadata_google.cloud.aiplatform.v1beta1.json index 87afda3f740..002b6006b29 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/snippet_metadata_google.cloud.aiplatform.v1beta1.json +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/snippet_metadata_google.cloud.aiplatform.v1beta1.json @@ -4855,6 +4855,62 @@ } } }, + { + "regionTag": "aiplatform_v1beta1_generated_GenAiTuningService_RebaseTunedModel_async", + "title": "DatasetService rebaseTunedModel Sample", + "origin": "API_DEFINITION", + "description": " Rebase a TunedModel. Creates a LongRunningOperation that takes a legacy Tuned GenAI model Reference and creates a TuningJob based on newly available model.", + "canonical": true, + "file": "gen_ai_tuning_service.rebase_tuned_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RebaseTunedModel", + "fullName": "google.cloud.aiplatform.v1beta1.GenAiTuningService.RebaseTunedModel", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "tuned_model_ref", + "type": ".google.cloud.aiplatform.v1beta1.TunedModelRef" + }, + { + "name": "tuning_job", + "type": ".google.cloud.aiplatform.v1beta1.TuningJob" + }, + { + "name": "artifact_destination", + "type": ".google.cloud.aiplatform.v1beta1.GcsDestination" + }, + { + "name": "deploy_to_same_endpoint", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "GenAiTuningServiceClient", + "fullName": "google.cloud.aiplatform.v1beta1.GenAiTuningServiceClient" + }, + "method": { + "shortName": "RebaseTunedModel", + "fullName": "google.cloud.aiplatform.v1beta1.GenAiTuningService.RebaseTunedModel", + "service": { + "shortName": "GenAiTuningService", + "fullName": "google.cloud.aiplatform.v1beta1.GenAiTuningService" + } + } + } + }, { "regionTag": "aiplatform_v1beta1_generated_IndexEndpointService_CreateIndexEndpoint_async", "title": "DatasetService createIndexEndpoint Sample", diff --git a/packages/google-cloud-aiplatform/src/v1/gapic_metadata.json b/packages/google-cloud-aiplatform/src/v1/gapic_metadata.json index 19c42e1661a..c993fb0901b 100644 --- a/packages/google-cloud-aiplatform/src/v1/gapic_metadata.json +++ b/packages/google-cloud-aiplatform/src/v1/gapic_metadata.json @@ -1048,6 +1048,11 @@ "cancelTuningJob" ] }, + "RebaseTunedModel": { + "methods": [ + "rebaseTunedModel" + ] + }, "ListTuningJobs": { "methods": [ "listTuningJobs", @@ -1075,6 +1080,11 @@ "cancelTuningJob" ] }, + "RebaseTunedModel": { + "methods": [ + "rebaseTunedModel" + ] + }, "ListTuningJobs": { "methods": [ "listTuningJobs", diff --git a/packages/google-cloud-aiplatform/src/v1/gen_ai_tuning_service_client.ts b/packages/google-cloud-aiplatform/src/v1/gen_ai_tuning_service_client.ts index 36cf91d50aa..07f70b0768d 100644 --- a/packages/google-cloud-aiplatform/src/v1/gen_ai_tuning_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/gen_ai_tuning_service_client.ts @@ -23,6 +23,8 @@ import type { CallOptions, Descriptors, ClientOptions, + GrpcClientOptions, + LROperation, PaginationCallback, GaxCall, IamClient, @@ -69,6 +71,7 @@ export class GenAiTuningServiceClient { iamClient: IamClient; locationsClient: LocationsClient; pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; genAiTuningServiceStub?: Promise<{[name: string]: Function}>; /** @@ -381,6 +384,1552 @@ export class GenAiTuningServiceClient { ), }; + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/ui/{name=projects/*/locations/*}', + additional_bindings: [{get: '/v1/{name=projects/*/locations/*}'}], + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/ui/{name=projects/*}/locations', + additional_bindings: [{get: '/v1/{name=projects/*}/locations'}], + }, + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + post: '/v1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy', + }, + { + post: '/v1/{resource=projects/*/locations/*/models/*}:getIamPolicy', + }, + { + post: '/v1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, + { + post: '/v1/{resource=projects/*/locations/*/featureOnlineStores/*}:getIamPolicy', + }, + { + post: '/v1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/publishers/*/models/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/models/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/featureOnlineStores/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions', + }, + { + post: '/v1/{resource=projects/*/locations/*/models/*}:testIamPermissions', + }, + { + post: '/v1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, + { + post: '/v1/{resource=projects/*/locations/*/featureOnlineStores/*}:testIamPermissions', + }, + { + post: '/v1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', + }, + ], + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/ui/{name=projects/*/locations/*/operations/*}:cancel', + additional_bindings: [ + { + post: '/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/extensions/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/schedules/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel', + }, + {post: '/v1/{name=projects/*/locations/*/operations/*}:cancel'}, + { + post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/tuningJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/metadataStores/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel', + }, + ], + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/ui/{name=projects/*/locations/*/operations/*}', + additional_bindings: [ + {delete: '/ui/{name=projects/*/locations/*/agents/*/operations/*}'}, + {delete: '/ui/{name=projects/*/locations/*/apps/*/operations/*}'}, + { + delete: + '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/extensionControllers/*}/operations', + }, + { + delete: + '/ui/{name=projects/*/locations/*/extensions/*}/operations', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/indexes/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}', + }, + {delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}'}, + { + delete: + '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/studies/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/schedules/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, + {delete: '/v1/{name=projects/*/locations/*/operations/*}'}, + { + delete: + '/v1/{name=projects/*/locations/*/datasets/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/indexes/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/metadataStores/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}', + }, + {delete: '/v1/{name=projects/*/locations/*/models/*/operations/*}'}, + { + delete: + '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/studies/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/schedules/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/ui/{name=projects/*/locations/*/operations/*}', + additional_bindings: [ + {get: '/ui/{name=projects/*/locations/*/agents/*/operations/*}'}, + {get: '/ui/{name=projects/*/locations/*/apps/*/operations/*}'}, + {get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}'}, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}', + }, + {get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}'}, + { + get: '/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}', + }, + {get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}'}, + { + get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}', + }, + {get: '/ui/{name=projects/*/locations/*/models/*/operations/*}'}, + { + get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', + }, + {get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}'}, + { + get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}', + }, + {get: '/ui/{name=projects/*/locations/*/schedules/*/operations/*}'}, + { + get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, + {get: '/v1/{name=projects/*/locations/*/operations/*}'}, + {get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}'}, + { + get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}', + }, + {get: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}'}, + { + get: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/tuningJobs/*/operations/*}', + }, + {get: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}'}, + { + get: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/metadataStores/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}', + }, + {get: '/v1/{name=projects/*/locations/*/models/*/operations/*}'}, + { + get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, + {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, + { + get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}', + }, + {get: '/v1/{name=projects/*/locations/*/schedules/*/operations/*}'}, + { + get: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/ui/{name=projects/*/locations/*}/operations', + additional_bindings: [ + {get: '/ui/{name=projects/*/locations/*/agents/*}/operations'}, + {get: '/ui/{name=projects/*/locations/*/apps/*}/operations'}, + {get: '/ui/{name=projects/*/locations/*/datasets/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations'}, + {get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/extensionControllers/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/extensions/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/tuningJobs/*}/operations'}, + {get: '/ui/{name=projects/*/locations/*/indexes/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/executions/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/modelMonitors/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/models/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/studies/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/persistentResources/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/schedules/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait', + }, + { + get: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', + }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait', + }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', + }, + {get: '/v1/{name=projects/*/locations/*}/operations'}, + {get: '/v1/{name=projects/*/locations/*/datasets/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations', + }, + {get: '/v1/{name=projects/*/locations/*/endpoints/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/featurestores/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations', + }, + {get: '/v1/{name=projects/*/locations/*/customJobs/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations', + }, + {get: '/v1/{name=projects/*/locations/*/tuningJobs/*}/operations'}, + {get: '/v1/{name=projects/*/locations/*/indexes/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/indexEndpoints/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/metadataStores/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/metadataStores/*/artifacts/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/metadataStores/*/contexts/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/metadataStores/*/executions/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/migratableResources/*}/operations', + }, + {get: '/v1/{name=projects/*/locations/*/models/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, + {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/trainingPipelines/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/persistentResources/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations', + }, + {get: '/v1/{name=projects/*/locations/*/schedules/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/tensorboards/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait', + }, + { + get: '/v1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', + }, + { + get: '/v1/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait', + }, + { + get: '/v1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', + }, + ], + }, + { + selector: 'google.longrunning.Operations.WaitOperation', + post: '/ui/{name=projects/*/locations/*/operations/*}:wait', + additional_bindings: [ + { + post: '/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/extensions/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/schedules/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', + }, + {post: '/v1/{name=projects/*/locations/*/operations/*}:wait'}, + { + post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/metadataStores/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/schedules/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', + }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const rebaseTunedModelResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.TuningJob' + ) as gax.protobuf.Type; + const rebaseTunedModelMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.RebaseTunedModelOperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + rebaseTunedModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + rebaseTunedModelResponse.decode.bind(rebaseTunedModelResponse), + rebaseTunedModelMetadata.decode.bind(rebaseTunedModelMetadata) + ), + }; + // Put together the default options sent with requests. this._defaults = this._gaxGrpc.constructSettings( 'google.cloud.aiplatform.v1.GenAiTuningService', @@ -435,6 +1984,7 @@ export class GenAiTuningServiceClient { 'getTuningJob', 'listTuningJobs', 'cancelTuningJob', + 'rebaseTunedModel', ]; for (const methodName of genAiTuningServiceStubMethods) { const callPromise = this.genAiTuningServiceStub.then( @@ -451,7 +2001,10 @@ export class GenAiTuningServiceClient { } ); - const descriptor = this.descriptors.page[methodName] || undefined; + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], @@ -831,6 +2384,156 @@ export class GenAiTuningServiceClient { return this.innerApiCalls.cancelTuningJob(request, options, callback); } + /** + * Rebase a TunedModel. + * Creates a LongRunningOperation that takes a legacy Tuned GenAI model + * Reference and creates a TuningJob based on newly available model. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location into which to rebase the Model. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1.TunedModelRef} request.tunedModelRef + * Required. TunedModel reference to retrieve the legacy model information. + * @param {google.cloud.aiplatform.v1.TuningJob} [request.tuningJob] + * Optional. The TuningJob to be updated. Users can use this TuningJob field + * to overwrite tuning configs. + * @param {google.cloud.aiplatform.v1.GcsDestination} [request.artifactDestination] + * Optional. The Google Cloud Storage location to write the artifacts. + * @param {boolean} [request.deployToSameEndpoint] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/gen_ai_tuning_service.rebase_tuned_model.js + * region_tag:aiplatform_v1_generated_GenAiTuningService_RebaseTunedModel_async + */ + rebaseTunedModel( + request?: protos.google.cloud.aiplatform.v1.IRebaseTunedModelRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.aiplatform.v1.ITuningJob, + protos.google.cloud.aiplatform.v1.IRebaseTunedModelOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + rebaseTunedModel( + request: protos.google.cloud.aiplatform.v1.IRebaseTunedModelRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.aiplatform.v1.ITuningJob, + protos.google.cloud.aiplatform.v1.IRebaseTunedModelOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + rebaseTunedModel( + request: protos.google.cloud.aiplatform.v1.IRebaseTunedModelRequest, + callback: Callback< + LROperation< + protos.google.cloud.aiplatform.v1.ITuningJob, + protos.google.cloud.aiplatform.v1.IRebaseTunedModelOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + rebaseTunedModel( + request?: protos.google.cloud.aiplatform.v1.IRebaseTunedModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.aiplatform.v1.ITuningJob, + protos.google.cloud.aiplatform.v1.IRebaseTunedModelOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.aiplatform.v1.ITuningJob, + protos.google.cloud.aiplatform.v1.IRebaseTunedModelOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.aiplatform.v1.ITuningJob, + protos.google.cloud.aiplatform.v1.IRebaseTunedModelOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.rebaseTunedModel(request, options, callback); + } + /** + * Check the status of the long running operation returned by `rebaseTunedModel()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/gen_ai_tuning_service.rebase_tuned_model.js + * region_tag:aiplatform_v1_generated_GenAiTuningService_RebaseTunedModel_async + */ + async checkRebaseTunedModelProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.aiplatform.v1.TuningJob, + protos.google.cloud.aiplatform.v1.RebaseTunedModelOperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.rebaseTunedModel, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.aiplatform.v1.TuningJob, + protos.google.cloud.aiplatform.v1.RebaseTunedModelOperationMetadata + >; + } /** * Lists TuningJobs in a Location. * @@ -1248,6 +2951,181 @@ export class GenAiTuningServiceClient { return this.locationsClient.listLocationsAsync(request, options); } + /** + * 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. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * 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 + * {@link 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 {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * 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`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); + } + // -------------------- // -- Path templates -- // -------------------- @@ -4593,6 +6471,7 @@ export class GenAiTuningServiceClient { stub.close(); this.iamClient.close(); this.locationsClient.close(); + this.operationsClient.close(); }); } return Promise.resolve(); diff --git a/packages/google-cloud-aiplatform/src/v1/gen_ai_tuning_service_client_config.json b/packages/google-cloud-aiplatform/src/v1/gen_ai_tuning_service_client_config.json index 9d341b6200d..5c2587991b5 100644 --- a/packages/google-cloud-aiplatform/src/v1/gen_ai_tuning_service_client_config.json +++ b/packages/google-cloud-aiplatform/src/v1/gen_ai_tuning_service_client_config.json @@ -35,6 +35,10 @@ "CancelTuningJob": { "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "RebaseTunedModel": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-aiplatform/src/v1beta1/gapic_metadata.json b/packages/google-cloud-aiplatform/src/v1beta1/gapic_metadata.json index 4fbd4f7ba77..22d754c6889 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/gapic_metadata.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/gapic_metadata.json @@ -1223,6 +1223,11 @@ "cancelTuningJob" ] }, + "RebaseTunedModel": { + "methods": [ + "rebaseTunedModel" + ] + }, "ListTuningJobs": { "methods": [ "listTuningJobs", @@ -1250,6 +1255,11 @@ "cancelTuningJob" ] }, + "RebaseTunedModel": { + "methods": [ + "rebaseTunedModel" + ] + }, "ListTuningJobs": { "methods": [ "listTuningJobs", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/gen_ai_tuning_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/gen_ai_tuning_service_client.ts index 069639638d9..c81a0de4c66 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/gen_ai_tuning_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/gen_ai_tuning_service_client.ts @@ -23,6 +23,8 @@ import type { CallOptions, Descriptors, ClientOptions, + GrpcClientOptions, + LROperation, PaginationCallback, GaxCall, IamClient, @@ -69,6 +71,7 @@ export class GenAiTuningServiceClient { iamClient: IamClient; locationsClient: LocationsClient; pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; genAiTuningServiceStub?: Promise<{[name: string]: Function}>; /** @@ -402,6 +405,1768 @@ export class GenAiTuningServiceClient { ), }; + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/ui/{name=projects/*/locations/*}', + additional_bindings: [ + {get: '/v1beta1/{name=projects/*/locations/*}'}, + ], + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/ui/{name=projects/*}/locations', + additional_bindings: [{get: '/v1beta1/{name=projects/*}/locations'}], + }, + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/publishers/*/models/*}:getIamPolicy', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*}:getIamPolicy', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/publishers/*/models/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', + body: '*', + additional_bindings: [ + { + post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*}:testIamPermissions', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', + }, + ], + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/ui/{name=projects/*/locations/*/operations/*}:cancel', + additional_bindings: [ + { + post: '/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/extensions/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/schedules/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/apps/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/exampleStores/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/modelMonitors/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel', + }, + ], + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/ui/{name=projects/*/locations/*/operations/*}', + additional_bindings: [ + {delete: '/ui/{name=projects/*/locations/*/agents/*/operations/*}'}, + {delete: '/ui/{name=projects/*/locations/*/apps/*/operations/*}'}, + { + delete: + '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/extensionControllers/*}/operations', + }, + { + delete: + '/ui/{name=projects/*/locations/*/extensions/*}/operations', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/indexes/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}', + }, + {delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}'}, + { + delete: + '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/studies/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/schedules/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, + {delete: '/v1beta1/{name=projects/*/locations/*/operations/*}'}, + { + delete: + '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/apps/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/evaluationTasks/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/exampleStores/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/metadataStores/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/modelMonitors/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/ui/{name=projects/*/locations/*/operations/*}', + additional_bindings: [ + {get: '/ui/{name=projects/*/locations/*/agents/*/operations/*}'}, + {get: '/ui/{name=projects/*/locations/*/apps/*/operations/*}'}, + {get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}'}, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}', + }, + {get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}'}, + { + get: '/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}', + }, + {get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}'}, + { + get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}', + }, + {get: '/ui/{name=projects/*/locations/*/models/*/operations/*}'}, + { + get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', + }, + {get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}'}, + { + get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}', + }, + {get: '/ui/{name=projects/*/locations/*/schedules/*/operations/*}'}, + { + get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, + {get: '/v1beta1/{name=projects/*/locations/*/operations/*}'}, + { + get: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}', + }, + {get: '/v1beta1/{name=projects/*/locations/*/apps/*/operations/*}'}, + { + get: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/evaluationTasks/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/exampleStores/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/modelMonitors/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/ui/{name=projects/*/locations/*}/operations', + additional_bindings: [ + {get: '/ui/{name=projects/*/locations/*/agents/*}/operations'}, + {get: '/ui/{name=projects/*/locations/*/apps/*}/operations'}, + {get: '/ui/{name=projects/*/locations/*/datasets/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations'}, + {get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/extensionControllers/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/extensions/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/tuningJobs/*}/operations'}, + {get: '/ui/{name=projects/*/locations/*/indexes/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/executions/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/modelMonitors/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/models/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/studies/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/persistentResources/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/schedules/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait', + }, + { + get: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', + }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait', + }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', + }, + {get: '/v1beta1/{name=projects/*/locations/*}/operations'}, + {get: '/v1beta1/{name=projects/*/locations/*/agents/*}/operations'}, + {get: '/v1beta1/{name=projects/*/locations/*/apps/*}/operations'}, + { + get: '/v1beta1/{name=projects/*/locations/*/datasets/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/evaluationTasks/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/exampleStores/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/indexes/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/metadataStores/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/modelMonitors/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations', + }, + {get: '/v1beta1/{name=projects/*/locations/*/models/*}/operations'}, + { + get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/ragCorpora/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/reasoningEngines/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/solvers/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/schedules/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', + }, + ], + }, + { + selector: 'google.longrunning.Operations.WaitOperation', + post: '/ui/{name=projects/*/locations/*/operations/*}:wait', + additional_bindings: [ + { + post: '/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/extensions/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/schedules/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', + }, + {post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait'}, + { + post: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/apps/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/evaluationTasks/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/exampleStores/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/modelMonitors/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', + }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const rebaseTunedModelResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.TuningJob' + ) as gax.protobuf.Type; + const rebaseTunedModelMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.RebaseTunedModelOperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + rebaseTunedModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + rebaseTunedModelResponse.decode.bind(rebaseTunedModelResponse), + rebaseTunedModelMetadata.decode.bind(rebaseTunedModelMetadata) + ), + }; + // Put together the default options sent with requests. this._defaults = this._gaxGrpc.constructSettings( 'google.cloud.aiplatform.v1beta1.GenAiTuningService', @@ -457,6 +2222,7 @@ export class GenAiTuningServiceClient { 'getTuningJob', 'listTuningJobs', 'cancelTuningJob', + 'rebaseTunedModel', ]; for (const methodName of genAiTuningServiceStubMethods) { const callPromise = this.genAiTuningServiceStub.then( @@ -473,7 +2239,10 @@ export class GenAiTuningServiceClient { } ); - const descriptor = this.descriptors.page[methodName] || undefined; + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], @@ -871,6 +2640,156 @@ export class GenAiTuningServiceClient { return this.innerApiCalls.cancelTuningJob(request, options, callback); } + /** + * Rebase a TunedModel. + * Creates a LongRunningOperation that takes a legacy Tuned GenAI model + * Reference and creates a TuningJob based on newly available model. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location into which to rebase the Model. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1beta1.TunedModelRef} request.tunedModelRef + * Required. TunedModel reference to retrieve the legacy model information. + * @param {google.cloud.aiplatform.v1beta1.TuningJob} [request.tuningJob] + * Optional. The TuningJob to be updated. Users can use this TuningJob field + * to overwrite tuning configs. + * @param {google.cloud.aiplatform.v1beta1.GcsDestination} [request.artifactDestination] + * Optional. The Google Cloud Storage location to write the artifacts. + * @param {boolean} [request.deployToSameEndpoint] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/gen_ai_tuning_service.rebase_tuned_model.js + * region_tag:aiplatform_v1beta1_generated_GenAiTuningService_RebaseTunedModel_async + */ + rebaseTunedModel( + request?: protos.google.cloud.aiplatform.v1beta1.IRebaseTunedModelRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.aiplatform.v1beta1.ITuningJob, + protos.google.cloud.aiplatform.v1beta1.IRebaseTunedModelOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + rebaseTunedModel( + request: protos.google.cloud.aiplatform.v1beta1.IRebaseTunedModelRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.aiplatform.v1beta1.ITuningJob, + protos.google.cloud.aiplatform.v1beta1.IRebaseTunedModelOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + rebaseTunedModel( + request: protos.google.cloud.aiplatform.v1beta1.IRebaseTunedModelRequest, + callback: Callback< + LROperation< + protos.google.cloud.aiplatform.v1beta1.ITuningJob, + protos.google.cloud.aiplatform.v1beta1.IRebaseTunedModelOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + rebaseTunedModel( + request?: protos.google.cloud.aiplatform.v1beta1.IRebaseTunedModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.aiplatform.v1beta1.ITuningJob, + protos.google.cloud.aiplatform.v1beta1.IRebaseTunedModelOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.aiplatform.v1beta1.ITuningJob, + protos.google.cloud.aiplatform.v1beta1.IRebaseTunedModelOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.aiplatform.v1beta1.ITuningJob, + protos.google.cloud.aiplatform.v1beta1.IRebaseTunedModelOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.rebaseTunedModel(request, options, callback); + } + /** + * Check the status of the long running operation returned by `rebaseTunedModel()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/gen_ai_tuning_service.rebase_tuned_model.js + * region_tag:aiplatform_v1beta1_generated_GenAiTuningService_RebaseTunedModel_async + */ + async checkRebaseTunedModelProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.aiplatform.v1beta1.TuningJob, + protos.google.cloud.aiplatform.v1beta1.RebaseTunedModelOperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.rebaseTunedModel, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.aiplatform.v1beta1.TuningJob, + protos.google.cloud.aiplatform.v1beta1.RebaseTunedModelOperationMetadata + >; + } /** * Lists TuningJobs in a Location. * @@ -1288,6 +3207,181 @@ export class GenAiTuningServiceClient { return this.locationsClient.listLocationsAsync(request, options); } + /** + * 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. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * 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 + * {@link 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 {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * 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`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); + } + // -------------------- // -- Path templates -- // -------------------- @@ -5044,6 +7138,7 @@ export class GenAiTuningServiceClient { stub.close(); this.iamClient.close(); this.locationsClient.close(); + this.operationsClient.close(); }); } return Promise.resolve(); diff --git a/packages/google-cloud-aiplatform/src/v1beta1/gen_ai_tuning_service_client_config.json b/packages/google-cloud-aiplatform/src/v1beta1/gen_ai_tuning_service_client_config.json index 41eac2e9d50..804ccd05c80 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/gen_ai_tuning_service_client_config.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/gen_ai_tuning_service_client_config.json @@ -35,6 +35,10 @@ "CancelTuningJob": { "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "RebaseTunedModel": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-aiplatform/test/gapic_gen_ai_tuning_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_gen_ai_tuning_service_v1.ts index d8424577a24..8d6ed34dfb3 100644 --- a/packages/google-cloud-aiplatform/test/gapic_gen_ai_tuning_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_gen_ai_tuning_service_v1.ts @@ -25,7 +25,13 @@ import * as genaituningserviceModule from '../src'; import {PassThrough} from 'stream'; -import {protobuf, IamProtos, LocationProtos} from 'google-gax'; +import { + protobuf, + LROperation, + operationsProtos, + IamProtos, + LocationProtos, +} from 'google-gax'; // Dynamically loaded proto JSON is needed to get the type information // to fill in default values for request objects @@ -66,6 +72,38 @@ function stubSimpleCallWithCallback( : sinon.stub().callsArgWith(2, null, response); } +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + function stubPageStreamingCall( responses?: ResponseType[], error?: Error @@ -697,6 +735,200 @@ describe('v1.GenAiTuningServiceClient', () => { }); }); + describe('rebaseTunedModel', () => { + it('invokes rebaseTunedModel without error', async () => { + const client = new genaituningserviceModule.v1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.RebaseTunedModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.RebaseTunedModelRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.rebaseTunedModel = + stubLongRunningCall(expectedResponse); + const [operation] = await client.rebaseTunedModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.rebaseTunedModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rebaseTunedModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rebaseTunedModel without error using callback', async () => { + const client = new genaituningserviceModule.v1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.RebaseTunedModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.RebaseTunedModelRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.rebaseTunedModel = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.rebaseTunedModel( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.aiplatform.v1.ITuningJob, + protos.google.cloud.aiplatform.v1.IRebaseTunedModelOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.aiplatform.v1.ITuningJob, + protos.google.cloud.aiplatform.v1.IRebaseTunedModelOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.rebaseTunedModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rebaseTunedModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rebaseTunedModel with call error', async () => { + const client = new genaituningserviceModule.v1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.RebaseTunedModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.RebaseTunedModelRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.rebaseTunedModel = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.rebaseTunedModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.rebaseTunedModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rebaseTunedModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rebaseTunedModel with LRO error', async () => { + const client = new genaituningserviceModule.v1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.RebaseTunedModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.RebaseTunedModelRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.rebaseTunedModel = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.rebaseTunedModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.rebaseTunedModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rebaseTunedModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRebaseTunedModelProgress without error', async () => { + const client = new genaituningserviceModule.v1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRebaseTunedModelProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRebaseTunedModelProgress with error', async () => { + const client = new genaituningserviceModule.v1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkRebaseTunedModelProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + describe('listTuningJobs', () => { it('invokes listTuningJobs without error', async () => { const client = new genaituningserviceModule.v1.GenAiTuningServiceClient({ @@ -1543,6 +1775,311 @@ describe('v1.GenAiTuningServiceClient', () => { ); }); }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new genaituningserviceModule.v1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new genaituningserviceModule.v1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new genaituningserviceModule.v1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.getOperation(request); + }, expectedError); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new genaituningserviceModule.v1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = + stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new genaituningserviceModule.v1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new genaituningserviceModule.v1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.cancelOperation(request); + }, expectedError); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new genaituningserviceModule.v1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = + stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new genaituningserviceModule.v1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new genaituningserviceModule.v1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.deleteOperation(request); + }, expectedError); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new genaituningserviceModule.v1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new genaituningserviceModule.v1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); describe('Path templates', () => { describe('annotation', () => { diff --git a/packages/google-cloud-aiplatform/test/gapic_gen_ai_tuning_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_gen_ai_tuning_service_v1beta1.ts index 7d464d18b48..5169eb42c9b 100644 --- a/packages/google-cloud-aiplatform/test/gapic_gen_ai_tuning_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_gen_ai_tuning_service_v1beta1.ts @@ -25,7 +25,13 @@ import * as genaituningserviceModule from '../src'; import {PassThrough} from 'stream'; -import {protobuf, IamProtos, LocationProtos} from 'google-gax'; +import { + protobuf, + LROperation, + operationsProtos, + IamProtos, + LocationProtos, +} from 'google-gax'; // Dynamically loaded proto JSON is needed to get the type information // to fill in default values for request objects @@ -66,6 +72,38 @@ function stubSimpleCallWithCallback( : sinon.stub().callsArgWith(2, null, response); } +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + function stubPageStreamingCall( responses?: ResponseType[], error?: Error @@ -721,6 +759,206 @@ describe('v1beta1.GenAiTuningServiceClient', () => { }); }); + describe('rebaseTunedModel', () => { + it('invokes rebaseTunedModel without error', async () => { + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.rebaseTunedModel = + stubLongRunningCall(expectedResponse); + const [operation] = await client.rebaseTunedModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.rebaseTunedModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rebaseTunedModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rebaseTunedModel without error using callback', async () => { + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.rebaseTunedModel = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.rebaseTunedModel( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.aiplatform.v1beta1.ITuningJob, + protos.google.cloud.aiplatform.v1beta1.IRebaseTunedModelOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.aiplatform.v1beta1.ITuningJob, + protos.google.cloud.aiplatform.v1beta1.IRebaseTunedModelOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.rebaseTunedModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rebaseTunedModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rebaseTunedModel with call error', async () => { + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.rebaseTunedModel = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.rebaseTunedModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.rebaseTunedModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rebaseTunedModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rebaseTunedModel with LRO error', async () => { + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.RebaseTunedModelRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.rebaseTunedModel = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.rebaseTunedModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.rebaseTunedModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rebaseTunedModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRebaseTunedModelProgress without error', async () => { + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRebaseTunedModelProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRebaseTunedModelProgress with error', async () => { + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkRebaseTunedModelProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + describe('listTuningJobs', () => { it('invokes listTuningJobs without error', async () => { const client = @@ -1591,6 +1829,322 @@ describe('v1beta1.GenAiTuningServiceClient', () => { ); }); }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.getOperation(request); + }, expectedError); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = + stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.cancelOperation(request); + }, expectedError); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = + stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.deleteOperation(request); + }, expectedError); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + it('uses async iteration with listOperations with error', async () => { + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); describe('Path templates', () => { describe('annotation', () => {