diff --git a/packages/google-cloud-aiplatform/README.md b/packages/google-cloud-aiplatform/README.md index d3b3c8f33ae..a7008dcf467 100644 --- a/packages/google-cloud-aiplatform/README.md +++ b/packages/google-cloud-aiplatform/README.md @@ -481,6 +481,10 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Featurestore_service.update_entity_type | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.update_entity_type.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/featurestore_service.update_entity_type.js,packages/google-cloud-aiplatform/samples/README.md) | | Featurestore_service.update_feature | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.update_feature.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/featurestore_service.update_feature.js,packages/google-cloud-aiplatform/samples/README.md) | | Featurestore_service.update_featurestore | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.update_featurestore.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/featurestore_service.update_featurestore.js,packages/google-cloud-aiplatform/samples/README.md) | +| Gen_ai_tuning_service.cancel_tuning_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.cancel_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.cancel_tuning_job.js,packages/google-cloud-aiplatform/samples/README.md) | +| 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) | | 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/v1beta1/genai_tuning_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto new file mode 100644 index 00000000000..cc44a829f9b --- /dev/null +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto @@ -0,0 +1,164 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +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/tuning_job.proto"; +import "google/protobuf/empty.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +option java_multiple_files = true; +option java_outer_classname = "GenAiTuningServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// A service for creating and managing GenAI Tuning Jobs. +service GenAiTuningService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a TuningJob. A created TuningJob right away will be attempted to + // be run. + rpc CreateTuningJob(CreateTuningJobRequest) returns (TuningJob) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/tuningJobs" + body: "tuning_job" + }; + option (google.api.method_signature) = "parent,tuning_job"; + } + + // Gets a TuningJob. + rpc GetTuningJob(GetTuningJobRequest) returns (TuningJob) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/tuningJobs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists TuningJobs in a Location. + rpc ListTuningJobs(ListTuningJobsRequest) returns (ListTuningJobsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/tuningJobs" + }; + option (google.api.method_signature) = "parent"; + } + + // Cancels a TuningJob. + // Starts asynchronous cancellation on the TuningJob. The server makes a best + // effort to cancel the job, but success is not guaranteed. Clients can use + // [GenAiTuningService.GetTuningJob][google.cloud.aiplatform.v1beta1.GenAiTuningService.GetTuningJob] + // or other methods to check whether the cancellation succeeded or whether the + // job completed despite cancellation. On successful cancellation, the + // TuningJob is not deleted; instead it becomes a job with a + // [TuningJob.error][google.cloud.aiplatform.v1beta1.TuningJob.error] value + // with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding + // to `Code.CANCELLED`, and + // [TuningJob.state][google.cloud.aiplatform.v1beta1.TuningJob.state] is set + // to `CANCELLED`. + rpc CancelTuningJob(CancelTuningJobRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/tuningJobs/*}:cancel" + body: "*" + }; + option (google.api.method_signature) = "name"; + } +} + +// Request message for +// [GenAiTuningService.CreateTuningJob][google.cloud.aiplatform.v1beta1.GenAiTuningService.CreateTuningJob]. +message CreateTuningJobRequest { + // Required. The resource name of the Location to create the TuningJob in. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The TuningJob to create. + TuningJob tuning_job = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [GenAiTuningService.GetTuningJob][google.cloud.aiplatform.v1beta1.GenAiTuningService.GetTuningJob]. +message GetTuningJobRequest { + // Required. The name of the TuningJob resource. Format: + // `projects/{project}/locations/{location}/tuningJobs/{tuning_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TuningJob" + } + ]; +} + +// Request message for +// [GenAiTuningService.ListTuningJobs][google.cloud.aiplatform.v1beta1.GenAiTuningService.ListTuningJobs]. +message ListTuningJobsRequest { + // Required. The resource name of the Location to list the TuningJobs from. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. The standard list filter. + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The standard list page size. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The standard list page token. + // Typically obtained via [ListTuningJob.next_page_token][] of the + // previous GenAiTuningService.ListTuningJob][] call. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [GenAiTuningService.ListTuningJobs][google.cloud.aiplatform.v1beta1.GenAiTuningService.ListTuningJobs] +message ListTuningJobsResponse { + // List of TuningJobs in the requested page. + repeated TuningJob tuning_jobs = 1; + + // A token to retrieve the next page of results. + // Pass to + // [ListTuningJobsRequest.page_token][google.cloud.aiplatform.v1beta1.ListTuningJobsRequest.page_token] + // to obtain that page. + string next_page_token = 2; +} + +// Request message for +// [GenAiTuningService.CancelTuningJob][google.cloud.aiplatform.v1beta1.GenAiTuningService.CancelTuningJob]. +message CancelTuningJobRequest { + // Required. The name of the TuningJob to cancel. Format: + // `projects/{project}/locations/{location}/tuningJobs/{tuning_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TuningJob" + } + ]; +} 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 new file mode 100644 index 00000000000..7dd52c5047e --- /dev/null +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/tuning_job.proto @@ -0,0 +1,286 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/content.proto"; +import "google/cloud/aiplatform/v1beta1/encryption_spec.proto"; +import "google/cloud/aiplatform/v1beta1/job_state.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +option java_multiple_files = true; +option java_outer_classname = "TuningJobProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// Represents a TuningJob that runs with Google owned models. +message TuningJob { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/TuningJob" + pattern: "projects/{project}/locations/{location}/tuningJobs/{tuning_job}" + plural: "tuningJobs" + singular: "tuningJob" + }; + + oneof source_model { + // The base model that is being tuned, e.g., "gemini-1.0-pro-002". + string base_model = 4; + } + + oneof tuning_spec { + // Tuning Spec for Supervised Fine Tuning. + SupervisedTuningSpec supervised_tuning_spec = 5; + } + + // Output only. Identifier. Resource name of a TuningJob. Format: + // `projects/{project}/locations/{location}/tuningJobs/{tuning_job}` + string name = 1 [ + (google.api.field_behavior) = IDENTIFIER, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Optional. The display name of the + // [TunedModel][google.cloud.aiplatform.v1.Model]. The name can be up to 128 + // characters long and can consist of any UTF-8 characters. + string tuned_model_display_name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The description of the + // [TuningJob][google.cloud.aiplatform.v1.TuningJob]. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The detailed state of the job. + JobState state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the + // [TuningJob][google.cloud.aiplatform.v1.TuningJob] was created. + google.protobuf.Timestamp create_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the + // [TuningJob][google.cloud.aiplatform.v1.TuningJob] for the first time + // entered the `JOB_STATE_RUNNING` state. + google.protobuf.Timestamp start_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the TuningJob entered any of the following + // [JobStates][google.cloud.aiplatform.v1.JobState]: `JOB_STATE_SUCCEEDED`, + // `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`, `JOB_STATE_EXPIRED`. + google.protobuf.Timestamp end_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the + // [TuningJob][google.cloud.aiplatform.v1.TuningJob] was most recently + // updated. + google.protobuf.Timestamp update_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Only populated when job's state is `JOB_STATE_FAILED` or + // `JOB_STATE_CANCELLED`. + google.rpc.Status error = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The labels with user-defined metadata to organize + // [TuningJob][google.cloud.aiplatform.v1.TuningJob] and generated resources + // such as [Model][google.cloud.aiplatform.v1.Model] and + // [Endpoint][google.cloud.aiplatform.v1.Endpoint]. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + map labels = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The Experiment associated with this + // [TuningJob][google.cloud.aiplatform.v1.TuningJob]. + string experiment = 13 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Context" + } + ]; + + // Output only. The tuned model resources assiociated with this + // [TuningJob][google.cloud.aiplatform.v1.TuningJob]. + TunedModel tuned_model = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The tuning data statistics associated with this + // [TuningJob][google.cloud.aiplatform.v1.TuningJob]. + TuningDataStats tuning_data_stats = 15 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Customer-managed encryption key options for a TuningJob. If this is set, + // then all resources created by the TuningJob will be encrypted with the + // provided encryption key. + EncryptionSpec encryption_spec = 16; +} + +// The Model Registry Model and Online Prediction Endpoint assiociated with +// this [TuningJob][google.cloud.aiplatform.v1.TuningJob]. +message TunedModel { + // Output only. The resource name of the TunedModel. Format: + // `projects/{project}/locations/{location}/models/{model}`. + string model = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + } + ]; + + // Output only. A resource name of an Endpoint. Format: + // `projects/{project}/locations/{location}/endpoints/{endpoint}`. + string endpoint = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Endpoint" + } + ]; +} + +// Dataset distribution for Supervised Tuning. +message SupervisedTuningDatasetDistribution { + // Dataset bucket used to create a histogram for the distribution given a + // population of values. + message DatasetBucket { + // Output only. Number of values in the bucket. + double count = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Left bound of the bucket. + double left = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Right bound of the bucket. + double right = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. Sum of a given population of values. + int64 sum = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The minimum of the population values. + double min = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The maximum of the population values. + double max = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The arithmetic mean of the values in the population. + double mean = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The median of the values in the population. + double median = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The 5th percentile of the values in the population. + double p5 = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The 95th percentile of the values in the population. + double p95 = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Defines the histogram bucket. + repeated DatasetBucket buckets = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Tuning data statistics for Supervised Tuning. +message SupervisedTuningDataStats { + // Output only. Number of examples in the tuning dataset. + int64 tuning_dataset_example_count = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Number of tuning characters in the tuning dataset. + int64 total_tuning_character_count = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Number of billable characters in the tuning dataset. + int64 total_billable_character_count = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Number of tuning steps for this Tuning Job. + int64 tuning_step_count = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Dataset distributions for the user input tokens. + SupervisedTuningDatasetDistribution user_input_token_distribution = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Dataset distributions for the user output tokens. + SupervisedTuningDatasetDistribution user_output_token_distribution = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Dataset distributions for the messages per example. + SupervisedTuningDatasetDistribution user_message_per_example_distribution = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Sample user messages in the training dataset uri. + repeated Content user_dataset_examples = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The tuning data statistic values for +// [TuningJob][google.cloud.aiplatform.v1.TuningJob]. +message TuningDataStats { + oneof tuning_data_stats { + // The SFT Tuning data stats. + SupervisedTuningDataStats supervised_tuning_data_stats = 1; + } +} + +// Hyperparameters for SFT. +message SupervisedHyperParameters { + // Supported adapter sizes for tuning. + enum AdapterSize { + // Adapter size is unspecified. + ADAPTER_SIZE_UNSPECIFIED = 0; + + // Adapter size 1. + ADAPTER_SIZE_ONE = 1; + + // Adapter size 4. + ADAPTER_SIZE_FOUR = 2; + + // Adapter size 8. + ADAPTER_SIZE_EIGHT = 3; + + // Adapter size 16. + ADAPTER_SIZE_SIXTEEN = 4; + } + + // Optional. Number of complete passes the model makes over the entire + // training dataset during training. + int64 epoch_count = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Multiplier for adjusting the default learning rate. + double learning_rate_multiplier = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Adapter size for tuning. + AdapterSize adapter_size = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Tuning Spec for Supervised Tuning. +message SupervisedTuningSpec { + // Required. Cloud Storage path to file containing training dataset for + // tuning. The dataset must be formatted as a JSONL file. + string training_dataset_uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Cloud Storage path to file containing validation dataset for + // tuning. The dataset must be formatted as a JSONL file. + string validation_dataset_uri = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hyperparameters for SFT. + SupervisedHyperParameters hyper_parameters = 3 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-aiplatform/protos/protos.d.ts b/packages/google-cloud-aiplatform/protos/protos.d.ts index 660458c8479..d399eafe4e2 100644 --- a/packages/google-cloud-aiplatform/protos/protos.d.ts +++ b/packages/google-cloud-aiplatform/protos/protos.d.ts @@ -161033,6 +161033,1645 @@ export namespace google { } } + /** Represents a GenAiTuningService */ + class GenAiTuningService extends $protobuf.rpc.Service { + + /** + * Constructs a new GenAiTuningService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new GenAiTuningService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): GenAiTuningService; + + /** + * Calls CreateTuningJob. + * @param request CreateTuningJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TuningJob + */ + public createTuningJob(request: google.cloud.aiplatform.v1beta1.ICreateTuningJobRequest, callback: google.cloud.aiplatform.v1beta1.GenAiTuningService.CreateTuningJobCallback): void; + + /** + * Calls CreateTuningJob. + * @param request CreateTuningJobRequest message or plain object + * @returns Promise + */ + public createTuningJob(request: google.cloud.aiplatform.v1beta1.ICreateTuningJobRequest): Promise; + + /** + * Calls GetTuningJob. + * @param request GetTuningJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TuningJob + */ + public getTuningJob(request: google.cloud.aiplatform.v1beta1.IGetTuningJobRequest, callback: google.cloud.aiplatform.v1beta1.GenAiTuningService.GetTuningJobCallback): void; + + /** + * Calls GetTuningJob. + * @param request GetTuningJobRequest message or plain object + * @returns Promise + */ + public getTuningJob(request: google.cloud.aiplatform.v1beta1.IGetTuningJobRequest): Promise; + + /** + * Calls ListTuningJobs. + * @param request ListTuningJobsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTuningJobsResponse + */ + public listTuningJobs(request: google.cloud.aiplatform.v1beta1.IListTuningJobsRequest, callback: google.cloud.aiplatform.v1beta1.GenAiTuningService.ListTuningJobsCallback): void; + + /** + * Calls ListTuningJobs. + * @param request ListTuningJobsRequest message or plain object + * @returns Promise + */ + public listTuningJobs(request: google.cloud.aiplatform.v1beta1.IListTuningJobsRequest): Promise; + + /** + * Calls CancelTuningJob. + * @param request CancelTuningJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelTuningJob(request: google.cloud.aiplatform.v1beta1.ICancelTuningJobRequest, callback: google.cloud.aiplatform.v1beta1.GenAiTuningService.CancelTuningJobCallback): void; + + /** + * Calls CancelTuningJob. + * @param request CancelTuningJobRequest message or plain object + * @returns Promise + */ + public cancelTuningJob(request: google.cloud.aiplatform.v1beta1.ICancelTuningJobRequest): Promise; + } + + namespace GenAiTuningService { + + /** + * Callback as used by {@link google.cloud.aiplatform.v1beta1.GenAiTuningService|createTuningJob}. + * @param error Error, if any + * @param [response] TuningJob + */ + type CreateTuningJobCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1beta1.TuningJob) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1beta1.GenAiTuningService|getTuningJob}. + * @param error Error, if any + * @param [response] TuningJob + */ + type GetTuningJobCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1beta1.TuningJob) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1beta1.GenAiTuningService|listTuningJobs}. + * @param error Error, if any + * @param [response] ListTuningJobsResponse + */ + type ListTuningJobsCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1beta1.ListTuningJobsResponse) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1beta1.GenAiTuningService|cancelTuningJob}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelTuningJobCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a CreateTuningJobRequest. */ + interface ICreateTuningJobRequest { + + /** CreateTuningJobRequest parent */ + parent?: (string|null); + + /** CreateTuningJobRequest tuningJob */ + tuningJob?: (google.cloud.aiplatform.v1beta1.ITuningJob|null); + } + + /** Represents a CreateTuningJobRequest. */ + class CreateTuningJobRequest implements ICreateTuningJobRequest { + + /** + * Constructs a new CreateTuningJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.ICreateTuningJobRequest); + + /** CreateTuningJobRequest parent. */ + public parent: string; + + /** CreateTuningJobRequest tuningJob. */ + public tuningJob?: (google.cloud.aiplatform.v1beta1.ITuningJob|null); + + /** + * Creates a new CreateTuningJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTuningJobRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.ICreateTuningJobRequest): google.cloud.aiplatform.v1beta1.CreateTuningJobRequest; + + /** + * Encodes the specified CreateTuningJobRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.CreateTuningJobRequest.verify|verify} messages. + * @param message CreateTuningJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.ICreateTuningJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateTuningJobRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.CreateTuningJobRequest.verify|verify} messages. + * @param message CreateTuningJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.ICreateTuningJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateTuningJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTuningJobRequest + * @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.CreateTuningJobRequest; + + /** + * Decodes a CreateTuningJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTuningJobRequest + * @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.CreateTuningJobRequest; + + /** + * Verifies a CreateTuningJobRequest 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 CreateTuningJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTuningJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.CreateTuningJobRequest; + + /** + * Creates a plain object from a CreateTuningJobRequest message. Also converts values to other types if specified. + * @param message CreateTuningJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.CreateTuningJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateTuningJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateTuningJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTuningJobRequest. */ + interface IGetTuningJobRequest { + + /** GetTuningJobRequest name */ + name?: (string|null); + } + + /** Represents a GetTuningJobRequest. */ + class GetTuningJobRequest implements IGetTuningJobRequest { + + /** + * Constructs a new GetTuningJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IGetTuningJobRequest); + + /** GetTuningJobRequest name. */ + public name: string; + + /** + * Creates a new GetTuningJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTuningJobRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IGetTuningJobRequest): google.cloud.aiplatform.v1beta1.GetTuningJobRequest; + + /** + * Encodes the specified GetTuningJobRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.GetTuningJobRequest.verify|verify} messages. + * @param message GetTuningJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IGetTuningJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTuningJobRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.GetTuningJobRequest.verify|verify} messages. + * @param message GetTuningJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IGetTuningJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTuningJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTuningJobRequest + * @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.GetTuningJobRequest; + + /** + * Decodes a GetTuningJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTuningJobRequest + * @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.GetTuningJobRequest; + + /** + * Verifies a GetTuningJobRequest 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 GetTuningJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTuningJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.GetTuningJobRequest; + + /** + * Creates a plain object from a GetTuningJobRequest message. Also converts values to other types if specified. + * @param message GetTuningJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.GetTuningJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTuningJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTuningJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTuningJobsRequest. */ + interface IListTuningJobsRequest { + + /** ListTuningJobsRequest parent */ + parent?: (string|null); + + /** ListTuningJobsRequest filter */ + filter?: (string|null); + + /** ListTuningJobsRequest pageSize */ + pageSize?: (number|null); + + /** ListTuningJobsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListTuningJobsRequest. */ + class ListTuningJobsRequest implements IListTuningJobsRequest { + + /** + * Constructs a new ListTuningJobsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IListTuningJobsRequest); + + /** ListTuningJobsRequest parent. */ + public parent: string; + + /** ListTuningJobsRequest filter. */ + public filter: string; + + /** ListTuningJobsRequest pageSize. */ + public pageSize: number; + + /** ListTuningJobsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListTuningJobsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTuningJobsRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IListTuningJobsRequest): google.cloud.aiplatform.v1beta1.ListTuningJobsRequest; + + /** + * Encodes the specified ListTuningJobsRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ListTuningJobsRequest.verify|verify} messages. + * @param message ListTuningJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IListTuningJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTuningJobsRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ListTuningJobsRequest.verify|verify} messages. + * @param message ListTuningJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IListTuningJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTuningJobsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTuningJobsRequest + * @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.ListTuningJobsRequest; + + /** + * Decodes a ListTuningJobsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTuningJobsRequest + * @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.ListTuningJobsRequest; + + /** + * Verifies a ListTuningJobsRequest 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 ListTuningJobsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTuningJobsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.ListTuningJobsRequest; + + /** + * Creates a plain object from a ListTuningJobsRequest message. Also converts values to other types if specified. + * @param message ListTuningJobsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.ListTuningJobsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTuningJobsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTuningJobsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTuningJobsResponse. */ + interface IListTuningJobsResponse { + + /** ListTuningJobsResponse tuningJobs */ + tuningJobs?: (google.cloud.aiplatform.v1beta1.ITuningJob[]|null); + + /** ListTuningJobsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListTuningJobsResponse. */ + class ListTuningJobsResponse implements IListTuningJobsResponse { + + /** + * Constructs a new ListTuningJobsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IListTuningJobsResponse); + + /** ListTuningJobsResponse tuningJobs. */ + public tuningJobs: google.cloud.aiplatform.v1beta1.ITuningJob[]; + + /** ListTuningJobsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListTuningJobsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTuningJobsResponse instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IListTuningJobsResponse): google.cloud.aiplatform.v1beta1.ListTuningJobsResponse; + + /** + * Encodes the specified ListTuningJobsResponse message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ListTuningJobsResponse.verify|verify} messages. + * @param message ListTuningJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IListTuningJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTuningJobsResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ListTuningJobsResponse.verify|verify} messages. + * @param message ListTuningJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IListTuningJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTuningJobsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTuningJobsResponse + * @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.ListTuningJobsResponse; + + /** + * Decodes a ListTuningJobsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTuningJobsResponse + * @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.ListTuningJobsResponse; + + /** + * Verifies a ListTuningJobsResponse 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 ListTuningJobsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTuningJobsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.ListTuningJobsResponse; + + /** + * Creates a plain object from a ListTuningJobsResponse message. Also converts values to other types if specified. + * @param message ListTuningJobsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.ListTuningJobsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTuningJobsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTuningJobsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelTuningJobRequest. */ + interface ICancelTuningJobRequest { + + /** CancelTuningJobRequest name */ + name?: (string|null); + } + + /** Represents a CancelTuningJobRequest. */ + class CancelTuningJobRequest implements ICancelTuningJobRequest { + + /** + * Constructs a new CancelTuningJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.ICancelTuningJobRequest); + + /** CancelTuningJobRequest name. */ + public name: string; + + /** + * Creates a new CancelTuningJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelTuningJobRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.ICancelTuningJobRequest): google.cloud.aiplatform.v1beta1.CancelTuningJobRequest; + + /** + * Encodes the specified CancelTuningJobRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.CancelTuningJobRequest.verify|verify} messages. + * @param message CancelTuningJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.ICancelTuningJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelTuningJobRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.CancelTuningJobRequest.verify|verify} messages. + * @param message CancelTuningJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.ICancelTuningJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelTuningJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelTuningJobRequest + * @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.CancelTuningJobRequest; + + /** + * Decodes a CancelTuningJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelTuningJobRequest + * @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.CancelTuningJobRequest; + + /** + * Verifies a CancelTuningJobRequest 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 CancelTuningJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelTuningJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.CancelTuningJobRequest; + + /** + * Creates a plain object from a CancelTuningJobRequest message. Also converts values to other types if specified. + * @param message CancelTuningJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.CancelTuningJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelTuningJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelTuningJobRequest + * @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 { + + /** TuningJob baseModel */ + baseModel?: (string|null); + + /** TuningJob supervisedTuningSpec */ + supervisedTuningSpec?: (google.cloud.aiplatform.v1beta1.ISupervisedTuningSpec|null); + + /** TuningJob name */ + name?: (string|null); + + /** TuningJob tunedModelDisplayName */ + tunedModelDisplayName?: (string|null); + + /** TuningJob description */ + description?: (string|null); + + /** TuningJob state */ + state?: (google.cloud.aiplatform.v1beta1.JobState|keyof typeof google.cloud.aiplatform.v1beta1.JobState|null); + + /** TuningJob createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** TuningJob startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** TuningJob endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** TuningJob updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** TuningJob error */ + error?: (google.rpc.IStatus|null); + + /** TuningJob labels */ + labels?: ({ [k: string]: string }|null); + + /** TuningJob experiment */ + experiment?: (string|null); + + /** TuningJob tunedModel */ + tunedModel?: (google.cloud.aiplatform.v1beta1.ITunedModel|null); + + /** TuningJob tuningDataStats */ + tuningDataStats?: (google.cloud.aiplatform.v1beta1.ITuningDataStats|null); + + /** TuningJob encryptionSpec */ + encryptionSpec?: (google.cloud.aiplatform.v1beta1.IEncryptionSpec|null); + } + + /** Represents a TuningJob. */ + class TuningJob implements ITuningJob { + + /** + * Constructs a new TuningJob. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.ITuningJob); + + /** TuningJob baseModel. */ + public baseModel?: (string|null); + + /** TuningJob supervisedTuningSpec. */ + public supervisedTuningSpec?: (google.cloud.aiplatform.v1beta1.ISupervisedTuningSpec|null); + + /** TuningJob name. */ + public name: string; + + /** TuningJob tunedModelDisplayName. */ + public tunedModelDisplayName: string; + + /** TuningJob description. */ + public description: string; + + /** TuningJob state. */ + public state: (google.cloud.aiplatform.v1beta1.JobState|keyof typeof google.cloud.aiplatform.v1beta1.JobState); + + /** TuningJob createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** TuningJob startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** TuningJob endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** TuningJob updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** TuningJob error. */ + public error?: (google.rpc.IStatus|null); + + /** TuningJob labels. */ + public labels: { [k: string]: string }; + + /** TuningJob experiment. */ + public experiment: string; + + /** TuningJob tunedModel. */ + public tunedModel?: (google.cloud.aiplatform.v1beta1.ITunedModel|null); + + /** TuningJob tuningDataStats. */ + public tuningDataStats?: (google.cloud.aiplatform.v1beta1.ITuningDataStats|null); + + /** TuningJob encryptionSpec. */ + public encryptionSpec?: (google.cloud.aiplatform.v1beta1.IEncryptionSpec|null); + + /** TuningJob sourceModel. */ + public sourceModel?: "baseModel"; + + /** TuningJob tuningSpec. */ + public tuningSpec?: "supervisedTuningSpec"; + + /** + * Creates a new TuningJob instance using the specified properties. + * @param [properties] Properties to set + * @returns TuningJob instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.ITuningJob): google.cloud.aiplatform.v1beta1.TuningJob; + + /** + * Encodes the specified TuningJob message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.TuningJob.verify|verify} messages. + * @param message TuningJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.ITuningJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TuningJob message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.TuningJob.verify|verify} messages. + * @param message TuningJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.ITuningJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TuningJob message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TuningJob + * @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.TuningJob; + + /** + * Decodes a TuningJob message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TuningJob + * @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.TuningJob; + + /** + * Verifies a TuningJob 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 TuningJob message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TuningJob + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.TuningJob; + + /** + * Creates a plain object from a TuningJob message. Also converts values to other types if specified. + * @param message TuningJob + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.TuningJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TuningJob to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TuningJob + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TunedModel. */ + interface ITunedModel { + + /** TunedModel model */ + model?: (string|null); + + /** TunedModel endpoint */ + endpoint?: (string|null); + } + + /** Represents a TunedModel. */ + class TunedModel implements ITunedModel { + + /** + * Constructs a new TunedModel. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.ITunedModel); + + /** TunedModel model. */ + public model: string; + + /** TunedModel endpoint. */ + public endpoint: string; + + /** + * Creates a new TunedModel instance using the specified properties. + * @param [properties] Properties to set + * @returns TunedModel instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.ITunedModel): google.cloud.aiplatform.v1beta1.TunedModel; + + /** + * Encodes the specified TunedModel message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.TunedModel.verify|verify} messages. + * @param message TunedModel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.ITunedModel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TunedModel message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.TunedModel.verify|verify} messages. + * @param message TunedModel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.ITunedModel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TunedModel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TunedModel + * @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.TunedModel; + + /** + * Decodes a TunedModel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TunedModel + * @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.TunedModel; + + /** + * Verifies a TunedModel 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 TunedModel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TunedModel + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.TunedModel; + + /** + * Creates a plain object from a TunedModel message. Also converts values to other types if specified. + * @param message TunedModel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.TunedModel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TunedModel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TunedModel + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SupervisedTuningDatasetDistribution. */ + interface ISupervisedTuningDatasetDistribution { + + /** SupervisedTuningDatasetDistribution sum */ + sum?: (number|Long|string|null); + + /** SupervisedTuningDatasetDistribution min */ + min?: (number|null); + + /** SupervisedTuningDatasetDistribution max */ + max?: (number|null); + + /** SupervisedTuningDatasetDistribution mean */ + mean?: (number|null); + + /** SupervisedTuningDatasetDistribution median */ + median?: (number|null); + + /** SupervisedTuningDatasetDistribution p5 */ + p5?: (number|null); + + /** SupervisedTuningDatasetDistribution p95 */ + p95?: (number|null); + + /** SupervisedTuningDatasetDistribution buckets */ + buckets?: (google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.IDatasetBucket[]|null); + } + + /** Represents a SupervisedTuningDatasetDistribution. */ + class SupervisedTuningDatasetDistribution implements ISupervisedTuningDatasetDistribution { + + /** + * Constructs a new SupervisedTuningDatasetDistribution. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.ISupervisedTuningDatasetDistribution); + + /** SupervisedTuningDatasetDistribution sum. */ + public sum: (number|Long|string); + + /** SupervisedTuningDatasetDistribution min. */ + public min: number; + + /** SupervisedTuningDatasetDistribution max. */ + public max: number; + + /** SupervisedTuningDatasetDistribution mean. */ + public mean: number; + + /** SupervisedTuningDatasetDistribution median. */ + public median: number; + + /** SupervisedTuningDatasetDistribution p5. */ + public p5: number; + + /** SupervisedTuningDatasetDistribution p95. */ + public p95: number; + + /** SupervisedTuningDatasetDistribution buckets. */ + public buckets: google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.IDatasetBucket[]; + + /** + * Creates a new SupervisedTuningDatasetDistribution instance using the specified properties. + * @param [properties] Properties to set + * @returns SupervisedTuningDatasetDistribution instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.ISupervisedTuningDatasetDistribution): google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution; + + /** + * Encodes the specified SupervisedTuningDatasetDistribution message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.verify|verify} messages. + * @param message SupervisedTuningDatasetDistribution message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.ISupervisedTuningDatasetDistribution, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SupervisedTuningDatasetDistribution message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.verify|verify} messages. + * @param message SupervisedTuningDatasetDistribution message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.ISupervisedTuningDatasetDistribution, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SupervisedTuningDatasetDistribution message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SupervisedTuningDatasetDistribution + * @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.SupervisedTuningDatasetDistribution; + + /** + * Decodes a SupervisedTuningDatasetDistribution message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SupervisedTuningDatasetDistribution + * @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.SupervisedTuningDatasetDistribution; + + /** + * Verifies a SupervisedTuningDatasetDistribution 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 SupervisedTuningDatasetDistribution message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SupervisedTuningDatasetDistribution + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution; + + /** + * Creates a plain object from a SupervisedTuningDatasetDistribution message. Also converts values to other types if specified. + * @param message SupervisedTuningDatasetDistribution + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SupervisedTuningDatasetDistribution to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SupervisedTuningDatasetDistribution + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SupervisedTuningDatasetDistribution { + + /** Properties of a DatasetBucket. */ + interface IDatasetBucket { + + /** DatasetBucket count */ + count?: (number|null); + + /** DatasetBucket left */ + left?: (number|null); + + /** DatasetBucket right */ + right?: (number|null); + } + + /** Represents a DatasetBucket. */ + class DatasetBucket implements IDatasetBucket { + + /** + * Constructs a new DatasetBucket. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.IDatasetBucket); + + /** DatasetBucket count. */ + public count: number; + + /** DatasetBucket left. */ + public left: number; + + /** DatasetBucket right. */ + public right: number; + + /** + * Creates a new DatasetBucket instance using the specified properties. + * @param [properties] Properties to set + * @returns DatasetBucket instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.IDatasetBucket): google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.DatasetBucket; + + /** + * Encodes the specified DatasetBucket message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.DatasetBucket.verify|verify} messages. + * @param message DatasetBucket message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.IDatasetBucket, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DatasetBucket message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.DatasetBucket.verify|verify} messages. + * @param message DatasetBucket message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.IDatasetBucket, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DatasetBucket message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DatasetBucket + * @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.SupervisedTuningDatasetDistribution.DatasetBucket; + + /** + * Decodes a DatasetBucket message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DatasetBucket + * @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.SupervisedTuningDatasetDistribution.DatasetBucket; + + /** + * Verifies a DatasetBucket 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 DatasetBucket message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DatasetBucket + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.DatasetBucket; + + /** + * Creates a plain object from a DatasetBucket message. Also converts values to other types if specified. + * @param message DatasetBucket + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.DatasetBucket, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DatasetBucket to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DatasetBucket + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SupervisedTuningDataStats. */ + interface ISupervisedTuningDataStats { + + /** SupervisedTuningDataStats tuningDatasetExampleCount */ + tuningDatasetExampleCount?: (number|Long|string|null); + + /** SupervisedTuningDataStats totalTuningCharacterCount */ + totalTuningCharacterCount?: (number|Long|string|null); + + /** SupervisedTuningDataStats totalBillableCharacterCount */ + totalBillableCharacterCount?: (number|Long|string|null); + + /** SupervisedTuningDataStats tuningStepCount */ + tuningStepCount?: (number|Long|string|null); + + /** SupervisedTuningDataStats userInputTokenDistribution */ + userInputTokenDistribution?: (google.cloud.aiplatform.v1beta1.ISupervisedTuningDatasetDistribution|null); + + /** SupervisedTuningDataStats userOutputTokenDistribution */ + userOutputTokenDistribution?: (google.cloud.aiplatform.v1beta1.ISupervisedTuningDatasetDistribution|null); + + /** SupervisedTuningDataStats userMessagePerExampleDistribution */ + userMessagePerExampleDistribution?: (google.cloud.aiplatform.v1beta1.ISupervisedTuningDatasetDistribution|null); + + /** SupervisedTuningDataStats userDatasetExamples */ + userDatasetExamples?: (google.cloud.aiplatform.v1beta1.IContent[]|null); + } + + /** Represents a SupervisedTuningDataStats. */ + class SupervisedTuningDataStats implements ISupervisedTuningDataStats { + + /** + * Constructs a new SupervisedTuningDataStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.ISupervisedTuningDataStats); + + /** SupervisedTuningDataStats tuningDatasetExampleCount. */ + public tuningDatasetExampleCount: (number|Long|string); + + /** SupervisedTuningDataStats totalTuningCharacterCount. */ + public totalTuningCharacterCount: (number|Long|string); + + /** SupervisedTuningDataStats totalBillableCharacterCount. */ + public totalBillableCharacterCount: (number|Long|string); + + /** SupervisedTuningDataStats tuningStepCount. */ + public tuningStepCount: (number|Long|string); + + /** SupervisedTuningDataStats userInputTokenDistribution. */ + public userInputTokenDistribution?: (google.cloud.aiplatform.v1beta1.ISupervisedTuningDatasetDistribution|null); + + /** SupervisedTuningDataStats userOutputTokenDistribution. */ + public userOutputTokenDistribution?: (google.cloud.aiplatform.v1beta1.ISupervisedTuningDatasetDistribution|null); + + /** SupervisedTuningDataStats userMessagePerExampleDistribution. */ + public userMessagePerExampleDistribution?: (google.cloud.aiplatform.v1beta1.ISupervisedTuningDatasetDistribution|null); + + /** SupervisedTuningDataStats userDatasetExamples. */ + public userDatasetExamples: google.cloud.aiplatform.v1beta1.IContent[]; + + /** + * Creates a new SupervisedTuningDataStats instance using the specified properties. + * @param [properties] Properties to set + * @returns SupervisedTuningDataStats instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.ISupervisedTuningDataStats): google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats; + + /** + * Encodes the specified SupervisedTuningDataStats message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats.verify|verify} messages. + * @param message SupervisedTuningDataStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.ISupervisedTuningDataStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SupervisedTuningDataStats message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats.verify|verify} messages. + * @param message SupervisedTuningDataStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.ISupervisedTuningDataStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SupervisedTuningDataStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SupervisedTuningDataStats + * @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.SupervisedTuningDataStats; + + /** + * Decodes a SupervisedTuningDataStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SupervisedTuningDataStats + * @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.SupervisedTuningDataStats; + + /** + * Verifies a SupervisedTuningDataStats 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 SupervisedTuningDataStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SupervisedTuningDataStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats; + + /** + * Creates a plain object from a SupervisedTuningDataStats message. Also converts values to other types if specified. + * @param message SupervisedTuningDataStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SupervisedTuningDataStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SupervisedTuningDataStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TuningDataStats. */ + interface ITuningDataStats { + + /** TuningDataStats supervisedTuningDataStats */ + supervisedTuningDataStats?: (google.cloud.aiplatform.v1beta1.ISupervisedTuningDataStats|null); + } + + /** Represents a TuningDataStats. */ + class TuningDataStats implements ITuningDataStats { + + /** + * Constructs a new TuningDataStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.ITuningDataStats); + + /** TuningDataStats supervisedTuningDataStats. */ + public supervisedTuningDataStats?: (google.cloud.aiplatform.v1beta1.ISupervisedTuningDataStats|null); + + /** TuningDataStats tuningDataStats. */ + public tuningDataStats?: "supervisedTuningDataStats"; + + /** + * Creates a new TuningDataStats instance using the specified properties. + * @param [properties] Properties to set + * @returns TuningDataStats instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.ITuningDataStats): google.cloud.aiplatform.v1beta1.TuningDataStats; + + /** + * Encodes the specified TuningDataStats message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.TuningDataStats.verify|verify} messages. + * @param message TuningDataStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.ITuningDataStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TuningDataStats message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.TuningDataStats.verify|verify} messages. + * @param message TuningDataStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.ITuningDataStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TuningDataStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TuningDataStats + * @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.TuningDataStats; + + /** + * Decodes a TuningDataStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TuningDataStats + * @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.TuningDataStats; + + /** + * Verifies a TuningDataStats 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 TuningDataStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TuningDataStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.TuningDataStats; + + /** + * Creates a plain object from a TuningDataStats message. Also converts values to other types if specified. + * @param message TuningDataStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.TuningDataStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TuningDataStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TuningDataStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SupervisedHyperParameters. */ + interface ISupervisedHyperParameters { + + /** SupervisedHyperParameters epochCount */ + epochCount?: (number|Long|string|null); + + /** SupervisedHyperParameters learningRateMultiplier */ + learningRateMultiplier?: (number|null); + + /** SupervisedHyperParameters adapterSize */ + adapterSize?: (google.cloud.aiplatform.v1beta1.SupervisedHyperParameters.AdapterSize|keyof typeof google.cloud.aiplatform.v1beta1.SupervisedHyperParameters.AdapterSize|null); + } + + /** Represents a SupervisedHyperParameters. */ + class SupervisedHyperParameters implements ISupervisedHyperParameters { + + /** + * Constructs a new SupervisedHyperParameters. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.ISupervisedHyperParameters); + + /** SupervisedHyperParameters epochCount. */ + public epochCount: (number|Long|string); + + /** SupervisedHyperParameters learningRateMultiplier. */ + public learningRateMultiplier: number; + + /** SupervisedHyperParameters adapterSize. */ + public adapterSize: (google.cloud.aiplatform.v1beta1.SupervisedHyperParameters.AdapterSize|keyof typeof google.cloud.aiplatform.v1beta1.SupervisedHyperParameters.AdapterSize); + + /** + * Creates a new SupervisedHyperParameters instance using the specified properties. + * @param [properties] Properties to set + * @returns SupervisedHyperParameters instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.ISupervisedHyperParameters): google.cloud.aiplatform.v1beta1.SupervisedHyperParameters; + + /** + * Encodes the specified SupervisedHyperParameters message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.SupervisedHyperParameters.verify|verify} messages. + * @param message SupervisedHyperParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.ISupervisedHyperParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SupervisedHyperParameters message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.SupervisedHyperParameters.verify|verify} messages. + * @param message SupervisedHyperParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.ISupervisedHyperParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SupervisedHyperParameters message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SupervisedHyperParameters + * @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.SupervisedHyperParameters; + + /** + * Decodes a SupervisedHyperParameters message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SupervisedHyperParameters + * @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.SupervisedHyperParameters; + + /** + * Verifies a SupervisedHyperParameters 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 SupervisedHyperParameters message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SupervisedHyperParameters + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.SupervisedHyperParameters; + + /** + * Creates a plain object from a SupervisedHyperParameters message. Also converts values to other types if specified. + * @param message SupervisedHyperParameters + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.SupervisedHyperParameters, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SupervisedHyperParameters to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SupervisedHyperParameters + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SupervisedHyperParameters { + + /** AdapterSize enum. */ + enum AdapterSize { + ADAPTER_SIZE_UNSPECIFIED = 0, + ADAPTER_SIZE_ONE = 1, + ADAPTER_SIZE_FOUR = 2, + ADAPTER_SIZE_EIGHT = 3, + ADAPTER_SIZE_SIXTEEN = 4 + } + } + + /** Properties of a SupervisedTuningSpec. */ + interface ISupervisedTuningSpec { + + /** SupervisedTuningSpec trainingDatasetUri */ + trainingDatasetUri?: (string|null); + + /** SupervisedTuningSpec validationDatasetUri */ + validationDatasetUri?: (string|null); + + /** SupervisedTuningSpec hyperParameters */ + hyperParameters?: (google.cloud.aiplatform.v1beta1.ISupervisedHyperParameters|null); + } + + /** Represents a SupervisedTuningSpec. */ + class SupervisedTuningSpec implements ISupervisedTuningSpec { + + /** + * Constructs a new SupervisedTuningSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.ISupervisedTuningSpec); + + /** SupervisedTuningSpec trainingDatasetUri. */ + public trainingDatasetUri: string; + + /** SupervisedTuningSpec validationDatasetUri. */ + public validationDatasetUri: string; + + /** SupervisedTuningSpec hyperParameters. */ + public hyperParameters?: (google.cloud.aiplatform.v1beta1.ISupervisedHyperParameters|null); + + /** + * Creates a new SupervisedTuningSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns SupervisedTuningSpec instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.ISupervisedTuningSpec): google.cloud.aiplatform.v1beta1.SupervisedTuningSpec; + + /** + * Encodes the specified SupervisedTuningSpec message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.SupervisedTuningSpec.verify|verify} messages. + * @param message SupervisedTuningSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.ISupervisedTuningSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SupervisedTuningSpec message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.SupervisedTuningSpec.verify|verify} messages. + * @param message SupervisedTuningSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.ISupervisedTuningSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SupervisedTuningSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SupervisedTuningSpec + * @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.SupervisedTuningSpec; + + /** + * Decodes a SupervisedTuningSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SupervisedTuningSpec + * @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.SupervisedTuningSpec; + + /** + * Verifies a SupervisedTuningSpec 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 SupervisedTuningSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SupervisedTuningSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.SupervisedTuningSpec; + + /** + * Creates a plain object from a SupervisedTuningSpec message. Also converts values to other types if specified. + * @param message SupervisedTuningSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.SupervisedTuningSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SupervisedTuningSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SupervisedTuningSpec + * @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 f9315575b7e..75772867971 100644 --- a/packages/google-cloud-aiplatform/protos/protos.js +++ b/packages/google-cloud-aiplatform/protos/protos.js @@ -392071,6 +392071,4202 @@ return Featurestore; })(); + v1beta1.GenAiTuningService = (function() { + + /** + * Constructs a new GenAiTuningService service. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a GenAiTuningService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function GenAiTuningService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (GenAiTuningService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = GenAiTuningService; + + /** + * Creates new GenAiTuningService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.GenAiTuningService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {GenAiTuningService} RPC service. Useful where requests and/or responses are streamed. + */ + GenAiTuningService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1beta1.GenAiTuningService|createTuningJob}. + * @memberof google.cloud.aiplatform.v1beta1.GenAiTuningService + * @typedef CreateTuningJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1beta1.TuningJob} [response] TuningJob + */ + + /** + * Calls CreateTuningJob. + * @function createTuningJob + * @memberof google.cloud.aiplatform.v1beta1.GenAiTuningService + * @instance + * @param {google.cloud.aiplatform.v1beta1.ICreateTuningJobRequest} request CreateTuningJobRequest message or plain object + * @param {google.cloud.aiplatform.v1beta1.GenAiTuningService.CreateTuningJobCallback} callback Node-style callback called with the error, if any, and TuningJob + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GenAiTuningService.prototype.createTuningJob = function createTuningJob(request, callback) { + return this.rpcCall(createTuningJob, $root.google.cloud.aiplatform.v1beta1.CreateTuningJobRequest, $root.google.cloud.aiplatform.v1beta1.TuningJob, request, callback); + }, "name", { value: "CreateTuningJob" }); + + /** + * Calls CreateTuningJob. + * @function createTuningJob + * @memberof google.cloud.aiplatform.v1beta1.GenAiTuningService + * @instance + * @param {google.cloud.aiplatform.v1beta1.ICreateTuningJobRequest} request CreateTuningJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.aiplatform.v1beta1.GenAiTuningService|getTuningJob}. + * @memberof google.cloud.aiplatform.v1beta1.GenAiTuningService + * @typedef GetTuningJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1beta1.TuningJob} [response] TuningJob + */ + + /** + * Calls GetTuningJob. + * @function getTuningJob + * @memberof google.cloud.aiplatform.v1beta1.GenAiTuningService + * @instance + * @param {google.cloud.aiplatform.v1beta1.IGetTuningJobRequest} request GetTuningJobRequest message or plain object + * @param {google.cloud.aiplatform.v1beta1.GenAiTuningService.GetTuningJobCallback} callback Node-style callback called with the error, if any, and TuningJob + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GenAiTuningService.prototype.getTuningJob = function getTuningJob(request, callback) { + return this.rpcCall(getTuningJob, $root.google.cloud.aiplatform.v1beta1.GetTuningJobRequest, $root.google.cloud.aiplatform.v1beta1.TuningJob, request, callback); + }, "name", { value: "GetTuningJob" }); + + /** + * Calls GetTuningJob. + * @function getTuningJob + * @memberof google.cloud.aiplatform.v1beta1.GenAiTuningService + * @instance + * @param {google.cloud.aiplatform.v1beta1.IGetTuningJobRequest} request GetTuningJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.aiplatform.v1beta1.GenAiTuningService|listTuningJobs}. + * @memberof google.cloud.aiplatform.v1beta1.GenAiTuningService + * @typedef ListTuningJobsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1beta1.ListTuningJobsResponse} [response] ListTuningJobsResponse + */ + + /** + * Calls ListTuningJobs. + * @function listTuningJobs + * @memberof google.cloud.aiplatform.v1beta1.GenAiTuningService + * @instance + * @param {google.cloud.aiplatform.v1beta1.IListTuningJobsRequest} request ListTuningJobsRequest message or plain object + * @param {google.cloud.aiplatform.v1beta1.GenAiTuningService.ListTuningJobsCallback} callback Node-style callback called with the error, if any, and ListTuningJobsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GenAiTuningService.prototype.listTuningJobs = function listTuningJobs(request, callback) { + return this.rpcCall(listTuningJobs, $root.google.cloud.aiplatform.v1beta1.ListTuningJobsRequest, $root.google.cloud.aiplatform.v1beta1.ListTuningJobsResponse, request, callback); + }, "name", { value: "ListTuningJobs" }); + + /** + * Calls ListTuningJobs. + * @function listTuningJobs + * @memberof google.cloud.aiplatform.v1beta1.GenAiTuningService + * @instance + * @param {google.cloud.aiplatform.v1beta1.IListTuningJobsRequest} request ListTuningJobsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.aiplatform.v1beta1.GenAiTuningService|cancelTuningJob}. + * @memberof google.cloud.aiplatform.v1beta1.GenAiTuningService + * @typedef CancelTuningJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelTuningJob. + * @function cancelTuningJob + * @memberof google.cloud.aiplatform.v1beta1.GenAiTuningService + * @instance + * @param {google.cloud.aiplatform.v1beta1.ICancelTuningJobRequest} request CancelTuningJobRequest message or plain object + * @param {google.cloud.aiplatform.v1beta1.GenAiTuningService.CancelTuningJobCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GenAiTuningService.prototype.cancelTuningJob = function cancelTuningJob(request, callback) { + return this.rpcCall(cancelTuningJob, $root.google.cloud.aiplatform.v1beta1.CancelTuningJobRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelTuningJob" }); + + /** + * Calls CancelTuningJob. + * @function cancelTuningJob + * @memberof google.cloud.aiplatform.v1beta1.GenAiTuningService + * @instance + * @param {google.cloud.aiplatform.v1beta1.ICancelTuningJobRequest} request CancelTuningJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return GenAiTuningService; + })(); + + v1beta1.CreateTuningJobRequest = (function() { + + /** + * Properties of a CreateTuningJobRequest. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface ICreateTuningJobRequest + * @property {string|null} [parent] CreateTuningJobRequest parent + * @property {google.cloud.aiplatform.v1beta1.ITuningJob|null} [tuningJob] CreateTuningJobRequest tuningJob + */ + + /** + * Constructs a new CreateTuningJobRequest. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a CreateTuningJobRequest. + * @implements ICreateTuningJobRequest + * @constructor + * @param {google.cloud.aiplatform.v1beta1.ICreateTuningJobRequest=} [properties] Properties to set + */ + function CreateTuningJobRequest(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]]; + } + + /** + * CreateTuningJobRequest parent. + * @member {string} parent + * @memberof google.cloud.aiplatform.v1beta1.CreateTuningJobRequest + * @instance + */ + CreateTuningJobRequest.prototype.parent = ""; + + /** + * CreateTuningJobRequest tuningJob. + * @member {google.cloud.aiplatform.v1beta1.ITuningJob|null|undefined} tuningJob + * @memberof google.cloud.aiplatform.v1beta1.CreateTuningJobRequest + * @instance + */ + CreateTuningJobRequest.prototype.tuningJob = null; + + /** + * Creates a new CreateTuningJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.CreateTuningJobRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.ICreateTuningJobRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.CreateTuningJobRequest} CreateTuningJobRequest instance + */ + CreateTuningJobRequest.create = function create(properties) { + return new CreateTuningJobRequest(properties); + }; + + /** + * Encodes the specified CreateTuningJobRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.CreateTuningJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.CreateTuningJobRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.ICreateTuningJobRequest} message CreateTuningJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTuningJobRequest.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.tuningJob != null && Object.hasOwnProperty.call(message, "tuningJob")) + $root.google.cloud.aiplatform.v1beta1.TuningJob.encode(message.tuningJob, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateTuningJobRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.CreateTuningJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.CreateTuningJobRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.ICreateTuningJobRequest} message CreateTuningJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTuningJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTuningJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.CreateTuningJobRequest + * @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.CreateTuningJobRequest} CreateTuningJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTuningJobRequest.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.CreateTuningJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.tuningJob = $root.google.cloud.aiplatform.v1beta1.TuningJob.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTuningJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.CreateTuningJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.CreateTuningJobRequest} CreateTuningJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTuningJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTuningJobRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.CreateTuningJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTuningJobRequest.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.tuningJob != null && message.hasOwnProperty("tuningJob")) { + var error = $root.google.cloud.aiplatform.v1beta1.TuningJob.verify(message.tuningJob); + if (error) + return "tuningJob." + error; + } + return null; + }; + + /** + * Creates a CreateTuningJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.CreateTuningJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.CreateTuningJobRequest} CreateTuningJobRequest + */ + CreateTuningJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.CreateTuningJobRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.CreateTuningJobRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.tuningJob != null) { + if (typeof object.tuningJob !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.CreateTuningJobRequest.tuningJob: object expected"); + message.tuningJob = $root.google.cloud.aiplatform.v1beta1.TuningJob.fromObject(object.tuningJob); + } + return message; + }; + + /** + * Creates a plain object from a CreateTuningJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.CreateTuningJobRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.CreateTuningJobRequest} message CreateTuningJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTuningJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.tuningJob = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.tuningJob != null && message.hasOwnProperty("tuningJob")) + object.tuningJob = $root.google.cloud.aiplatform.v1beta1.TuningJob.toObject(message.tuningJob, options); + return object; + }; + + /** + * Converts this CreateTuningJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.CreateTuningJobRequest + * @instance + * @returns {Object.} JSON object + */ + CreateTuningJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTuningJobRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.CreateTuningJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTuningJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.CreateTuningJobRequest"; + }; + + return CreateTuningJobRequest; + })(); + + v1beta1.GetTuningJobRequest = (function() { + + /** + * Properties of a GetTuningJobRequest. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IGetTuningJobRequest + * @property {string|null} [name] GetTuningJobRequest name + */ + + /** + * Constructs a new GetTuningJobRequest. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a GetTuningJobRequest. + * @implements IGetTuningJobRequest + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IGetTuningJobRequest=} [properties] Properties to set + */ + function GetTuningJobRequest(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]]; + } + + /** + * GetTuningJobRequest name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1beta1.GetTuningJobRequest + * @instance + */ + GetTuningJobRequest.prototype.name = ""; + + /** + * Creates a new GetTuningJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.GetTuningJobRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IGetTuningJobRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.GetTuningJobRequest} GetTuningJobRequest instance + */ + GetTuningJobRequest.create = function create(properties) { + return new GetTuningJobRequest(properties); + }; + + /** + * Encodes the specified GetTuningJobRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.GetTuningJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.GetTuningJobRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IGetTuningJobRequest} message GetTuningJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTuningJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetTuningJobRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.GetTuningJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.GetTuningJobRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IGetTuningJobRequest} message GetTuningJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTuningJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTuningJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.GetTuningJobRequest + * @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.GetTuningJobRequest} GetTuningJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTuningJobRequest.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.GetTuningJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTuningJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.GetTuningJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.GetTuningJobRequest} GetTuningJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTuningJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTuningJobRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.GetTuningJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTuningJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetTuningJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.GetTuningJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.GetTuningJobRequest} GetTuningJobRequest + */ + GetTuningJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.GetTuningJobRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.GetTuningJobRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetTuningJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.GetTuningJobRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.GetTuningJobRequest} message GetTuningJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTuningJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetTuningJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.GetTuningJobRequest + * @instance + * @returns {Object.} JSON object + */ + GetTuningJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTuningJobRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.GetTuningJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTuningJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.GetTuningJobRequest"; + }; + + return GetTuningJobRequest; + })(); + + v1beta1.ListTuningJobsRequest = (function() { + + /** + * Properties of a ListTuningJobsRequest. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IListTuningJobsRequest + * @property {string|null} [parent] ListTuningJobsRequest parent + * @property {string|null} [filter] ListTuningJobsRequest filter + * @property {number|null} [pageSize] ListTuningJobsRequest pageSize + * @property {string|null} [pageToken] ListTuningJobsRequest pageToken + */ + + /** + * Constructs a new ListTuningJobsRequest. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a ListTuningJobsRequest. + * @implements IListTuningJobsRequest + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IListTuningJobsRequest=} [properties] Properties to set + */ + function ListTuningJobsRequest(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]]; + } + + /** + * ListTuningJobsRequest parent. + * @member {string} parent + * @memberof google.cloud.aiplatform.v1beta1.ListTuningJobsRequest + * @instance + */ + ListTuningJobsRequest.prototype.parent = ""; + + /** + * ListTuningJobsRequest filter. + * @member {string} filter + * @memberof google.cloud.aiplatform.v1beta1.ListTuningJobsRequest + * @instance + */ + ListTuningJobsRequest.prototype.filter = ""; + + /** + * ListTuningJobsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.aiplatform.v1beta1.ListTuningJobsRequest + * @instance + */ + ListTuningJobsRequest.prototype.pageSize = 0; + + /** + * ListTuningJobsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.aiplatform.v1beta1.ListTuningJobsRequest + * @instance + */ + ListTuningJobsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListTuningJobsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.ListTuningJobsRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IListTuningJobsRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.ListTuningJobsRequest} ListTuningJobsRequest instance + */ + ListTuningJobsRequest.create = function create(properties) { + return new ListTuningJobsRequest(properties); + }; + + /** + * Encodes the specified ListTuningJobsRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ListTuningJobsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.ListTuningJobsRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IListTuningJobsRequest} message ListTuningJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTuningJobsRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListTuningJobsRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ListTuningJobsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.ListTuningJobsRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IListTuningJobsRequest} message ListTuningJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTuningJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTuningJobsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.ListTuningJobsRequest + * @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.ListTuningJobsRequest} ListTuningJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTuningJobsRequest.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.ListTuningJobsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTuningJobsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.ListTuningJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.ListTuningJobsRequest} ListTuningJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTuningJobsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTuningJobsRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.ListTuningJobsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTuningJobsRequest.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.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListTuningJobsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.ListTuningJobsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.ListTuningJobsRequest} ListTuningJobsRequest + */ + ListTuningJobsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.ListTuningJobsRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.ListTuningJobsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListTuningJobsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.ListTuningJobsRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.ListTuningJobsRequest} message ListTuningJobsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTuningJobsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListTuningJobsRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.ListTuningJobsRequest + * @instance + * @returns {Object.} JSON object + */ + ListTuningJobsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTuningJobsRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.ListTuningJobsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTuningJobsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.ListTuningJobsRequest"; + }; + + return ListTuningJobsRequest; + })(); + + v1beta1.ListTuningJobsResponse = (function() { + + /** + * Properties of a ListTuningJobsResponse. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IListTuningJobsResponse + * @property {Array.|null} [tuningJobs] ListTuningJobsResponse tuningJobs + * @property {string|null} [nextPageToken] ListTuningJobsResponse nextPageToken + */ + + /** + * Constructs a new ListTuningJobsResponse. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a ListTuningJobsResponse. + * @implements IListTuningJobsResponse + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IListTuningJobsResponse=} [properties] Properties to set + */ + function ListTuningJobsResponse(properties) { + this.tuningJobs = []; + 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]]; + } + + /** + * ListTuningJobsResponse tuningJobs. + * @member {Array.} tuningJobs + * @memberof google.cloud.aiplatform.v1beta1.ListTuningJobsResponse + * @instance + */ + ListTuningJobsResponse.prototype.tuningJobs = $util.emptyArray; + + /** + * ListTuningJobsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.aiplatform.v1beta1.ListTuningJobsResponse + * @instance + */ + ListTuningJobsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTuningJobsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.ListTuningJobsResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.IListTuningJobsResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.ListTuningJobsResponse} ListTuningJobsResponse instance + */ + ListTuningJobsResponse.create = function create(properties) { + return new ListTuningJobsResponse(properties); + }; + + /** + * Encodes the specified ListTuningJobsResponse message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ListTuningJobsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.ListTuningJobsResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.IListTuningJobsResponse} message ListTuningJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTuningJobsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tuningJobs != null && message.tuningJobs.length) + for (var i = 0; i < message.tuningJobs.length; ++i) + $root.google.cloud.aiplatform.v1beta1.TuningJob.encode(message.tuningJobs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListTuningJobsResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ListTuningJobsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.ListTuningJobsResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.IListTuningJobsResponse} message ListTuningJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTuningJobsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTuningJobsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.ListTuningJobsResponse + * @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.ListTuningJobsResponse} ListTuningJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTuningJobsResponse.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.ListTuningJobsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.tuningJobs && message.tuningJobs.length)) + message.tuningJobs = []; + message.tuningJobs.push($root.google.cloud.aiplatform.v1beta1.TuningJob.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTuningJobsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.ListTuningJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.ListTuningJobsResponse} ListTuningJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTuningJobsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTuningJobsResponse message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.ListTuningJobsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTuningJobsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tuningJobs != null && message.hasOwnProperty("tuningJobs")) { + if (!Array.isArray(message.tuningJobs)) + return "tuningJobs: array expected"; + for (var i = 0; i < message.tuningJobs.length; ++i) { + var error = $root.google.cloud.aiplatform.v1beta1.TuningJob.verify(message.tuningJobs[i]); + if (error) + return "tuningJobs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListTuningJobsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.ListTuningJobsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.ListTuningJobsResponse} ListTuningJobsResponse + */ + ListTuningJobsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.ListTuningJobsResponse) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.ListTuningJobsResponse(); + if (object.tuningJobs) { + if (!Array.isArray(object.tuningJobs)) + throw TypeError(".google.cloud.aiplatform.v1beta1.ListTuningJobsResponse.tuningJobs: array expected"); + message.tuningJobs = []; + for (var i = 0; i < object.tuningJobs.length; ++i) { + if (typeof object.tuningJobs[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.ListTuningJobsResponse.tuningJobs: object expected"); + message.tuningJobs[i] = $root.google.cloud.aiplatform.v1beta1.TuningJob.fromObject(object.tuningJobs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListTuningJobsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.ListTuningJobsResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.ListTuningJobsResponse} message ListTuningJobsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTuningJobsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tuningJobs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.tuningJobs && message.tuningJobs.length) { + object.tuningJobs = []; + for (var j = 0; j < message.tuningJobs.length; ++j) + object.tuningJobs[j] = $root.google.cloud.aiplatform.v1beta1.TuningJob.toObject(message.tuningJobs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListTuningJobsResponse to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.ListTuningJobsResponse + * @instance + * @returns {Object.} JSON object + */ + ListTuningJobsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTuningJobsResponse + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.ListTuningJobsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTuningJobsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.ListTuningJobsResponse"; + }; + + return ListTuningJobsResponse; + })(); + + v1beta1.CancelTuningJobRequest = (function() { + + /** + * Properties of a CancelTuningJobRequest. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface ICancelTuningJobRequest + * @property {string|null} [name] CancelTuningJobRequest name + */ + + /** + * Constructs a new CancelTuningJobRequest. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a CancelTuningJobRequest. + * @implements ICancelTuningJobRequest + * @constructor + * @param {google.cloud.aiplatform.v1beta1.ICancelTuningJobRequest=} [properties] Properties to set + */ + function CancelTuningJobRequest(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]]; + } + + /** + * CancelTuningJobRequest name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1beta1.CancelTuningJobRequest + * @instance + */ + CancelTuningJobRequest.prototype.name = ""; + + /** + * Creates a new CancelTuningJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.CancelTuningJobRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.ICancelTuningJobRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.CancelTuningJobRequest} CancelTuningJobRequest instance + */ + CancelTuningJobRequest.create = function create(properties) { + return new CancelTuningJobRequest(properties); + }; + + /** + * Encodes the specified CancelTuningJobRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.CancelTuningJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.CancelTuningJobRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.ICancelTuningJobRequest} message CancelTuningJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelTuningJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelTuningJobRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.CancelTuningJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.CancelTuningJobRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.ICancelTuningJobRequest} message CancelTuningJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelTuningJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelTuningJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.CancelTuningJobRequest + * @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.CancelTuningJobRequest} CancelTuningJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelTuningJobRequest.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.CancelTuningJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelTuningJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.CancelTuningJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.CancelTuningJobRequest} CancelTuningJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelTuningJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelTuningJobRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.CancelTuningJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelTuningJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelTuningJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.CancelTuningJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.CancelTuningJobRequest} CancelTuningJobRequest + */ + CancelTuningJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.CancelTuningJobRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.CancelTuningJobRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelTuningJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.CancelTuningJobRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.CancelTuningJobRequest} message CancelTuningJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelTuningJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelTuningJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.CancelTuningJobRequest + * @instance + * @returns {Object.} JSON object + */ + CancelTuningJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelTuningJobRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.CancelTuningJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelTuningJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.CancelTuningJobRequest"; + }; + + return CancelTuningJobRequest; + })(); + + v1beta1.TuningJob = (function() { + + /** + * Properties of a TuningJob. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface ITuningJob + * @property {string|null} [baseModel] TuningJob baseModel + * @property {google.cloud.aiplatform.v1beta1.ISupervisedTuningSpec|null} [supervisedTuningSpec] TuningJob supervisedTuningSpec + * @property {string|null} [name] TuningJob name + * @property {string|null} [tunedModelDisplayName] TuningJob tunedModelDisplayName + * @property {string|null} [description] TuningJob description + * @property {google.cloud.aiplatform.v1beta1.JobState|null} [state] TuningJob state + * @property {google.protobuf.ITimestamp|null} [createTime] TuningJob createTime + * @property {google.protobuf.ITimestamp|null} [startTime] TuningJob startTime + * @property {google.protobuf.ITimestamp|null} [endTime] TuningJob endTime + * @property {google.protobuf.ITimestamp|null} [updateTime] TuningJob updateTime + * @property {google.rpc.IStatus|null} [error] TuningJob error + * @property {Object.|null} [labels] TuningJob labels + * @property {string|null} [experiment] TuningJob experiment + * @property {google.cloud.aiplatform.v1beta1.ITunedModel|null} [tunedModel] TuningJob tunedModel + * @property {google.cloud.aiplatform.v1beta1.ITuningDataStats|null} [tuningDataStats] TuningJob tuningDataStats + * @property {google.cloud.aiplatform.v1beta1.IEncryptionSpec|null} [encryptionSpec] TuningJob encryptionSpec + */ + + /** + * Constructs a new TuningJob. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a TuningJob. + * @implements ITuningJob + * @constructor + * @param {google.cloud.aiplatform.v1beta1.ITuningJob=} [properties] Properties to set + */ + function TuningJob(properties) { + this.labels = {}; + 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]]; + } + + /** + * TuningJob baseModel. + * @member {string|null|undefined} baseModel + * @memberof google.cloud.aiplatform.v1beta1.TuningJob + * @instance + */ + TuningJob.prototype.baseModel = null; + + /** + * TuningJob supervisedTuningSpec. + * @member {google.cloud.aiplatform.v1beta1.ISupervisedTuningSpec|null|undefined} supervisedTuningSpec + * @memberof google.cloud.aiplatform.v1beta1.TuningJob + * @instance + */ + TuningJob.prototype.supervisedTuningSpec = null; + + /** + * TuningJob name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1beta1.TuningJob + * @instance + */ + TuningJob.prototype.name = ""; + + /** + * TuningJob tunedModelDisplayName. + * @member {string} tunedModelDisplayName + * @memberof google.cloud.aiplatform.v1beta1.TuningJob + * @instance + */ + TuningJob.prototype.tunedModelDisplayName = ""; + + /** + * TuningJob description. + * @member {string} description + * @memberof google.cloud.aiplatform.v1beta1.TuningJob + * @instance + */ + TuningJob.prototype.description = ""; + + /** + * TuningJob state. + * @member {google.cloud.aiplatform.v1beta1.JobState} state + * @memberof google.cloud.aiplatform.v1beta1.TuningJob + * @instance + */ + TuningJob.prototype.state = 0; + + /** + * TuningJob createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.aiplatform.v1beta1.TuningJob + * @instance + */ + TuningJob.prototype.createTime = null; + + /** + * TuningJob startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.aiplatform.v1beta1.TuningJob + * @instance + */ + TuningJob.prototype.startTime = null; + + /** + * TuningJob endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.aiplatform.v1beta1.TuningJob + * @instance + */ + TuningJob.prototype.endTime = null; + + /** + * TuningJob updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.aiplatform.v1beta1.TuningJob + * @instance + */ + TuningJob.prototype.updateTime = null; + + /** + * TuningJob error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.aiplatform.v1beta1.TuningJob + * @instance + */ + TuningJob.prototype.error = null; + + /** + * TuningJob labels. + * @member {Object.} labels + * @memberof google.cloud.aiplatform.v1beta1.TuningJob + * @instance + */ + TuningJob.prototype.labels = $util.emptyObject; + + /** + * TuningJob experiment. + * @member {string} experiment + * @memberof google.cloud.aiplatform.v1beta1.TuningJob + * @instance + */ + TuningJob.prototype.experiment = ""; + + /** + * TuningJob tunedModel. + * @member {google.cloud.aiplatform.v1beta1.ITunedModel|null|undefined} tunedModel + * @memberof google.cloud.aiplatform.v1beta1.TuningJob + * @instance + */ + TuningJob.prototype.tunedModel = null; + + /** + * TuningJob tuningDataStats. + * @member {google.cloud.aiplatform.v1beta1.ITuningDataStats|null|undefined} tuningDataStats + * @memberof google.cloud.aiplatform.v1beta1.TuningJob + * @instance + */ + TuningJob.prototype.tuningDataStats = null; + + /** + * TuningJob encryptionSpec. + * @member {google.cloud.aiplatform.v1beta1.IEncryptionSpec|null|undefined} encryptionSpec + * @memberof google.cloud.aiplatform.v1beta1.TuningJob + * @instance + */ + TuningJob.prototype.encryptionSpec = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TuningJob sourceModel. + * @member {"baseModel"|undefined} sourceModel + * @memberof google.cloud.aiplatform.v1beta1.TuningJob + * @instance + */ + Object.defineProperty(TuningJob.prototype, "sourceModel", { + get: $util.oneOfGetter($oneOfFields = ["baseModel"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TuningJob tuningSpec. + * @member {"supervisedTuningSpec"|undefined} tuningSpec + * @memberof google.cloud.aiplatform.v1beta1.TuningJob + * @instance + */ + Object.defineProperty(TuningJob.prototype, "tuningSpec", { + get: $util.oneOfGetter($oneOfFields = ["supervisedTuningSpec"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TuningJob instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.TuningJob + * @static + * @param {google.cloud.aiplatform.v1beta1.ITuningJob=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.TuningJob} TuningJob instance + */ + TuningJob.create = function create(properties) { + return new TuningJob(properties); + }; + + /** + * Encodes the specified TuningJob message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.TuningJob.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.TuningJob + * @static + * @param {google.cloud.aiplatform.v1beta1.ITuningJob} message TuningJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TuningJob.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.tunedModelDisplayName != null && Object.hasOwnProperty.call(message, "tunedModelDisplayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tunedModelDisplayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.baseModel != null && Object.hasOwnProperty.call(message, "baseModel")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.baseModel); + if (message.supervisedTuningSpec != null && Object.hasOwnProperty.call(message, "supervisedTuningSpec")) + $root.google.cloud.aiplatform.v1beta1.SupervisedTuningSpec.encode(message.supervisedTuningSpec, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 12, wireType 2 =*/98).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.experiment != null && Object.hasOwnProperty.call(message, "experiment")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.experiment); + if (message.tunedModel != null && Object.hasOwnProperty.call(message, "tunedModel")) + $root.google.cloud.aiplatform.v1beta1.TunedModel.encode(message.tunedModel, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.tuningDataStats != null && Object.hasOwnProperty.call(message, "tuningDataStats")) + $root.google.cloud.aiplatform.v1beta1.TuningDataStats.encode(message.tuningDataStats, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.encryptionSpec != null && Object.hasOwnProperty.call(message, "encryptionSpec")) + $root.google.cloud.aiplatform.v1beta1.EncryptionSpec.encode(message.encryptionSpec, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TuningJob message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.TuningJob.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.TuningJob + * @static + * @param {google.cloud.aiplatform.v1beta1.ITuningJob} message TuningJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TuningJob.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TuningJob message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.TuningJob + * @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.TuningJob} TuningJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TuningJob.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.TuningJob(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.baseModel = reader.string(); + break; + } + case 5: { + message.supervisedTuningSpec = $root.google.cloud.aiplatform.v1beta1.SupervisedTuningSpec.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.tunedModelDisplayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 6: { + message.state = reader.int32(); + break; + } + case 7: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 12: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 13: { + message.experiment = reader.string(); + break; + } + case 14: { + message.tunedModel = $root.google.cloud.aiplatform.v1beta1.TunedModel.decode(reader, reader.uint32()); + break; + } + case 15: { + message.tuningDataStats = $root.google.cloud.aiplatform.v1beta1.TuningDataStats.decode(reader, reader.uint32()); + break; + } + case 16: { + message.encryptionSpec = $root.google.cloud.aiplatform.v1beta1.EncryptionSpec.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TuningJob message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.TuningJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.TuningJob} TuningJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TuningJob.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TuningJob message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.TuningJob + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TuningJob.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.baseModel != null && message.hasOwnProperty("baseModel")) { + properties.sourceModel = 1; + if (!$util.isString(message.baseModel)) + return "baseModel: string expected"; + } + if (message.supervisedTuningSpec != null && message.hasOwnProperty("supervisedTuningSpec")) { + properties.tuningSpec = 1; + { + var error = $root.google.cloud.aiplatform.v1beta1.SupervisedTuningSpec.verify(message.supervisedTuningSpec); + if (error) + return "supervisedTuningSpec." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.tunedModelDisplayName != null && message.hasOwnProperty("tunedModelDisplayName")) + if (!$util.isString(message.tunedModelDisplayName)) + return "tunedModelDisplayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.experiment != null && message.hasOwnProperty("experiment")) + if (!$util.isString(message.experiment)) + return "experiment: string expected"; + if (message.tunedModel != null && message.hasOwnProperty("tunedModel")) { + var error = $root.google.cloud.aiplatform.v1beta1.TunedModel.verify(message.tunedModel); + if (error) + return "tunedModel." + error; + } + if (message.tuningDataStats != null && message.hasOwnProperty("tuningDataStats")) { + var error = $root.google.cloud.aiplatform.v1beta1.TuningDataStats.verify(message.tuningDataStats); + if (error) + return "tuningDataStats." + error; + } + if (message.encryptionSpec != null && message.hasOwnProperty("encryptionSpec")) { + var error = $root.google.cloud.aiplatform.v1beta1.EncryptionSpec.verify(message.encryptionSpec); + if (error) + return "encryptionSpec." + error; + } + return null; + }; + + /** + * Creates a TuningJob message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.TuningJob + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.TuningJob} TuningJob + */ + TuningJob.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.TuningJob) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.TuningJob(); + if (object.baseModel != null) + message.baseModel = String(object.baseModel); + if (object.supervisedTuningSpec != null) { + if (typeof object.supervisedTuningSpec !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.TuningJob.supervisedTuningSpec: object expected"); + message.supervisedTuningSpec = $root.google.cloud.aiplatform.v1beta1.SupervisedTuningSpec.fromObject(object.supervisedTuningSpec); + } + if (object.name != null) + message.name = String(object.name); + if (object.tunedModelDisplayName != null) + message.tunedModelDisplayName = String(object.tunedModelDisplayName); + if (object.description != null) + message.description = String(object.description); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "JOB_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "JOB_STATE_QUEUED": + case 1: + message.state = 1; + break; + case "JOB_STATE_PENDING": + case 2: + message.state = 2; + break; + case "JOB_STATE_RUNNING": + case 3: + message.state = 3; + break; + case "JOB_STATE_SUCCEEDED": + case 4: + message.state = 4; + break; + case "JOB_STATE_FAILED": + case 5: + message.state = 5; + break; + case "JOB_STATE_CANCELLING": + case 6: + message.state = 6; + break; + case "JOB_STATE_CANCELLED": + case 7: + message.state = 7; + break; + case "JOB_STATE_PAUSED": + case 8: + message.state = 8; + break; + case "JOB_STATE_EXPIRED": + case 9: + message.state = 9; + break; + case "JOB_STATE_UPDATING": + case 10: + message.state = 10; + break; + case "JOB_STATE_PARTIALLY_SUCCEEDED": + case 11: + message.state = 11; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.TuningJob.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.TuningJob.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.TuningJob.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.TuningJob.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.TuningJob.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.TuningJob.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.experiment != null) + message.experiment = String(object.experiment); + if (object.tunedModel != null) { + if (typeof object.tunedModel !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.TuningJob.tunedModel: object expected"); + message.tunedModel = $root.google.cloud.aiplatform.v1beta1.TunedModel.fromObject(object.tunedModel); + } + if (object.tuningDataStats != null) { + if (typeof object.tuningDataStats !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.TuningJob.tuningDataStats: object expected"); + message.tuningDataStats = $root.google.cloud.aiplatform.v1beta1.TuningDataStats.fromObject(object.tuningDataStats); + } + if (object.encryptionSpec != null) { + if (typeof object.encryptionSpec !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.TuningJob.encryptionSpec: object expected"); + message.encryptionSpec = $root.google.cloud.aiplatform.v1beta1.EncryptionSpec.fromObject(object.encryptionSpec); + } + return message; + }; + + /** + * Creates a plain object from a TuningJob message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.TuningJob + * @static + * @param {google.cloud.aiplatform.v1beta1.TuningJob} message TuningJob + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TuningJob.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.tunedModelDisplayName = ""; + object.description = ""; + object.state = options.enums === String ? "JOB_STATE_UNSPECIFIED" : 0; + object.createTime = null; + object.startTime = null; + object.endTime = null; + object.updateTime = null; + object.error = null; + object.experiment = ""; + object.tunedModel = null; + object.tuningDataStats = null; + object.encryptionSpec = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.tunedModelDisplayName != null && message.hasOwnProperty("tunedModelDisplayName")) + object.tunedModelDisplayName = message.tunedModelDisplayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.baseModel != null && message.hasOwnProperty("baseModel")) { + object.baseModel = message.baseModel; + if (options.oneofs) + object.sourceModel = "baseModel"; + } + if (message.supervisedTuningSpec != null && message.hasOwnProperty("supervisedTuningSpec")) { + object.supervisedTuningSpec = $root.google.cloud.aiplatform.v1beta1.SupervisedTuningSpec.toObject(message.supervisedTuningSpec, options); + if (options.oneofs) + object.tuningSpec = "supervisedTuningSpec"; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.aiplatform.v1beta1.JobState[message.state] === undefined ? message.state : $root.google.cloud.aiplatform.v1beta1.JobState[message.state] : message.state; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.experiment != null && message.hasOwnProperty("experiment")) + object.experiment = message.experiment; + if (message.tunedModel != null && message.hasOwnProperty("tunedModel")) + object.tunedModel = $root.google.cloud.aiplatform.v1beta1.TunedModel.toObject(message.tunedModel, options); + if (message.tuningDataStats != null && message.hasOwnProperty("tuningDataStats")) + object.tuningDataStats = $root.google.cloud.aiplatform.v1beta1.TuningDataStats.toObject(message.tuningDataStats, options); + if (message.encryptionSpec != null && message.hasOwnProperty("encryptionSpec")) + object.encryptionSpec = $root.google.cloud.aiplatform.v1beta1.EncryptionSpec.toObject(message.encryptionSpec, options); + return object; + }; + + /** + * Converts this TuningJob to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.TuningJob + * @instance + * @returns {Object.} JSON object + */ + TuningJob.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TuningJob + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.TuningJob + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TuningJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.TuningJob"; + }; + + return TuningJob; + })(); + + v1beta1.TunedModel = (function() { + + /** + * Properties of a TunedModel. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface ITunedModel + * @property {string|null} [model] TunedModel model + * @property {string|null} [endpoint] TunedModel endpoint + */ + + /** + * Constructs a new TunedModel. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a TunedModel. + * @implements ITunedModel + * @constructor + * @param {google.cloud.aiplatform.v1beta1.ITunedModel=} [properties] Properties to set + */ + function TunedModel(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]]; + } + + /** + * TunedModel model. + * @member {string} model + * @memberof google.cloud.aiplatform.v1beta1.TunedModel + * @instance + */ + TunedModel.prototype.model = ""; + + /** + * TunedModel endpoint. + * @member {string} endpoint + * @memberof google.cloud.aiplatform.v1beta1.TunedModel + * @instance + */ + TunedModel.prototype.endpoint = ""; + + /** + * Creates a new TunedModel instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.TunedModel + * @static + * @param {google.cloud.aiplatform.v1beta1.ITunedModel=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.TunedModel} TunedModel instance + */ + TunedModel.create = function create(properties) { + return new TunedModel(properties); + }; + + /** + * Encodes the specified TunedModel message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.TunedModel.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.TunedModel + * @static + * @param {google.cloud.aiplatform.v1beta1.ITunedModel} message TunedModel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TunedModel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + if (message.endpoint != null && Object.hasOwnProperty.call(message, "endpoint")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.endpoint); + return writer; + }; + + /** + * Encodes the specified TunedModel message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.TunedModel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.TunedModel + * @static + * @param {google.cloud.aiplatform.v1beta1.ITunedModel} message TunedModel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TunedModel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TunedModel message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.TunedModel + * @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.TunedModel} TunedModel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TunedModel.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.TunedModel(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + case 2: { + message.endpoint = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TunedModel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.TunedModel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.TunedModel} TunedModel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TunedModel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TunedModel message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.TunedModel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TunedModel.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.endpoint != null && message.hasOwnProperty("endpoint")) + if (!$util.isString(message.endpoint)) + return "endpoint: string expected"; + return null; + }; + + /** + * Creates a TunedModel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.TunedModel + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.TunedModel} TunedModel + */ + TunedModel.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.TunedModel) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.TunedModel(); + if (object.model != null) + message.model = String(object.model); + if (object.endpoint != null) + message.endpoint = String(object.endpoint); + return message; + }; + + /** + * Creates a plain object from a TunedModel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.TunedModel + * @static + * @param {google.cloud.aiplatform.v1beta1.TunedModel} message TunedModel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TunedModel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.model = ""; + object.endpoint = ""; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.endpoint != null && message.hasOwnProperty("endpoint")) + object.endpoint = message.endpoint; + return object; + }; + + /** + * Converts this TunedModel to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.TunedModel + * @instance + * @returns {Object.} JSON object + */ + TunedModel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TunedModel + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.TunedModel + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TunedModel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.TunedModel"; + }; + + return TunedModel; + })(); + + v1beta1.SupervisedTuningDatasetDistribution = (function() { + + /** + * Properties of a SupervisedTuningDatasetDistribution. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface ISupervisedTuningDatasetDistribution + * @property {number|Long|null} [sum] SupervisedTuningDatasetDistribution sum + * @property {number|null} [min] SupervisedTuningDatasetDistribution min + * @property {number|null} [max] SupervisedTuningDatasetDistribution max + * @property {number|null} [mean] SupervisedTuningDatasetDistribution mean + * @property {number|null} [median] SupervisedTuningDatasetDistribution median + * @property {number|null} [p5] SupervisedTuningDatasetDistribution p5 + * @property {number|null} [p95] SupervisedTuningDatasetDistribution p95 + * @property {Array.|null} [buckets] SupervisedTuningDatasetDistribution buckets + */ + + /** + * Constructs a new SupervisedTuningDatasetDistribution. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a SupervisedTuningDatasetDistribution. + * @implements ISupervisedTuningDatasetDistribution + * @constructor + * @param {google.cloud.aiplatform.v1beta1.ISupervisedTuningDatasetDistribution=} [properties] Properties to set + */ + function SupervisedTuningDatasetDistribution(properties) { + this.buckets = []; + 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]]; + } + + /** + * SupervisedTuningDatasetDistribution sum. + * @member {number|Long} sum + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution + * @instance + */ + SupervisedTuningDatasetDistribution.prototype.sum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * SupervisedTuningDatasetDistribution min. + * @member {number} min + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution + * @instance + */ + SupervisedTuningDatasetDistribution.prototype.min = 0; + + /** + * SupervisedTuningDatasetDistribution max. + * @member {number} max + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution + * @instance + */ + SupervisedTuningDatasetDistribution.prototype.max = 0; + + /** + * SupervisedTuningDatasetDistribution mean. + * @member {number} mean + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution + * @instance + */ + SupervisedTuningDatasetDistribution.prototype.mean = 0; + + /** + * SupervisedTuningDatasetDistribution median. + * @member {number} median + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution + * @instance + */ + SupervisedTuningDatasetDistribution.prototype.median = 0; + + /** + * SupervisedTuningDatasetDistribution p5. + * @member {number} p5 + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution + * @instance + */ + SupervisedTuningDatasetDistribution.prototype.p5 = 0; + + /** + * SupervisedTuningDatasetDistribution p95. + * @member {number} p95 + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution + * @instance + */ + SupervisedTuningDatasetDistribution.prototype.p95 = 0; + + /** + * SupervisedTuningDatasetDistribution buckets. + * @member {Array.} buckets + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution + * @instance + */ + SupervisedTuningDatasetDistribution.prototype.buckets = $util.emptyArray; + + /** + * Creates a new SupervisedTuningDatasetDistribution instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution + * @static + * @param {google.cloud.aiplatform.v1beta1.ISupervisedTuningDatasetDistribution=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution} SupervisedTuningDatasetDistribution instance + */ + SupervisedTuningDatasetDistribution.create = function create(properties) { + return new SupervisedTuningDatasetDistribution(properties); + }; + + /** + * Encodes the specified SupervisedTuningDatasetDistribution message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution + * @static + * @param {google.cloud.aiplatform.v1beta1.ISupervisedTuningDatasetDistribution} message SupervisedTuningDatasetDistribution message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SupervisedTuningDatasetDistribution.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sum != null && Object.hasOwnProperty.call(message, "sum")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.sum); + if (message.min != null && Object.hasOwnProperty.call(message, "min")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.min); + if (message.max != null && Object.hasOwnProperty.call(message, "max")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.max); + if (message.mean != null && Object.hasOwnProperty.call(message, "mean")) + writer.uint32(/* id 4, wireType 1 =*/33).double(message.mean); + if (message.median != null && Object.hasOwnProperty.call(message, "median")) + writer.uint32(/* id 5, wireType 1 =*/41).double(message.median); + if (message.p5 != null && Object.hasOwnProperty.call(message, "p5")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.p5); + if (message.p95 != null && Object.hasOwnProperty.call(message, "p95")) + writer.uint32(/* id 7, wireType 1 =*/57).double(message.p95); + if (message.buckets != null && message.buckets.length) + for (var i = 0; i < message.buckets.length; ++i) + $root.google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.DatasetBucket.encode(message.buckets[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SupervisedTuningDatasetDistribution message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution + * @static + * @param {google.cloud.aiplatform.v1beta1.ISupervisedTuningDatasetDistribution} message SupervisedTuningDatasetDistribution message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SupervisedTuningDatasetDistribution.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SupervisedTuningDatasetDistribution message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution + * @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.SupervisedTuningDatasetDistribution} SupervisedTuningDatasetDistribution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SupervisedTuningDatasetDistribution.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.SupervisedTuningDatasetDistribution(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sum = reader.int64(); + break; + } + case 2: { + message.min = reader.double(); + break; + } + case 3: { + message.max = reader.double(); + break; + } + case 4: { + message.mean = reader.double(); + break; + } + case 5: { + message.median = reader.double(); + break; + } + case 6: { + message.p5 = reader.double(); + break; + } + case 7: { + message.p95 = reader.double(); + break; + } + case 8: { + if (!(message.buckets && message.buckets.length)) + message.buckets = []; + message.buckets.push($root.google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.DatasetBucket.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SupervisedTuningDatasetDistribution message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution} SupervisedTuningDatasetDistribution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SupervisedTuningDatasetDistribution.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SupervisedTuningDatasetDistribution message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SupervisedTuningDatasetDistribution.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sum != null && message.hasOwnProperty("sum")) + if (!$util.isInteger(message.sum) && !(message.sum && $util.isInteger(message.sum.low) && $util.isInteger(message.sum.high))) + return "sum: integer|Long expected"; + if (message.min != null && message.hasOwnProperty("min")) + if (typeof message.min !== "number") + return "min: number expected"; + if (message.max != null && message.hasOwnProperty("max")) + if (typeof message.max !== "number") + return "max: number expected"; + if (message.mean != null && message.hasOwnProperty("mean")) + if (typeof message.mean !== "number") + return "mean: number expected"; + if (message.median != null && message.hasOwnProperty("median")) + if (typeof message.median !== "number") + return "median: number expected"; + if (message.p5 != null && message.hasOwnProperty("p5")) + if (typeof message.p5 !== "number") + return "p5: number expected"; + if (message.p95 != null && message.hasOwnProperty("p95")) + if (typeof message.p95 !== "number") + return "p95: number expected"; + if (message.buckets != null && message.hasOwnProperty("buckets")) { + if (!Array.isArray(message.buckets)) + return "buckets: array expected"; + for (var i = 0; i < message.buckets.length; ++i) { + var error = $root.google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.DatasetBucket.verify(message.buckets[i]); + if (error) + return "buckets." + error; + } + } + return null; + }; + + /** + * Creates a SupervisedTuningDatasetDistribution message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution} SupervisedTuningDatasetDistribution + */ + SupervisedTuningDatasetDistribution.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution(); + if (object.sum != null) + if ($util.Long) + (message.sum = $util.Long.fromValue(object.sum)).unsigned = false; + else if (typeof object.sum === "string") + message.sum = parseInt(object.sum, 10); + else if (typeof object.sum === "number") + message.sum = object.sum; + else if (typeof object.sum === "object") + message.sum = new $util.LongBits(object.sum.low >>> 0, object.sum.high >>> 0).toNumber(); + if (object.min != null) + message.min = Number(object.min); + if (object.max != null) + message.max = Number(object.max); + if (object.mean != null) + message.mean = Number(object.mean); + if (object.median != null) + message.median = Number(object.median); + if (object.p5 != null) + message.p5 = Number(object.p5); + if (object.p95 != null) + message.p95 = Number(object.p95); + if (object.buckets) { + if (!Array.isArray(object.buckets)) + throw TypeError(".google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.buckets: array expected"); + message.buckets = []; + for (var i = 0; i < object.buckets.length; ++i) { + if (typeof object.buckets[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.buckets: object expected"); + message.buckets[i] = $root.google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.DatasetBucket.fromObject(object.buckets[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SupervisedTuningDatasetDistribution message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution + * @static + * @param {google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution} message SupervisedTuningDatasetDistribution + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SupervisedTuningDatasetDistribution.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.buckets = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.sum = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sum = options.longs === String ? "0" : 0; + object.min = 0; + object.max = 0; + object.mean = 0; + object.median = 0; + object.p5 = 0; + object.p95 = 0; + } + if (message.sum != null && message.hasOwnProperty("sum")) + if (typeof message.sum === "number") + object.sum = options.longs === String ? String(message.sum) : message.sum; + else + object.sum = options.longs === String ? $util.Long.prototype.toString.call(message.sum) : options.longs === Number ? new $util.LongBits(message.sum.low >>> 0, message.sum.high >>> 0).toNumber() : message.sum; + if (message.min != null && message.hasOwnProperty("min")) + object.min = options.json && !isFinite(message.min) ? String(message.min) : message.min; + if (message.max != null && message.hasOwnProperty("max")) + object.max = options.json && !isFinite(message.max) ? String(message.max) : message.max; + if (message.mean != null && message.hasOwnProperty("mean")) + object.mean = options.json && !isFinite(message.mean) ? String(message.mean) : message.mean; + if (message.median != null && message.hasOwnProperty("median")) + object.median = options.json && !isFinite(message.median) ? String(message.median) : message.median; + if (message.p5 != null && message.hasOwnProperty("p5")) + object.p5 = options.json && !isFinite(message.p5) ? String(message.p5) : message.p5; + if (message.p95 != null && message.hasOwnProperty("p95")) + object.p95 = options.json && !isFinite(message.p95) ? String(message.p95) : message.p95; + if (message.buckets && message.buckets.length) { + object.buckets = []; + for (var j = 0; j < message.buckets.length; ++j) + object.buckets[j] = $root.google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.DatasetBucket.toObject(message.buckets[j], options); + } + return object; + }; + + /** + * Converts this SupervisedTuningDatasetDistribution to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution + * @instance + * @returns {Object.} JSON object + */ + SupervisedTuningDatasetDistribution.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SupervisedTuningDatasetDistribution + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SupervisedTuningDatasetDistribution.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution"; + }; + + SupervisedTuningDatasetDistribution.DatasetBucket = (function() { + + /** + * Properties of a DatasetBucket. + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution + * @interface IDatasetBucket + * @property {number|null} [count] DatasetBucket count + * @property {number|null} [left] DatasetBucket left + * @property {number|null} [right] DatasetBucket right + */ + + /** + * Constructs a new DatasetBucket. + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution + * @classdesc Represents a DatasetBucket. + * @implements IDatasetBucket + * @constructor + * @param {google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.IDatasetBucket=} [properties] Properties to set + */ + function DatasetBucket(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]]; + } + + /** + * DatasetBucket count. + * @member {number} count + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.DatasetBucket + * @instance + */ + DatasetBucket.prototype.count = 0; + + /** + * DatasetBucket left. + * @member {number} left + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.DatasetBucket + * @instance + */ + DatasetBucket.prototype.left = 0; + + /** + * DatasetBucket right. + * @member {number} right + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.DatasetBucket + * @instance + */ + DatasetBucket.prototype.right = 0; + + /** + * Creates a new DatasetBucket instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.DatasetBucket + * @static + * @param {google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.IDatasetBucket=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.DatasetBucket} DatasetBucket instance + */ + DatasetBucket.create = function create(properties) { + return new DatasetBucket(properties); + }; + + /** + * Encodes the specified DatasetBucket message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.DatasetBucket.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.DatasetBucket + * @static + * @param {google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.IDatasetBucket} message DatasetBucket message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatasetBucket.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.count); + if (message.left != null && Object.hasOwnProperty.call(message, "left")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.left); + if (message.right != null && Object.hasOwnProperty.call(message, "right")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.right); + return writer; + }; + + /** + * Encodes the specified DatasetBucket message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.DatasetBucket.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.DatasetBucket + * @static + * @param {google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.IDatasetBucket} message DatasetBucket message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatasetBucket.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DatasetBucket message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.DatasetBucket + * @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.SupervisedTuningDatasetDistribution.DatasetBucket} DatasetBucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatasetBucket.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.SupervisedTuningDatasetDistribution.DatasetBucket(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.count = reader.double(); + break; + } + case 2: { + message.left = reader.double(); + break; + } + case 3: { + message.right = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DatasetBucket message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.DatasetBucket + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.DatasetBucket} DatasetBucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatasetBucket.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DatasetBucket message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.DatasetBucket + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DatasetBucket.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count !== "number") + return "count: number expected"; + if (message.left != null && message.hasOwnProperty("left")) + if (typeof message.left !== "number") + return "left: number expected"; + if (message.right != null && message.hasOwnProperty("right")) + if (typeof message.right !== "number") + return "right: number expected"; + return null; + }; + + /** + * Creates a DatasetBucket message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.DatasetBucket + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.DatasetBucket} DatasetBucket + */ + DatasetBucket.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.DatasetBucket) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.DatasetBucket(); + if (object.count != null) + message.count = Number(object.count); + if (object.left != null) + message.left = Number(object.left); + if (object.right != null) + message.right = Number(object.right); + return message; + }; + + /** + * Creates a plain object from a DatasetBucket message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.DatasetBucket + * @static + * @param {google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.DatasetBucket} message DatasetBucket + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DatasetBucket.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.count = 0; + object.left = 0; + object.right = 0; + } + if (message.count != null && message.hasOwnProperty("count")) + object.count = options.json && !isFinite(message.count) ? String(message.count) : message.count; + if (message.left != null && message.hasOwnProperty("left")) + object.left = options.json && !isFinite(message.left) ? String(message.left) : message.left; + if (message.right != null && message.hasOwnProperty("right")) + object.right = options.json && !isFinite(message.right) ? String(message.right) : message.right; + return object; + }; + + /** + * Converts this DatasetBucket to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.DatasetBucket + * @instance + * @returns {Object.} JSON object + */ + DatasetBucket.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DatasetBucket + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.DatasetBucket + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DatasetBucket.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.DatasetBucket"; + }; + + return DatasetBucket; + })(); + + return SupervisedTuningDatasetDistribution; + })(); + + v1beta1.SupervisedTuningDataStats = (function() { + + /** + * Properties of a SupervisedTuningDataStats. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface ISupervisedTuningDataStats + * @property {number|Long|null} [tuningDatasetExampleCount] SupervisedTuningDataStats tuningDatasetExampleCount + * @property {number|Long|null} [totalTuningCharacterCount] SupervisedTuningDataStats totalTuningCharacterCount + * @property {number|Long|null} [totalBillableCharacterCount] SupervisedTuningDataStats totalBillableCharacterCount + * @property {number|Long|null} [tuningStepCount] SupervisedTuningDataStats tuningStepCount + * @property {google.cloud.aiplatform.v1beta1.ISupervisedTuningDatasetDistribution|null} [userInputTokenDistribution] SupervisedTuningDataStats userInputTokenDistribution + * @property {google.cloud.aiplatform.v1beta1.ISupervisedTuningDatasetDistribution|null} [userOutputTokenDistribution] SupervisedTuningDataStats userOutputTokenDistribution + * @property {google.cloud.aiplatform.v1beta1.ISupervisedTuningDatasetDistribution|null} [userMessagePerExampleDistribution] SupervisedTuningDataStats userMessagePerExampleDistribution + * @property {Array.|null} [userDatasetExamples] SupervisedTuningDataStats userDatasetExamples + */ + + /** + * Constructs a new SupervisedTuningDataStats. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a SupervisedTuningDataStats. + * @implements ISupervisedTuningDataStats + * @constructor + * @param {google.cloud.aiplatform.v1beta1.ISupervisedTuningDataStats=} [properties] Properties to set + */ + function SupervisedTuningDataStats(properties) { + this.userDatasetExamples = []; + 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]]; + } + + /** + * SupervisedTuningDataStats tuningDatasetExampleCount. + * @member {number|Long} tuningDatasetExampleCount + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats + * @instance + */ + SupervisedTuningDataStats.prototype.tuningDatasetExampleCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * SupervisedTuningDataStats totalTuningCharacterCount. + * @member {number|Long} totalTuningCharacterCount + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats + * @instance + */ + SupervisedTuningDataStats.prototype.totalTuningCharacterCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * SupervisedTuningDataStats totalBillableCharacterCount. + * @member {number|Long} totalBillableCharacterCount + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats + * @instance + */ + SupervisedTuningDataStats.prototype.totalBillableCharacterCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * SupervisedTuningDataStats tuningStepCount. + * @member {number|Long} tuningStepCount + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats + * @instance + */ + SupervisedTuningDataStats.prototype.tuningStepCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * SupervisedTuningDataStats userInputTokenDistribution. + * @member {google.cloud.aiplatform.v1beta1.ISupervisedTuningDatasetDistribution|null|undefined} userInputTokenDistribution + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats + * @instance + */ + SupervisedTuningDataStats.prototype.userInputTokenDistribution = null; + + /** + * SupervisedTuningDataStats userOutputTokenDistribution. + * @member {google.cloud.aiplatform.v1beta1.ISupervisedTuningDatasetDistribution|null|undefined} userOutputTokenDistribution + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats + * @instance + */ + SupervisedTuningDataStats.prototype.userOutputTokenDistribution = null; + + /** + * SupervisedTuningDataStats userMessagePerExampleDistribution. + * @member {google.cloud.aiplatform.v1beta1.ISupervisedTuningDatasetDistribution|null|undefined} userMessagePerExampleDistribution + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats + * @instance + */ + SupervisedTuningDataStats.prototype.userMessagePerExampleDistribution = null; + + /** + * SupervisedTuningDataStats userDatasetExamples. + * @member {Array.} userDatasetExamples + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats + * @instance + */ + SupervisedTuningDataStats.prototype.userDatasetExamples = $util.emptyArray; + + /** + * Creates a new SupervisedTuningDataStats instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats + * @static + * @param {google.cloud.aiplatform.v1beta1.ISupervisedTuningDataStats=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats} SupervisedTuningDataStats instance + */ + SupervisedTuningDataStats.create = function create(properties) { + return new SupervisedTuningDataStats(properties); + }; + + /** + * Encodes the specified SupervisedTuningDataStats message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats + * @static + * @param {google.cloud.aiplatform.v1beta1.ISupervisedTuningDataStats} message SupervisedTuningDataStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SupervisedTuningDataStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tuningDatasetExampleCount != null && Object.hasOwnProperty.call(message, "tuningDatasetExampleCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.tuningDatasetExampleCount); + if (message.totalTuningCharacterCount != null && Object.hasOwnProperty.call(message, "totalTuningCharacterCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.totalTuningCharacterCount); + if (message.totalBillableCharacterCount != null && Object.hasOwnProperty.call(message, "totalBillableCharacterCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.totalBillableCharacterCount); + if (message.tuningStepCount != null && Object.hasOwnProperty.call(message, "tuningStepCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.tuningStepCount); + if (message.userInputTokenDistribution != null && Object.hasOwnProperty.call(message, "userInputTokenDistribution")) + $root.google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.encode(message.userInputTokenDistribution, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.userOutputTokenDistribution != null && Object.hasOwnProperty.call(message, "userOutputTokenDistribution")) + $root.google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.encode(message.userOutputTokenDistribution, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.userMessagePerExampleDistribution != null && Object.hasOwnProperty.call(message, "userMessagePerExampleDistribution")) + $root.google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.encode(message.userMessagePerExampleDistribution, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.userDatasetExamples != null && message.userDatasetExamples.length) + for (var i = 0; i < message.userDatasetExamples.length; ++i) + $root.google.cloud.aiplatform.v1beta1.Content.encode(message.userDatasetExamples[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SupervisedTuningDataStats message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats + * @static + * @param {google.cloud.aiplatform.v1beta1.ISupervisedTuningDataStats} message SupervisedTuningDataStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SupervisedTuningDataStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SupervisedTuningDataStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats + * @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.SupervisedTuningDataStats} SupervisedTuningDataStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SupervisedTuningDataStats.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.SupervisedTuningDataStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tuningDatasetExampleCount = reader.int64(); + break; + } + case 2: { + message.totalTuningCharacterCount = reader.int64(); + break; + } + case 3: { + message.totalBillableCharacterCount = reader.int64(); + break; + } + case 4: { + message.tuningStepCount = reader.int64(); + break; + } + case 5: { + message.userInputTokenDistribution = $root.google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.decode(reader, reader.uint32()); + break; + } + case 6: { + message.userOutputTokenDistribution = $root.google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.decode(reader, reader.uint32()); + break; + } + case 7: { + message.userMessagePerExampleDistribution = $root.google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.decode(reader, reader.uint32()); + break; + } + case 8: { + if (!(message.userDatasetExamples && message.userDatasetExamples.length)) + message.userDatasetExamples = []; + message.userDatasetExamples.push($root.google.cloud.aiplatform.v1beta1.Content.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SupervisedTuningDataStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats} SupervisedTuningDataStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SupervisedTuningDataStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SupervisedTuningDataStats message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SupervisedTuningDataStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tuningDatasetExampleCount != null && message.hasOwnProperty("tuningDatasetExampleCount")) + if (!$util.isInteger(message.tuningDatasetExampleCount) && !(message.tuningDatasetExampleCount && $util.isInteger(message.tuningDatasetExampleCount.low) && $util.isInteger(message.tuningDatasetExampleCount.high))) + return "tuningDatasetExampleCount: integer|Long expected"; + if (message.totalTuningCharacterCount != null && message.hasOwnProperty("totalTuningCharacterCount")) + if (!$util.isInteger(message.totalTuningCharacterCount) && !(message.totalTuningCharacterCount && $util.isInteger(message.totalTuningCharacterCount.low) && $util.isInteger(message.totalTuningCharacterCount.high))) + return "totalTuningCharacterCount: integer|Long expected"; + if (message.totalBillableCharacterCount != null && message.hasOwnProperty("totalBillableCharacterCount")) + if (!$util.isInteger(message.totalBillableCharacterCount) && !(message.totalBillableCharacterCount && $util.isInteger(message.totalBillableCharacterCount.low) && $util.isInteger(message.totalBillableCharacterCount.high))) + return "totalBillableCharacterCount: integer|Long expected"; + if (message.tuningStepCount != null && message.hasOwnProperty("tuningStepCount")) + if (!$util.isInteger(message.tuningStepCount) && !(message.tuningStepCount && $util.isInteger(message.tuningStepCount.low) && $util.isInteger(message.tuningStepCount.high))) + return "tuningStepCount: integer|Long expected"; + if (message.userInputTokenDistribution != null && message.hasOwnProperty("userInputTokenDistribution")) { + var error = $root.google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.verify(message.userInputTokenDistribution); + if (error) + return "userInputTokenDistribution." + error; + } + if (message.userOutputTokenDistribution != null && message.hasOwnProperty("userOutputTokenDistribution")) { + var error = $root.google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.verify(message.userOutputTokenDistribution); + if (error) + return "userOutputTokenDistribution." + error; + } + if (message.userMessagePerExampleDistribution != null && message.hasOwnProperty("userMessagePerExampleDistribution")) { + var error = $root.google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.verify(message.userMessagePerExampleDistribution); + if (error) + return "userMessagePerExampleDistribution." + error; + } + if (message.userDatasetExamples != null && message.hasOwnProperty("userDatasetExamples")) { + if (!Array.isArray(message.userDatasetExamples)) + return "userDatasetExamples: array expected"; + for (var i = 0; i < message.userDatasetExamples.length; ++i) { + var error = $root.google.cloud.aiplatform.v1beta1.Content.verify(message.userDatasetExamples[i]); + if (error) + return "userDatasetExamples." + error; + } + } + return null; + }; + + /** + * Creates a SupervisedTuningDataStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats} SupervisedTuningDataStats + */ + SupervisedTuningDataStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats(); + if (object.tuningDatasetExampleCount != null) + if ($util.Long) + (message.tuningDatasetExampleCount = $util.Long.fromValue(object.tuningDatasetExampleCount)).unsigned = false; + else if (typeof object.tuningDatasetExampleCount === "string") + message.tuningDatasetExampleCount = parseInt(object.tuningDatasetExampleCount, 10); + else if (typeof object.tuningDatasetExampleCount === "number") + message.tuningDatasetExampleCount = object.tuningDatasetExampleCount; + else if (typeof object.tuningDatasetExampleCount === "object") + message.tuningDatasetExampleCount = new $util.LongBits(object.tuningDatasetExampleCount.low >>> 0, object.tuningDatasetExampleCount.high >>> 0).toNumber(); + if (object.totalTuningCharacterCount != null) + if ($util.Long) + (message.totalTuningCharacterCount = $util.Long.fromValue(object.totalTuningCharacterCount)).unsigned = false; + else if (typeof object.totalTuningCharacterCount === "string") + message.totalTuningCharacterCount = parseInt(object.totalTuningCharacterCount, 10); + else if (typeof object.totalTuningCharacterCount === "number") + message.totalTuningCharacterCount = object.totalTuningCharacterCount; + else if (typeof object.totalTuningCharacterCount === "object") + message.totalTuningCharacterCount = new $util.LongBits(object.totalTuningCharacterCount.low >>> 0, object.totalTuningCharacterCount.high >>> 0).toNumber(); + if (object.totalBillableCharacterCount != null) + if ($util.Long) + (message.totalBillableCharacterCount = $util.Long.fromValue(object.totalBillableCharacterCount)).unsigned = false; + else if (typeof object.totalBillableCharacterCount === "string") + message.totalBillableCharacterCount = parseInt(object.totalBillableCharacterCount, 10); + else if (typeof object.totalBillableCharacterCount === "number") + message.totalBillableCharacterCount = object.totalBillableCharacterCount; + else if (typeof object.totalBillableCharacterCount === "object") + message.totalBillableCharacterCount = new $util.LongBits(object.totalBillableCharacterCount.low >>> 0, object.totalBillableCharacterCount.high >>> 0).toNumber(); + if (object.tuningStepCount != null) + if ($util.Long) + (message.tuningStepCount = $util.Long.fromValue(object.tuningStepCount)).unsigned = false; + else if (typeof object.tuningStepCount === "string") + message.tuningStepCount = parseInt(object.tuningStepCount, 10); + else if (typeof object.tuningStepCount === "number") + message.tuningStepCount = object.tuningStepCount; + else if (typeof object.tuningStepCount === "object") + message.tuningStepCount = new $util.LongBits(object.tuningStepCount.low >>> 0, object.tuningStepCount.high >>> 0).toNumber(); + if (object.userInputTokenDistribution != null) { + if (typeof object.userInputTokenDistribution !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats.userInputTokenDistribution: object expected"); + message.userInputTokenDistribution = $root.google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.fromObject(object.userInputTokenDistribution); + } + if (object.userOutputTokenDistribution != null) { + if (typeof object.userOutputTokenDistribution !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats.userOutputTokenDistribution: object expected"); + message.userOutputTokenDistribution = $root.google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.fromObject(object.userOutputTokenDistribution); + } + if (object.userMessagePerExampleDistribution != null) { + if (typeof object.userMessagePerExampleDistribution !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats.userMessagePerExampleDistribution: object expected"); + message.userMessagePerExampleDistribution = $root.google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.fromObject(object.userMessagePerExampleDistribution); + } + if (object.userDatasetExamples) { + if (!Array.isArray(object.userDatasetExamples)) + throw TypeError(".google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats.userDatasetExamples: array expected"); + message.userDatasetExamples = []; + for (var i = 0; i < object.userDatasetExamples.length; ++i) { + if (typeof object.userDatasetExamples[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats.userDatasetExamples: object expected"); + message.userDatasetExamples[i] = $root.google.cloud.aiplatform.v1beta1.Content.fromObject(object.userDatasetExamples[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SupervisedTuningDataStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats + * @static + * @param {google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats} message SupervisedTuningDataStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SupervisedTuningDataStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.userDatasetExamples = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.tuningDatasetExampleCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.tuningDatasetExampleCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalTuningCharacterCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalTuningCharacterCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalBillableCharacterCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalBillableCharacterCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.tuningStepCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.tuningStepCount = options.longs === String ? "0" : 0; + object.userInputTokenDistribution = null; + object.userOutputTokenDistribution = null; + object.userMessagePerExampleDistribution = null; + } + if (message.tuningDatasetExampleCount != null && message.hasOwnProperty("tuningDatasetExampleCount")) + if (typeof message.tuningDatasetExampleCount === "number") + object.tuningDatasetExampleCount = options.longs === String ? String(message.tuningDatasetExampleCount) : message.tuningDatasetExampleCount; + else + object.tuningDatasetExampleCount = options.longs === String ? $util.Long.prototype.toString.call(message.tuningDatasetExampleCount) : options.longs === Number ? new $util.LongBits(message.tuningDatasetExampleCount.low >>> 0, message.tuningDatasetExampleCount.high >>> 0).toNumber() : message.tuningDatasetExampleCount; + if (message.totalTuningCharacterCount != null && message.hasOwnProperty("totalTuningCharacterCount")) + if (typeof message.totalTuningCharacterCount === "number") + object.totalTuningCharacterCount = options.longs === String ? String(message.totalTuningCharacterCount) : message.totalTuningCharacterCount; + else + object.totalTuningCharacterCount = options.longs === String ? $util.Long.prototype.toString.call(message.totalTuningCharacterCount) : options.longs === Number ? new $util.LongBits(message.totalTuningCharacterCount.low >>> 0, message.totalTuningCharacterCount.high >>> 0).toNumber() : message.totalTuningCharacterCount; + if (message.totalBillableCharacterCount != null && message.hasOwnProperty("totalBillableCharacterCount")) + if (typeof message.totalBillableCharacterCount === "number") + object.totalBillableCharacterCount = options.longs === String ? String(message.totalBillableCharacterCount) : message.totalBillableCharacterCount; + else + object.totalBillableCharacterCount = options.longs === String ? $util.Long.prototype.toString.call(message.totalBillableCharacterCount) : options.longs === Number ? new $util.LongBits(message.totalBillableCharacterCount.low >>> 0, message.totalBillableCharacterCount.high >>> 0).toNumber() : message.totalBillableCharacterCount; + if (message.tuningStepCount != null && message.hasOwnProperty("tuningStepCount")) + if (typeof message.tuningStepCount === "number") + object.tuningStepCount = options.longs === String ? String(message.tuningStepCount) : message.tuningStepCount; + else + object.tuningStepCount = options.longs === String ? $util.Long.prototype.toString.call(message.tuningStepCount) : options.longs === Number ? new $util.LongBits(message.tuningStepCount.low >>> 0, message.tuningStepCount.high >>> 0).toNumber() : message.tuningStepCount; + if (message.userInputTokenDistribution != null && message.hasOwnProperty("userInputTokenDistribution")) + object.userInputTokenDistribution = $root.google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.toObject(message.userInputTokenDistribution, options); + if (message.userOutputTokenDistribution != null && message.hasOwnProperty("userOutputTokenDistribution")) + object.userOutputTokenDistribution = $root.google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.toObject(message.userOutputTokenDistribution, options); + if (message.userMessagePerExampleDistribution != null && message.hasOwnProperty("userMessagePerExampleDistribution")) + object.userMessagePerExampleDistribution = $root.google.cloud.aiplatform.v1beta1.SupervisedTuningDatasetDistribution.toObject(message.userMessagePerExampleDistribution, options); + if (message.userDatasetExamples && message.userDatasetExamples.length) { + object.userDatasetExamples = []; + for (var j = 0; j < message.userDatasetExamples.length; ++j) + object.userDatasetExamples[j] = $root.google.cloud.aiplatform.v1beta1.Content.toObject(message.userDatasetExamples[j], options); + } + return object; + }; + + /** + * Converts this SupervisedTuningDataStats to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats + * @instance + * @returns {Object.} JSON object + */ + SupervisedTuningDataStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SupervisedTuningDataStats + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SupervisedTuningDataStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats"; + }; + + return SupervisedTuningDataStats; + })(); + + v1beta1.TuningDataStats = (function() { + + /** + * Properties of a TuningDataStats. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface ITuningDataStats + * @property {google.cloud.aiplatform.v1beta1.ISupervisedTuningDataStats|null} [supervisedTuningDataStats] TuningDataStats supervisedTuningDataStats + */ + + /** + * Constructs a new TuningDataStats. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a TuningDataStats. + * @implements ITuningDataStats + * @constructor + * @param {google.cloud.aiplatform.v1beta1.ITuningDataStats=} [properties] Properties to set + */ + function TuningDataStats(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]]; + } + + /** + * TuningDataStats supervisedTuningDataStats. + * @member {google.cloud.aiplatform.v1beta1.ISupervisedTuningDataStats|null|undefined} supervisedTuningDataStats + * @memberof google.cloud.aiplatform.v1beta1.TuningDataStats + * @instance + */ + TuningDataStats.prototype.supervisedTuningDataStats = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TuningDataStats tuningDataStats. + * @member {"supervisedTuningDataStats"|undefined} tuningDataStats + * @memberof google.cloud.aiplatform.v1beta1.TuningDataStats + * @instance + */ + Object.defineProperty(TuningDataStats.prototype, "tuningDataStats", { + get: $util.oneOfGetter($oneOfFields = ["supervisedTuningDataStats"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TuningDataStats instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.TuningDataStats + * @static + * @param {google.cloud.aiplatform.v1beta1.ITuningDataStats=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.TuningDataStats} TuningDataStats instance + */ + TuningDataStats.create = function create(properties) { + return new TuningDataStats(properties); + }; + + /** + * Encodes the specified TuningDataStats message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.TuningDataStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.TuningDataStats + * @static + * @param {google.cloud.aiplatform.v1beta1.ITuningDataStats} message TuningDataStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TuningDataStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.supervisedTuningDataStats != null && Object.hasOwnProperty.call(message, "supervisedTuningDataStats")) + $root.google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats.encode(message.supervisedTuningDataStats, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TuningDataStats message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.TuningDataStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.TuningDataStats + * @static + * @param {google.cloud.aiplatform.v1beta1.ITuningDataStats} message TuningDataStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TuningDataStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TuningDataStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.TuningDataStats + * @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.TuningDataStats} TuningDataStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TuningDataStats.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.TuningDataStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.supervisedTuningDataStats = $root.google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TuningDataStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.TuningDataStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.TuningDataStats} TuningDataStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TuningDataStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TuningDataStats message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.TuningDataStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TuningDataStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.supervisedTuningDataStats != null && message.hasOwnProperty("supervisedTuningDataStats")) { + properties.tuningDataStats = 1; + { + var error = $root.google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats.verify(message.supervisedTuningDataStats); + if (error) + return "supervisedTuningDataStats." + error; + } + } + return null; + }; + + /** + * Creates a TuningDataStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.TuningDataStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.TuningDataStats} TuningDataStats + */ + TuningDataStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.TuningDataStats) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.TuningDataStats(); + if (object.supervisedTuningDataStats != null) { + if (typeof object.supervisedTuningDataStats !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.TuningDataStats.supervisedTuningDataStats: object expected"); + message.supervisedTuningDataStats = $root.google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats.fromObject(object.supervisedTuningDataStats); + } + return message; + }; + + /** + * Creates a plain object from a TuningDataStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.TuningDataStats + * @static + * @param {google.cloud.aiplatform.v1beta1.TuningDataStats} message TuningDataStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TuningDataStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.supervisedTuningDataStats != null && message.hasOwnProperty("supervisedTuningDataStats")) { + object.supervisedTuningDataStats = $root.google.cloud.aiplatform.v1beta1.SupervisedTuningDataStats.toObject(message.supervisedTuningDataStats, options); + if (options.oneofs) + object.tuningDataStats = "supervisedTuningDataStats"; + } + return object; + }; + + /** + * Converts this TuningDataStats to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.TuningDataStats + * @instance + * @returns {Object.} JSON object + */ + TuningDataStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TuningDataStats + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.TuningDataStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TuningDataStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.TuningDataStats"; + }; + + return TuningDataStats; + })(); + + v1beta1.SupervisedHyperParameters = (function() { + + /** + * Properties of a SupervisedHyperParameters. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface ISupervisedHyperParameters + * @property {number|Long|null} [epochCount] SupervisedHyperParameters epochCount + * @property {number|null} [learningRateMultiplier] SupervisedHyperParameters learningRateMultiplier + * @property {google.cloud.aiplatform.v1beta1.SupervisedHyperParameters.AdapterSize|null} [adapterSize] SupervisedHyperParameters adapterSize + */ + + /** + * Constructs a new SupervisedHyperParameters. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a SupervisedHyperParameters. + * @implements ISupervisedHyperParameters + * @constructor + * @param {google.cloud.aiplatform.v1beta1.ISupervisedHyperParameters=} [properties] Properties to set + */ + function SupervisedHyperParameters(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]]; + } + + /** + * SupervisedHyperParameters epochCount. + * @member {number|Long} epochCount + * @memberof google.cloud.aiplatform.v1beta1.SupervisedHyperParameters + * @instance + */ + SupervisedHyperParameters.prototype.epochCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * SupervisedHyperParameters learningRateMultiplier. + * @member {number} learningRateMultiplier + * @memberof google.cloud.aiplatform.v1beta1.SupervisedHyperParameters + * @instance + */ + SupervisedHyperParameters.prototype.learningRateMultiplier = 0; + + /** + * SupervisedHyperParameters adapterSize. + * @member {google.cloud.aiplatform.v1beta1.SupervisedHyperParameters.AdapterSize} adapterSize + * @memberof google.cloud.aiplatform.v1beta1.SupervisedHyperParameters + * @instance + */ + SupervisedHyperParameters.prototype.adapterSize = 0; + + /** + * Creates a new SupervisedHyperParameters instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.SupervisedHyperParameters + * @static + * @param {google.cloud.aiplatform.v1beta1.ISupervisedHyperParameters=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.SupervisedHyperParameters} SupervisedHyperParameters instance + */ + SupervisedHyperParameters.create = function create(properties) { + return new SupervisedHyperParameters(properties); + }; + + /** + * Encodes the specified SupervisedHyperParameters message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.SupervisedHyperParameters.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.SupervisedHyperParameters + * @static + * @param {google.cloud.aiplatform.v1beta1.ISupervisedHyperParameters} message SupervisedHyperParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SupervisedHyperParameters.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.epochCount != null && Object.hasOwnProperty.call(message, "epochCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.epochCount); + if (message.learningRateMultiplier != null && Object.hasOwnProperty.call(message, "learningRateMultiplier")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.learningRateMultiplier); + if (message.adapterSize != null && Object.hasOwnProperty.call(message, "adapterSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.adapterSize); + return writer; + }; + + /** + * Encodes the specified SupervisedHyperParameters message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.SupervisedHyperParameters.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.SupervisedHyperParameters + * @static + * @param {google.cloud.aiplatform.v1beta1.ISupervisedHyperParameters} message SupervisedHyperParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SupervisedHyperParameters.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SupervisedHyperParameters message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.SupervisedHyperParameters + * @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.SupervisedHyperParameters} SupervisedHyperParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SupervisedHyperParameters.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.SupervisedHyperParameters(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.epochCount = reader.int64(); + break; + } + case 2: { + message.learningRateMultiplier = reader.double(); + break; + } + case 3: { + message.adapterSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SupervisedHyperParameters message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.SupervisedHyperParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.SupervisedHyperParameters} SupervisedHyperParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SupervisedHyperParameters.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SupervisedHyperParameters message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.SupervisedHyperParameters + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SupervisedHyperParameters.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.epochCount != null && message.hasOwnProperty("epochCount")) + if (!$util.isInteger(message.epochCount) && !(message.epochCount && $util.isInteger(message.epochCount.low) && $util.isInteger(message.epochCount.high))) + return "epochCount: integer|Long expected"; + if (message.learningRateMultiplier != null && message.hasOwnProperty("learningRateMultiplier")) + if (typeof message.learningRateMultiplier !== "number") + return "learningRateMultiplier: number expected"; + if (message.adapterSize != null && message.hasOwnProperty("adapterSize")) + switch (message.adapterSize) { + default: + return "adapterSize: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a SupervisedHyperParameters message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.SupervisedHyperParameters + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.SupervisedHyperParameters} SupervisedHyperParameters + */ + SupervisedHyperParameters.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.SupervisedHyperParameters) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.SupervisedHyperParameters(); + if (object.epochCount != null) + if ($util.Long) + (message.epochCount = $util.Long.fromValue(object.epochCount)).unsigned = false; + else if (typeof object.epochCount === "string") + message.epochCount = parseInt(object.epochCount, 10); + else if (typeof object.epochCount === "number") + message.epochCount = object.epochCount; + else if (typeof object.epochCount === "object") + message.epochCount = new $util.LongBits(object.epochCount.low >>> 0, object.epochCount.high >>> 0).toNumber(); + if (object.learningRateMultiplier != null) + message.learningRateMultiplier = Number(object.learningRateMultiplier); + switch (object.adapterSize) { + default: + if (typeof object.adapterSize === "number") { + message.adapterSize = object.adapterSize; + break; + } + break; + case "ADAPTER_SIZE_UNSPECIFIED": + case 0: + message.adapterSize = 0; + break; + case "ADAPTER_SIZE_ONE": + case 1: + message.adapterSize = 1; + break; + case "ADAPTER_SIZE_FOUR": + case 2: + message.adapterSize = 2; + break; + case "ADAPTER_SIZE_EIGHT": + case 3: + message.adapterSize = 3; + break; + case "ADAPTER_SIZE_SIXTEEN": + case 4: + message.adapterSize = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a SupervisedHyperParameters message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.SupervisedHyperParameters + * @static + * @param {google.cloud.aiplatform.v1beta1.SupervisedHyperParameters} message SupervisedHyperParameters + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SupervisedHyperParameters.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.epochCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.epochCount = options.longs === String ? "0" : 0; + object.learningRateMultiplier = 0; + object.adapterSize = options.enums === String ? "ADAPTER_SIZE_UNSPECIFIED" : 0; + } + if (message.epochCount != null && message.hasOwnProperty("epochCount")) + if (typeof message.epochCount === "number") + object.epochCount = options.longs === String ? String(message.epochCount) : message.epochCount; + else + object.epochCount = options.longs === String ? $util.Long.prototype.toString.call(message.epochCount) : options.longs === Number ? new $util.LongBits(message.epochCount.low >>> 0, message.epochCount.high >>> 0).toNumber() : message.epochCount; + if (message.learningRateMultiplier != null && message.hasOwnProperty("learningRateMultiplier")) + object.learningRateMultiplier = options.json && !isFinite(message.learningRateMultiplier) ? String(message.learningRateMultiplier) : message.learningRateMultiplier; + if (message.adapterSize != null && message.hasOwnProperty("adapterSize")) + object.adapterSize = options.enums === String ? $root.google.cloud.aiplatform.v1beta1.SupervisedHyperParameters.AdapterSize[message.adapterSize] === undefined ? message.adapterSize : $root.google.cloud.aiplatform.v1beta1.SupervisedHyperParameters.AdapterSize[message.adapterSize] : message.adapterSize; + return object; + }; + + /** + * Converts this SupervisedHyperParameters to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.SupervisedHyperParameters + * @instance + * @returns {Object.} JSON object + */ + SupervisedHyperParameters.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SupervisedHyperParameters + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.SupervisedHyperParameters + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SupervisedHyperParameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.SupervisedHyperParameters"; + }; + + /** + * AdapterSize enum. + * @name google.cloud.aiplatform.v1beta1.SupervisedHyperParameters.AdapterSize + * @enum {number} + * @property {number} ADAPTER_SIZE_UNSPECIFIED=0 ADAPTER_SIZE_UNSPECIFIED value + * @property {number} ADAPTER_SIZE_ONE=1 ADAPTER_SIZE_ONE value + * @property {number} ADAPTER_SIZE_FOUR=2 ADAPTER_SIZE_FOUR value + * @property {number} ADAPTER_SIZE_EIGHT=3 ADAPTER_SIZE_EIGHT value + * @property {number} ADAPTER_SIZE_SIXTEEN=4 ADAPTER_SIZE_SIXTEEN value + */ + SupervisedHyperParameters.AdapterSize = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ADAPTER_SIZE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADAPTER_SIZE_ONE"] = 1; + values[valuesById[2] = "ADAPTER_SIZE_FOUR"] = 2; + values[valuesById[3] = "ADAPTER_SIZE_EIGHT"] = 3; + values[valuesById[4] = "ADAPTER_SIZE_SIXTEEN"] = 4; + return values; + })(); + + return SupervisedHyperParameters; + })(); + + v1beta1.SupervisedTuningSpec = (function() { + + /** + * Properties of a SupervisedTuningSpec. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface ISupervisedTuningSpec + * @property {string|null} [trainingDatasetUri] SupervisedTuningSpec trainingDatasetUri + * @property {string|null} [validationDatasetUri] SupervisedTuningSpec validationDatasetUri + * @property {google.cloud.aiplatform.v1beta1.ISupervisedHyperParameters|null} [hyperParameters] SupervisedTuningSpec hyperParameters + */ + + /** + * Constructs a new SupervisedTuningSpec. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a SupervisedTuningSpec. + * @implements ISupervisedTuningSpec + * @constructor + * @param {google.cloud.aiplatform.v1beta1.ISupervisedTuningSpec=} [properties] Properties to set + */ + function SupervisedTuningSpec(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]]; + } + + /** + * SupervisedTuningSpec trainingDatasetUri. + * @member {string} trainingDatasetUri + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningSpec + * @instance + */ + SupervisedTuningSpec.prototype.trainingDatasetUri = ""; + + /** + * SupervisedTuningSpec validationDatasetUri. + * @member {string} validationDatasetUri + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningSpec + * @instance + */ + SupervisedTuningSpec.prototype.validationDatasetUri = ""; + + /** + * SupervisedTuningSpec hyperParameters. + * @member {google.cloud.aiplatform.v1beta1.ISupervisedHyperParameters|null|undefined} hyperParameters + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningSpec + * @instance + */ + SupervisedTuningSpec.prototype.hyperParameters = null; + + /** + * Creates a new SupervisedTuningSpec instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningSpec + * @static + * @param {google.cloud.aiplatform.v1beta1.ISupervisedTuningSpec=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.SupervisedTuningSpec} SupervisedTuningSpec instance + */ + SupervisedTuningSpec.create = function create(properties) { + return new SupervisedTuningSpec(properties); + }; + + /** + * Encodes the specified SupervisedTuningSpec message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.SupervisedTuningSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningSpec + * @static + * @param {google.cloud.aiplatform.v1beta1.ISupervisedTuningSpec} message SupervisedTuningSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SupervisedTuningSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.trainingDatasetUri != null && Object.hasOwnProperty.call(message, "trainingDatasetUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.trainingDatasetUri); + if (message.validationDatasetUri != null && Object.hasOwnProperty.call(message, "validationDatasetUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.validationDatasetUri); + if (message.hyperParameters != null && Object.hasOwnProperty.call(message, "hyperParameters")) + $root.google.cloud.aiplatform.v1beta1.SupervisedHyperParameters.encode(message.hyperParameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SupervisedTuningSpec message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.SupervisedTuningSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningSpec + * @static + * @param {google.cloud.aiplatform.v1beta1.ISupervisedTuningSpec} message SupervisedTuningSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SupervisedTuningSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SupervisedTuningSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningSpec + * @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.SupervisedTuningSpec} SupervisedTuningSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SupervisedTuningSpec.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.SupervisedTuningSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.trainingDatasetUri = reader.string(); + break; + } + case 2: { + message.validationDatasetUri = reader.string(); + break; + } + case 3: { + message.hyperParameters = $root.google.cloud.aiplatform.v1beta1.SupervisedHyperParameters.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SupervisedTuningSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.SupervisedTuningSpec} SupervisedTuningSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SupervisedTuningSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SupervisedTuningSpec message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SupervisedTuningSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.trainingDatasetUri != null && message.hasOwnProperty("trainingDatasetUri")) + if (!$util.isString(message.trainingDatasetUri)) + return "trainingDatasetUri: string expected"; + if (message.validationDatasetUri != null && message.hasOwnProperty("validationDatasetUri")) + if (!$util.isString(message.validationDatasetUri)) + return "validationDatasetUri: string expected"; + if (message.hyperParameters != null && message.hasOwnProperty("hyperParameters")) { + var error = $root.google.cloud.aiplatform.v1beta1.SupervisedHyperParameters.verify(message.hyperParameters); + if (error) + return "hyperParameters." + error; + } + return null; + }; + + /** + * Creates a SupervisedTuningSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.SupervisedTuningSpec} SupervisedTuningSpec + */ + SupervisedTuningSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.SupervisedTuningSpec) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.SupervisedTuningSpec(); + if (object.trainingDatasetUri != null) + message.trainingDatasetUri = String(object.trainingDatasetUri); + if (object.validationDatasetUri != null) + message.validationDatasetUri = String(object.validationDatasetUri); + if (object.hyperParameters != null) { + if (typeof object.hyperParameters !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.SupervisedTuningSpec.hyperParameters: object expected"); + message.hyperParameters = $root.google.cloud.aiplatform.v1beta1.SupervisedHyperParameters.fromObject(object.hyperParameters); + } + return message; + }; + + /** + * Creates a plain object from a SupervisedTuningSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningSpec + * @static + * @param {google.cloud.aiplatform.v1beta1.SupervisedTuningSpec} message SupervisedTuningSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SupervisedTuningSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.trainingDatasetUri = ""; + object.validationDatasetUri = ""; + object.hyperParameters = null; + } + if (message.trainingDatasetUri != null && message.hasOwnProperty("trainingDatasetUri")) + object.trainingDatasetUri = message.trainingDatasetUri; + if (message.validationDatasetUri != null && message.hasOwnProperty("validationDatasetUri")) + object.validationDatasetUri = message.validationDatasetUri; + if (message.hyperParameters != null && message.hasOwnProperty("hyperParameters")) + object.hyperParameters = $root.google.cloud.aiplatform.v1beta1.SupervisedHyperParameters.toObject(message.hyperParameters, options); + return object; + }; + + /** + * Converts this SupervisedTuningSpec to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningSpec + * @instance + * @returns {Object.} JSON object + */ + SupervisedTuningSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SupervisedTuningSpec + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.SupervisedTuningSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SupervisedTuningSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.SupervisedTuningSpec"; + }; + + return SupervisedTuningSpec; + })(); + v1beta1.HyperparameterTuningJob = (function() { /** diff --git a/packages/google-cloud-aiplatform/protos/protos.json b/packages/google-cloud-aiplatform/protos/protos.json index f2863b0fbfd..833a667d90c 100644 --- a/packages/google-cloud-aiplatform/protos/protos.json +++ b/packages/google-cloud-aiplatform/protos/protos.json @@ -42360,6 +42360,551 @@ } } }, + "GenAiTuningService": { + "options": { + "(google.api.default_host)": "aiplatform.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateTuningJob": { + "requestType": "CreateTuningJobRequest", + "responseType": "TuningJob", + "options": { + "(google.api.http).post": "/v1beta1/{parent=projects/*/locations/*}/tuningJobs", + "(google.api.http).body": "tuning_job", + "(google.api.method_signature)": "parent,tuning_job" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=projects/*/locations/*}/tuningJobs", + "body": "tuning_job" + } + }, + { + "(google.api.method_signature)": "parent,tuning_job" + } + ] + }, + "GetTuningJob": { + "requestType": "GetTuningJobRequest", + "responseType": "TuningJob", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/locations/*/tuningJobs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/locations/*/tuningJobs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListTuningJobs": { + "requestType": "ListTuningJobsRequest", + "responseType": "ListTuningJobsResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=projects/*/locations/*}/tuningJobs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*/locations/*}/tuningJobs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CancelTuningJob": { + "requestType": "CancelTuningJobRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/tuningJobs/*}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/locations/*/tuningJobs/*}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "CreateTuningJobRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "tuningJob": { + "type": "TuningJob", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetTuningJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/TuningJob" + } + } + } + }, + "ListTuningJobsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListTuningJobsResponse": { + "fields": { + "tuningJobs": { + "rule": "repeated", + "type": "TuningJob", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelTuningJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/TuningJob" + } + } + } + }, + "TuningJob": { + "options": { + "(google.api.resource).type": "aiplatform.googleapis.com/TuningJob", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/tuningJobs/{tuning_job}", + "(google.api.resource).plural": "tuningJobs", + "(google.api.resource).singular": "tuningJob" + }, + "oneofs": { + "sourceModel": { + "oneof": [ + "baseModel" + ] + }, + "tuningSpec": { + "oneof": [ + "supervisedTuningSpec" + ] + } + }, + "fields": { + "baseModel": { + "type": "string", + "id": 4 + }, + "supervisedTuningSpec": { + "type": "SupervisedTuningSpec", + "id": 5 + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "tunedModelDisplayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "state": { + "type": "JobState", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "error": { + "type": "google.rpc.Status", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "experiment": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/Context" + } + }, + "tunedModel": { + "type": "TunedModel", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "tuningDataStats": { + "type": "TuningDataStats", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "encryptionSpec": { + "type": "EncryptionSpec", + "id": 16 + } + } + }, + "TunedModel": { + "fields": { + "model": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/Model" + } + }, + "endpoint": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/Endpoint" + } + } + } + }, + "SupervisedTuningDatasetDistribution": { + "fields": { + "sum": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "min": { + "type": "double", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "max": { + "type": "double", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "mean": { + "type": "double", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "median": { + "type": "double", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "p5": { + "type": "double", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "p95": { + "type": "double", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "buckets": { + "rule": "repeated", + "type": "DatasetBucket", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "DatasetBucket": { + "fields": { + "count": { + "type": "double", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "left": { + "type": "double", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "right": { + "type": "double", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, + "SupervisedTuningDataStats": { + "fields": { + "tuningDatasetExampleCount": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "totalTuningCharacterCount": { + "type": "int64", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "totalBillableCharacterCount": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "tuningStepCount": { + "type": "int64", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "userInputTokenDistribution": { + "type": "SupervisedTuningDatasetDistribution", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "userOutputTokenDistribution": { + "type": "SupervisedTuningDatasetDistribution", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "userMessagePerExampleDistribution": { + "type": "SupervisedTuningDatasetDistribution", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "userDatasetExamples": { + "rule": "repeated", + "type": "Content", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "TuningDataStats": { + "oneofs": { + "tuningDataStats": { + "oneof": [ + "supervisedTuningDataStats" + ] + } + }, + "fields": { + "supervisedTuningDataStats": { + "type": "SupervisedTuningDataStats", + "id": 1 + } + } + }, + "SupervisedHyperParameters": { + "fields": { + "epochCount": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "learningRateMultiplier": { + "type": "double", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "adapterSize": { + "type": "AdapterSize", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "AdapterSize": { + "values": { + "ADAPTER_SIZE_UNSPECIFIED": 0, + "ADAPTER_SIZE_ONE": 1, + "ADAPTER_SIZE_FOUR": 2, + "ADAPTER_SIZE_EIGHT": 3, + "ADAPTER_SIZE_SIXTEEN": 4 + } + } + } + }, + "SupervisedTuningSpec": { + "fields": { + "trainingDatasetUri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validationDatasetUri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "hyperParameters": { + "type": "SupervisedHyperParameters", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, "HyperparameterTuningJob": { "options": { "(google.api.resource).type": "aiplatform.googleapis.com/HyperparameterTuningJob", diff --git a/packages/google-cloud-aiplatform/samples/README.md b/packages/google-cloud-aiplatform/samples/README.md index 101ec2a1f47..02c85dafb32 100644 --- a/packages/google-cloud-aiplatform/samples/README.md +++ b/packages/google-cloud-aiplatform/samples/README.md @@ -391,6 +391,10 @@ * [Featurestore_service.update_entity_type](#featurestore_service.update_entity_type) * [Featurestore_service.update_feature](#featurestore_service.update_feature) * [Featurestore_service.update_featurestore](#featurestore_service.update_featurestore) + * [Gen_ai_tuning_service.cancel_tuning_job](#gen_ai_tuning_service.cancel_tuning_job) + * [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) * [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) @@ -7087,6 +7091,74 @@ __Usage:__ +### Gen_ai_tuning_service.cancel_tuning_job + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.cancel_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.cancel_tuning_job.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.cancel_tuning_job.js` + + +----- + + + + +### Gen_ai_tuning_service.create_tuning_job + +View the [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,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.create_tuning_job.js` + + +----- + + + + +### Gen_ai_tuning_service.get_tuning_job + +View the [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,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.get_tuning_job.js` + + +----- + + + + +### Gen_ai_tuning_service.list_tuning_jobs + +View the [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,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.list_tuning_jobs.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/v1beta1/gen_ai_tuning_service.cancel_tuning_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.cancel_tuning_job.js new file mode 100644 index 00000000000..8a0aa23a8c5 --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.cancel_tuning_job.js @@ -0,0 +1,62 @@ +// 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(name) { + // [START aiplatform_v1beta1_generated_GenAiTuningService_CancelTuningJob_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 name of the TuningJob to cancel. Format: + * `projects/{project}/locations/{location}/tuningJobs/{tuning_job}` + */ + // const name = 'abc123' + + // Imports the Aiplatform library + const {GenAiTuningServiceClient} = require('@google-cloud/aiplatform').v1beta1; + + // Instantiates a client + const aiplatformClient = new GenAiTuningServiceClient(); + + async function callCancelTuningJob() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await aiplatformClient.cancelTuningJob(request); + console.log(response); + } + + callCancelTuningJob(); + // [END aiplatform_v1beta1_generated_GenAiTuningService_CancelTuningJob_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/gen_ai_tuning_service.create_tuning_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.create_tuning_job.js new file mode 100644 index 00000000000..ad30bd4470f --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.create_tuning_job.js @@ -0,0 +1,67 @@ +// 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, tuningJob) { + // [START aiplatform_v1beta1_generated_GenAiTuningService_CreateTuningJob_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 to create the TuningJob in. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Required. The TuningJob to create. + */ + // const tuningJob = {} + + // Imports the Aiplatform library + const {GenAiTuningServiceClient} = require('@google-cloud/aiplatform').v1beta1; + + // Instantiates a client + const aiplatformClient = new GenAiTuningServiceClient(); + + async function callCreateTuningJob() { + // Construct request + const request = { + parent, + tuningJob, + }; + + // Run request + const response = await aiplatformClient.createTuningJob(request); + console.log(response); + } + + callCreateTuningJob(); + // [END aiplatform_v1beta1_generated_GenAiTuningService_CreateTuningJob_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/gen_ai_tuning_service.get_tuning_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.get_tuning_job.js new file mode 100644 index 00000000000..4391fd72d54 --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.get_tuning_job.js @@ -0,0 +1,62 @@ +// 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(name) { + // [START aiplatform_v1beta1_generated_GenAiTuningService_GetTuningJob_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 name of the TuningJob resource. Format: + * `projects/{project}/locations/{location}/tuningJobs/{tuning_job}` + */ + // const name = 'abc123' + + // Imports the Aiplatform library + const {GenAiTuningServiceClient} = require('@google-cloud/aiplatform').v1beta1; + + // Instantiates a client + const aiplatformClient = new GenAiTuningServiceClient(); + + async function callGetTuningJob() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await aiplatformClient.getTuningJob(request); + console.log(response); + } + + callGetTuningJob(); + // [END aiplatform_v1beta1_generated_GenAiTuningService_GetTuningJob_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/gen_ai_tuning_service.list_tuning_jobs.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.list_tuning_jobs.js new file mode 100644 index 00000000000..75e275db562 --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.list_tuning_jobs.js @@ -0,0 +1,78 @@ +// 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) { + // [START aiplatform_v1beta1_generated_GenAiTuningService_ListTuningJobs_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 to list the TuningJobs from. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Optional. The standard list filter. + */ + // const filter = 'abc123' + /** + * Optional. The standard list page size. + */ + // const pageSize = 1234 + /** + * Optional. The standard list page token. + * Typically obtained via ListTuningJob.next_page_token of the + * previous GenAiTuningService.ListTuningJob call. + */ + // const pageToken = 'abc123' + + // Imports the Aiplatform library + const {GenAiTuningServiceClient} = require('@google-cloud/aiplatform').v1beta1; + + // Instantiates a client + const aiplatformClient = new GenAiTuningServiceClient(); + + async function callListTuningJobs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = aiplatformClient.listTuningJobsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTuningJobs(); + // [END aiplatform_v1beta1_generated_GenAiTuningService_ListTuningJobs_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 3405a784917..b863a8cbc84 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 @@ -4411,6 +4411,182 @@ } } }, + { + "regionTag": "aiplatform_v1beta1_generated_GenAiTuningService_CreateTuningJob_async", + "title": "DatasetService createTuningJob Sample", + "origin": "API_DEFINITION", + "description": " Creates a TuningJob. A created TuningJob right away will be attempted to be run.", + "canonical": true, + "file": "gen_ai_tuning_service.create_tuning_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateTuningJob", + "fullName": "google.cloud.aiplatform.v1beta1.GenAiTuningService.CreateTuningJob", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "tuning_job", + "type": ".google.cloud.aiplatform.v1beta1.TuningJob" + } + ], + "resultType": ".google.cloud.aiplatform.v1beta1.TuningJob", + "client": { + "shortName": "GenAiTuningServiceClient", + "fullName": "google.cloud.aiplatform.v1beta1.GenAiTuningServiceClient" + }, + "method": { + "shortName": "CreateTuningJob", + "fullName": "google.cloud.aiplatform.v1beta1.GenAiTuningService.CreateTuningJob", + "service": { + "shortName": "GenAiTuningService", + "fullName": "google.cloud.aiplatform.v1beta1.GenAiTuningService" + } + } + } + }, + { + "regionTag": "aiplatform_v1beta1_generated_GenAiTuningService_GetTuningJob_async", + "title": "DatasetService getTuningJob Sample", + "origin": "API_DEFINITION", + "description": " Gets a TuningJob.", + "canonical": true, + "file": "gen_ai_tuning_service.get_tuning_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetTuningJob", + "fullName": "google.cloud.aiplatform.v1beta1.GenAiTuningService.GetTuningJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.aiplatform.v1beta1.TuningJob", + "client": { + "shortName": "GenAiTuningServiceClient", + "fullName": "google.cloud.aiplatform.v1beta1.GenAiTuningServiceClient" + }, + "method": { + "shortName": "GetTuningJob", + "fullName": "google.cloud.aiplatform.v1beta1.GenAiTuningService.GetTuningJob", + "service": { + "shortName": "GenAiTuningService", + "fullName": "google.cloud.aiplatform.v1beta1.GenAiTuningService" + } + } + } + }, + { + "regionTag": "aiplatform_v1beta1_generated_GenAiTuningService_ListTuningJobs_async", + "title": "DatasetService listTuningJobs Sample", + "origin": "API_DEFINITION", + "description": " Lists TuningJobs in a Location.", + "canonical": true, + "file": "gen_ai_tuning_service.list_tuning_jobs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListTuningJobs", + "fullName": "google.cloud.aiplatform.v1beta1.GenAiTuningService.ListTuningJobs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.aiplatform.v1beta1.ListTuningJobsResponse", + "client": { + "shortName": "GenAiTuningServiceClient", + "fullName": "google.cloud.aiplatform.v1beta1.GenAiTuningServiceClient" + }, + "method": { + "shortName": "ListTuningJobs", + "fullName": "google.cloud.aiplatform.v1beta1.GenAiTuningService.ListTuningJobs", + "service": { + "shortName": "GenAiTuningService", + "fullName": "google.cloud.aiplatform.v1beta1.GenAiTuningService" + } + } + } + }, + { + "regionTag": "aiplatform_v1beta1_generated_GenAiTuningService_CancelTuningJob_async", + "title": "DatasetService cancelTuningJob Sample", + "origin": "API_DEFINITION", + "description": " Cancels a TuningJob. Starts asynchronous cancellation on the TuningJob. The server makes a best effort to cancel the job, but success is not guaranteed. Clients can use [GenAiTuningService.GetTuningJob][google.cloud.aiplatform.v1beta1.GenAiTuningService.GetTuningJob] or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On successful cancellation, the TuningJob is not deleted; instead it becomes a job with a [TuningJob.error][google.cloud.aiplatform.v1beta1.TuningJob.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`, and [TuningJob.state][google.cloud.aiplatform.v1beta1.TuningJob.state] is set to `CANCELLED`.", + "canonical": true, + "file": "gen_ai_tuning_service.cancel_tuning_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CancelTuningJob", + "fullName": "google.cloud.aiplatform.v1beta1.GenAiTuningService.CancelTuningJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "GenAiTuningServiceClient", + "fullName": "google.cloud.aiplatform.v1beta1.GenAiTuningServiceClient" + }, + "method": { + "shortName": "CancelTuningJob", + "fullName": "google.cloud.aiplatform.v1beta1.GenAiTuningService.CancelTuningJob", + "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/featurestore_online_serving_service_client.ts b/packages/google-cloud-aiplatform/src/v1/featurestore_online_serving_service_client.ts index 189fc3389b6..be7f04a5472 100644 --- a/packages/google-cloud-aiplatform/src/v1/featurestore_online_serving_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/featurestore_online_serving_service_client.ts @@ -366,7 +366,7 @@ export class FeaturestoreOnlineServingServiceClient { streamingReadFeatureValues: new this._gaxModule.StreamDescriptor( this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback, - /* gaxStreamingRetries: */ false + !!opts.gaxServerStreamingRetries ), }; diff --git a/packages/google-cloud-aiplatform/src/v1/prediction_service_client.ts b/packages/google-cloud-aiplatform/src/v1/prediction_service_client.ts index bf9278021b9..377a50d7897 100644 --- a/packages/google-cloud-aiplatform/src/v1/prediction_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/prediction_service_client.ts @@ -365,37 +365,37 @@ export class PredictionServiceClient { streamRawPredict: new this._gaxModule.StreamDescriptor( this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback, - /* gaxStreamingRetries: */ false + !!opts.gaxServerStreamingRetries ), streamDirectPredict: new this._gaxModule.StreamDescriptor( this._gaxModule.StreamType.BIDI_STREAMING, !!opts.fallback, - /* gaxStreamingRetries: */ false + !!opts.gaxServerStreamingRetries ), streamDirectRawPredict: new this._gaxModule.StreamDescriptor( this._gaxModule.StreamType.BIDI_STREAMING, !!opts.fallback, - /* gaxStreamingRetries: */ false + !!opts.gaxServerStreamingRetries ), streamingPredict: new this._gaxModule.StreamDescriptor( this._gaxModule.StreamType.BIDI_STREAMING, !!opts.fallback, - /* gaxStreamingRetries: */ false + !!opts.gaxServerStreamingRetries ), serverStreamingPredict: new this._gaxModule.StreamDescriptor( this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback, - /* gaxStreamingRetries: */ false + !!opts.gaxServerStreamingRetries ), streamingRawPredict: new this._gaxModule.StreamDescriptor( this._gaxModule.StreamType.BIDI_STREAMING, !!opts.fallback, - /* gaxStreamingRetries: */ false + !!opts.gaxServerStreamingRetries ), streamGenerateContent: new this._gaxModule.StreamDescriptor( this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback, - /* gaxStreamingRetries: */ false + !!opts.gaxServerStreamingRetries ), }; diff --git a/packages/google-cloud-aiplatform/src/v1/tensorboard_service_client.ts b/packages/google-cloud-aiplatform/src/v1/tensorboard_service_client.ts index 3c31ce665bc..60a2d596061 100644 --- a/packages/google-cloud-aiplatform/src/v1/tensorboard_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/tensorboard_service_client.ts @@ -407,7 +407,7 @@ export class TensorboardServiceClient { readTensorboardBlobData: new this._gaxModule.StreamDescriptor( this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback, - /* gaxStreamingRetries: */ false + !!opts.gaxServerStreamingRetries ), }; diff --git a/packages/google-cloud-aiplatform/src/v1beta1/dataset_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/dataset_service_client.ts index 3607c2cecbd..7ca5007f34e 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/dataset_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/dataset_service_client.ts @@ -383,6 +383,9 @@ export class DatasetServiceClient { trialPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), }; // Some of the methods on this service return "paged" results, @@ -9418,6 +9421,58 @@ export class DatasetServiceClient { return this.pathTemplates.trialPathTemplate.match(trialName).trial; } + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/dataset_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/dataset_service_proto_list.json index b6b7020e38d..3311f6e20d8 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/dataset_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/dataset_service_proto_list.json @@ -45,6 +45,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/index.proto", "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", @@ -155,6 +156,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", "../../protos/google/cloud/aiplatform/v1beta1/tool.proto", "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/types.proto", "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/deployment_resource_pool_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/deployment_resource_pool_service_client.ts index 086e34a7165..68c0cda974c 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/deployment_resource_pool_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/deployment_resource_pool_service_client.ts @@ -387,6 +387,9 @@ export class DeploymentResourcePoolServiceClient { trialPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), }; // Some of the methods on this service return "paged" results, @@ -7088,6 +7091,58 @@ export class DeploymentResourcePoolServiceClient { return this.pathTemplates.trialPathTemplate.match(trialName).trial; } + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/deployment_resource_pool_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/deployment_resource_pool_service_proto_list.json index b6b7020e38d..3311f6e20d8 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/deployment_resource_pool_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/deployment_resource_pool_service_proto_list.json @@ -45,6 +45,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/index.proto", "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", @@ -155,6 +156,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", "../../protos/google/cloud/aiplatform/v1beta1/tool.proto", "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/types.proto", "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/endpoint_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/endpoint_service_client.ts index c06daa10a42..f923cec7326 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/endpoint_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/endpoint_service_client.ts @@ -383,6 +383,9 @@ export class EndpointServiceClient { trialPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), }; // Some of the methods on this service return "paged" results, @@ -7479,6 +7482,58 @@ export class EndpointServiceClient { return this.pathTemplates.trialPathTemplate.match(trialName).trial; } + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/endpoint_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/endpoint_service_proto_list.json index b6b7020e38d..3311f6e20d8 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/endpoint_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/endpoint_service_proto_list.json @@ -45,6 +45,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/index.proto", "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", @@ -155,6 +156,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", "../../protos/google/cloud/aiplatform/v1beta1/tool.proto", "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/types.proto", "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/evaluation_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/evaluation_service_client.ts index 0f507b94361..2161677b1ac 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/evaluation_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/evaluation_service_client.ts @@ -378,6 +378,9 @@ export class EvaluationServiceClient { trialPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), }; // Put together the default options sent with requests. @@ -4545,6 +4548,58 @@ export class EvaluationServiceClient { return this.pathTemplates.trialPathTemplate.match(trialName).trial; } + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/evaluation_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/evaluation_service_proto_list.json index b6b7020e38d..3311f6e20d8 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/evaluation_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/evaluation_service_proto_list.json @@ -45,6 +45,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/index.proto", "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", @@ -155,6 +156,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", "../../protos/google/cloud/aiplatform/v1beta1/tool.proto", "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/types.proto", "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/extension_execution_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/extension_execution_service_client.ts index bf8847dcc16..fa125f0b23b 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/extension_execution_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/extension_execution_service_client.ts @@ -376,6 +376,9 @@ export class ExtensionExecutionServiceClient { trialPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), }; // Put together the default options sent with requests. @@ -4578,6 +4581,58 @@ export class ExtensionExecutionServiceClient { return this.pathTemplates.trialPathTemplate.match(trialName).trial; } + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/extension_execution_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/extension_execution_service_proto_list.json index b6b7020e38d..3311f6e20d8 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/extension_execution_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/extension_execution_service_proto_list.json @@ -45,6 +45,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/index.proto", "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", @@ -155,6 +156,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", "../../protos/google/cloud/aiplatform/v1beta1/tool.proto", "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/types.proto", "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/extension_registry_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/extension_registry_service_client.ts index 1657603f5ba..8426fe564e8 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/extension_registry_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/extension_registry_service_client.ts @@ -384,6 +384,9 @@ export class ExtensionRegistryServiceClient { trialPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), }; // Some of the methods on this service return "paged" results, @@ -6943,6 +6946,58 @@ export class ExtensionRegistryServiceClient { return this.pathTemplates.trialPathTemplate.match(trialName).trial; } + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/extension_registry_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/extension_registry_service_proto_list.json index b6b7020e38d..3311f6e20d8 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/extension_registry_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/extension_registry_service_proto_list.json @@ -45,6 +45,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/index.proto", "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", @@ -155,6 +156,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", "../../protos/google/cloud/aiplatform/v1beta1/tool.proto", "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/types.proto", "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/feature_online_store_admin_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/feature_online_store_admin_service_client.ts index 09e76afaf94..61a9fd4b33d 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/feature_online_store_admin_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/feature_online_store_admin_service_client.ts @@ -388,6 +388,9 @@ export class FeatureOnlineStoreAdminServiceClient { trialPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), }; // Some of the methods on this service return "paged" results, @@ -8490,6 +8493,58 @@ export class FeatureOnlineStoreAdminServiceClient { return this.pathTemplates.trialPathTemplate.match(trialName).trial; } + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/feature_online_store_admin_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/feature_online_store_admin_service_proto_list.json index b6b7020e38d..3311f6e20d8 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/feature_online_store_admin_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/feature_online_store_admin_service_proto_list.json @@ -45,6 +45,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/index.proto", "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", @@ -155,6 +156,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", "../../protos/google/cloud/aiplatform/v1beta1/tool.proto", "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/types.proto", "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/feature_online_store_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/feature_online_store_service_client.ts index 7bb80838d78..657c9a56a56 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/feature_online_store_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/feature_online_store_service_client.ts @@ -376,6 +376,9 @@ export class FeatureOnlineStoreServiceClient { trialPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), }; // Some of the methods on this service provide streaming responses. @@ -384,7 +387,7 @@ export class FeatureOnlineStoreServiceClient { streamingFetchFeatureValues: new this._gaxModule.StreamDescriptor( this._gaxModule.StreamType.BIDI_STREAMING, !!opts.fallback, - /* gaxStreamingRetries: */ false + !!opts.gaxServerStreamingRetries ), }; @@ -4625,6 +4628,58 @@ export class FeatureOnlineStoreServiceClient { return this.pathTemplates.trialPathTemplate.match(trialName).trial; } + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/feature_online_store_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/feature_online_store_service_proto_list.json index b6b7020e38d..3311f6e20d8 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/feature_online_store_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/feature_online_store_service_proto_list.json @@ -45,6 +45,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/index.proto", "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", @@ -155,6 +156,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", "../../protos/google/cloud/aiplatform/v1beta1/tool.proto", "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/types.proto", "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/feature_registry_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/feature_registry_service_client.ts index 0bebe3a1f1f..e7ee647f712 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/feature_registry_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/feature_registry_service_client.ts @@ -388,6 +388,9 @@ export class FeatureRegistryServiceClient { trialPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), }; // Some of the methods on this service return "paged" results, @@ -8039,6 +8042,58 @@ export class FeatureRegistryServiceClient { return this.pathTemplates.trialPathTemplate.match(trialName).trial; } + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/feature_registry_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/feature_registry_service_proto_list.json index b6b7020e38d..3311f6e20d8 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/feature_registry_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/feature_registry_service_proto_list.json @@ -45,6 +45,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/index.proto", "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", @@ -155,6 +156,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", "../../protos/google/cloud/aiplatform/v1beta1/tool.proto", "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/types.proto", "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/featurestore_online_serving_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/featurestore_online_serving_service_client.ts index a8ab76b0ba1..ef1bc6202fd 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/featurestore_online_serving_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/featurestore_online_serving_service_client.ts @@ -376,6 +376,9 @@ export class FeaturestoreOnlineServingServiceClient { trialPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), }; // Some of the methods on this service provide streaming responses. @@ -384,7 +387,7 @@ export class FeaturestoreOnlineServingServiceClient { streamingReadFeatureValues: new this._gaxModule.StreamDescriptor( this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback, - /* gaxStreamingRetries: */ false + !!opts.gaxServerStreamingRetries ), }; @@ -4650,6 +4653,58 @@ export class FeaturestoreOnlineServingServiceClient { return this.pathTemplates.trialPathTemplate.match(trialName).trial; } + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/featurestore_online_serving_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/featurestore_online_serving_service_proto_list.json index b6b7020e38d..3311f6e20d8 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/featurestore_online_serving_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/featurestore_online_serving_service_proto_list.json @@ -45,6 +45,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/index.proto", "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", @@ -155,6 +156,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", "../../protos/google/cloud/aiplatform/v1beta1/tool.proto", "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/types.proto", "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/featurestore_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/featurestore_service_client.ts index a732929b211..7fc90a77cff 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/featurestore_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/featurestore_service_client.ts @@ -386,6 +386,9 @@ export class FeaturestoreServiceClient { trialPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), }; // Some of the methods on this service return "paged" results, @@ -10136,6 +10139,58 @@ export class FeaturestoreServiceClient { return this.pathTemplates.trialPathTemplate.match(trialName).trial; } + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/featurestore_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/featurestore_service_proto_list.json index b6b7020e38d..3311f6e20d8 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/featurestore_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/featurestore_service_proto_list.json @@ -45,6 +45,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/index.proto", "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", @@ -155,6 +156,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", "../../protos/google/cloud/aiplatform/v1beta1/tool.proto", "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/types.proto", "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/gapic_metadata.json b/packages/google-cloud-aiplatform/src/v1beta1/gapic_metadata.json index 01aa5a79da1..37bce9ece8b 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/gapic_metadata.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/gapic_metadata.json @@ -1125,6 +1125,64 @@ } } }, + "GenAiTuningService": { + "clients": { + "grpc": { + "libraryClient": "GenAiTuningServiceClient", + "rpcs": { + "CreateTuningJob": { + "methods": [ + "createTuningJob" + ] + }, + "GetTuningJob": { + "methods": [ + "getTuningJob" + ] + }, + "CancelTuningJob": { + "methods": [ + "cancelTuningJob" + ] + }, + "ListTuningJobs": { + "methods": [ + "listTuningJobs", + "listTuningJobsStream", + "listTuningJobsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "GenAiTuningServiceClient", + "rpcs": { + "CreateTuningJob": { + "methods": [ + "createTuningJob" + ] + }, + "GetTuningJob": { + "methods": [ + "getTuningJob" + ] + }, + "CancelTuningJob": { + "methods": [ + "cancelTuningJob" + ] + }, + "ListTuningJobs": { + "methods": [ + "listTuningJobs", + "listTuningJobsStream", + "listTuningJobsAsync" + ] + } + } + } + } + }, "IndexEndpointService": { "clients": { "grpc": { 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 new file mode 100644 index 00000000000..285ed33e3da --- /dev/null +++ b/packages/google-cloud-aiplatform/src/v1beta1/gen_ai_tuning_service_client.ts @@ -0,0 +1,4993 @@ +// 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. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, + IamClient, + IamProtos, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/gen_ai_tuning_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './gen_ai_tuning_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * A service for creating and managing GenAI Tuning Jobs. + * @class + * @memberof v1beta1 + */ +export class GenAiTuningServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + genAiTuningServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of GenAiTuningServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new GenAiTuningServiceClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof GenAiTuningServiceClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.' + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'aiplatform.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' + ), + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + artifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' + ), + batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' + ), + contextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' + ), + customJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customJobs/{custom_job}' + ), + dataItemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' + ), + dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + datasetVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/datasetVersions/{dataset_version}' + ), + deploymentResourcePoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' + ), + extensionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/extensions/{extension}' + ), + featureGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featureGroups/{feature_group}' + ), + featureOnlineStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}' + ), + featureViewPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}' + ), + featureViewSyncPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}/featureViewSyncs/feature_view_sync' + ), + featurestorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}' + ), + hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' + ), + indexPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexes/{index}' + ), + indexEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' + ), + metadataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelDeploymentMonitoringJobPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' + ), + modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' + ), + modelMonitorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelMonitors/{model_monitor}' + ), + modelMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelMonitors/{model_monitor}/modelMonitoringJobs/{model_monitoring_job}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + notebookExecutionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/notebookExecutionJobs/{notebook_execution_job}' + ), + notebookRuntimePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/notebookRuntimes/{notebook_runtime}' + ), + notebookRuntimeTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}' + ), + persistentResourcePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/persistentResources/{persistent_resource}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationFeatureGroupFeaturePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featureGroups/{feature_group}/features/{feature}' + ), + projectLocationFeaturestoreEntityTypeFeaturePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), + publisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'publishers/{publisher}/models/{model}' + ), + ragCorpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}' + ), + ragFilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}' + ), + reasoningEnginePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}' + ), + savedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' + ), + schedulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/schedules/{schedule}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listTuningJobs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'tuningJobs' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1beta1.GenAiTuningService', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.genAiTuningServiceStub) { + return this.genAiTuningServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1beta1.GenAiTuningService. + this.genAiTuningServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.aiplatform.v1beta1.GenAiTuningService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1beta1 + .GenAiTuningService, + this._opts, + this._providedCustomServicePath + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const genAiTuningServiceStubMethods = [ + 'createTuningJob', + 'getTuningJob', + 'listTuningJobs', + 'cancelTuningJob', + ]; + for (const methodName of genAiTuningServiceStubMethods) { + const callPromise = this.genAiTuningServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.page[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.genAiTuningServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning' + ); + } + return 'aiplatform.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning' + ); + } + return 'aiplatform.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Creates a TuningJob. A created TuningJob right away will be attempted to + * be run. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to create the TuningJob in. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1beta1.TuningJob} request.tuningJob + * Required. The TuningJob to create. + * @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 {@link protos.google.cloud.aiplatform.v1beta1.TuningJob|TuningJob}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/gen_ai_tuning_service.create_tuning_job.js + * region_tag:aiplatform_v1beta1_generated_GenAiTuningService_CreateTuningJob_async + */ + createTuningJob( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateTuningJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.aiplatform.v1beta1.ITuningJob, + ( + | protos.google.cloud.aiplatform.v1beta1.ICreateTuningJobRequest + | undefined + ), + {} | undefined, + ] + >; + createTuningJob( + request: protos.google.cloud.aiplatform.v1beta1.ICreateTuningJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITuningJob, + | protos.google.cloud.aiplatform.v1beta1.ICreateTuningJobRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createTuningJob( + request: protos.google.cloud.aiplatform.v1beta1.ICreateTuningJobRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITuningJob, + | protos.google.cloud.aiplatform.v1beta1.ICreateTuningJobRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createTuningJob( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateTuningJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.aiplatform.v1beta1.ITuningJob, + | protos.google.cloud.aiplatform.v1beta1.ICreateTuningJobRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.ITuningJob, + | protos.google.cloud.aiplatform.v1beta1.ICreateTuningJobRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.aiplatform.v1beta1.ITuningJob, + ( + | protos.google.cloud.aiplatform.v1beta1.ICreateTuningJobRequest + | 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.createTuningJob(request, options, callback); + } + /** + * Gets a TuningJob. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the TuningJob resource. Format: + * `projects/{project}/locations/{location}/tuningJobs/{tuning_job}` + * @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 {@link protos.google.cloud.aiplatform.v1beta1.TuningJob|TuningJob}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/gen_ai_tuning_service.get_tuning_job.js + * region_tag:aiplatform_v1beta1_generated_GenAiTuningService_GetTuningJob_async + */ + getTuningJob( + request?: protos.google.cloud.aiplatform.v1beta1.IGetTuningJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.aiplatform.v1beta1.ITuningJob, + protos.google.cloud.aiplatform.v1beta1.IGetTuningJobRequest | undefined, + {} | undefined, + ] + >; + getTuningJob( + request: protos.google.cloud.aiplatform.v1beta1.IGetTuningJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITuningJob, + | protos.google.cloud.aiplatform.v1beta1.IGetTuningJobRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getTuningJob( + request: protos.google.cloud.aiplatform.v1beta1.IGetTuningJobRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITuningJob, + | protos.google.cloud.aiplatform.v1beta1.IGetTuningJobRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getTuningJob( + request?: protos.google.cloud.aiplatform.v1beta1.IGetTuningJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.aiplatform.v1beta1.ITuningJob, + | protos.google.cloud.aiplatform.v1beta1.IGetTuningJobRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.ITuningJob, + | protos.google.cloud.aiplatform.v1beta1.IGetTuningJobRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.aiplatform.v1beta1.ITuningJob, + protos.google.cloud.aiplatform.v1beta1.IGetTuningJobRequest | 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({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getTuningJob(request, options, callback); + } + /** + * Cancels a TuningJob. + * Starts asynchronous cancellation on the TuningJob. The server makes a best + * effort to cancel the job, but success is not guaranteed. Clients can use + * {@link protos.google.cloud.aiplatform.v1beta1.GenAiTuningService.GetTuningJob|GenAiTuningService.GetTuningJob} + * or other methods to check whether the cancellation succeeded or whether the + * job completed despite cancellation. On successful cancellation, the + * TuningJob is not deleted; instead it becomes a job with a + * {@link protos.google.cloud.aiplatform.v1beta1.TuningJob.error|TuningJob.error} value + * with a {@link protos.google.rpc.Status.code|google.rpc.Status.code} of 1, corresponding + * to `Code.CANCELLED`, and + * {@link protos.google.cloud.aiplatform.v1beta1.TuningJob.state|TuningJob.state} is set + * to `CANCELLED`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the TuningJob to cancel. Format: + * `projects/{project}/locations/{location}/tuningJobs/{tuning_job}` + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/gen_ai_tuning_service.cancel_tuning_job.js + * region_tag:aiplatform_v1beta1_generated_GenAiTuningService_CancelTuningJob_async + */ + cancelTuningJob( + request?: protos.google.cloud.aiplatform.v1beta1.ICancelTuningJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.aiplatform.v1beta1.ICancelTuningJobRequest + | undefined + ), + {} | undefined, + ] + >; + cancelTuningJob( + request: protos.google.cloud.aiplatform.v1beta1.ICancelTuningJobRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.aiplatform.v1beta1.ICancelTuningJobRequest + | null + | undefined, + {} | null | undefined + > + ): void; + cancelTuningJob( + request: protos.google.cloud.aiplatform.v1beta1.ICancelTuningJobRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.aiplatform.v1beta1.ICancelTuningJobRequest + | null + | undefined, + {} | null | undefined + > + ): void; + cancelTuningJob( + request?: protos.google.cloud.aiplatform.v1beta1.ICancelTuningJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.aiplatform.v1beta1.ICancelTuningJobRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.aiplatform.v1beta1.ICancelTuningJobRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.aiplatform.v1beta1.ICancelTuningJobRequest + | 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({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.cancelTuningJob(request, options, callback); + } + + /** + * Lists TuningJobs in a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the TuningJobs from. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. The standard list filter. + * @param {number} [request.pageSize] + * Optional. The standard list page size. + * @param {string} [request.pageToken] + * Optional. The standard list page token. + * Typically obtained via {@link protos.|ListTuningJob.next_page_token} of the + * previous GenAiTuningService.ListTuningJob][] call. + * @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 Array of {@link protos.google.cloud.aiplatform.v1beta1.TuningJob|TuningJob}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listTuningJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTuningJobs( + request?: protos.google.cloud.aiplatform.v1beta1.IListTuningJobsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.aiplatform.v1beta1.ITuningJob[], + protos.google.cloud.aiplatform.v1beta1.IListTuningJobsRequest | null, + protos.google.cloud.aiplatform.v1beta1.IListTuningJobsResponse, + ] + >; + listTuningJobs( + request: protos.google.cloud.aiplatform.v1beta1.IListTuningJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListTuningJobsRequest, + | protos.google.cloud.aiplatform.v1beta1.IListTuningJobsResponse + | null + | undefined, + protos.google.cloud.aiplatform.v1beta1.ITuningJob + > + ): void; + listTuningJobs( + request: protos.google.cloud.aiplatform.v1beta1.IListTuningJobsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListTuningJobsRequest, + | protos.google.cloud.aiplatform.v1beta1.IListTuningJobsResponse + | null + | undefined, + protos.google.cloud.aiplatform.v1beta1.ITuningJob + > + ): void; + listTuningJobs( + request?: protos.google.cloud.aiplatform.v1beta1.IListTuningJobsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListTuningJobsRequest, + | protos.google.cloud.aiplatform.v1beta1.IListTuningJobsResponse + | null + | undefined, + protos.google.cloud.aiplatform.v1beta1.ITuningJob + >, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListTuningJobsRequest, + | protos.google.cloud.aiplatform.v1beta1.IListTuningJobsResponse + | null + | undefined, + protos.google.cloud.aiplatform.v1beta1.ITuningJob + > + ): Promise< + [ + protos.google.cloud.aiplatform.v1beta1.ITuningJob[], + protos.google.cloud.aiplatform.v1beta1.IListTuningJobsRequest | null, + protos.google.cloud.aiplatform.v1beta1.IListTuningJobsResponse, + ] + > | 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.listTuningJobs(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the TuningJobs from. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. The standard list filter. + * @param {number} [request.pageSize] + * Optional. The standard list page size. + * @param {string} [request.pageToken] + * Optional. The standard list page token. + * Typically obtained via {@link protos.|ListTuningJob.next_page_token} of the + * previous GenAiTuningService.ListTuningJob][] call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.aiplatform.v1beta1.TuningJob|TuningJob} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listTuningJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTuningJobsStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListTuningJobsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + 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 ?? '', + }); + const defaultCallSettings = this._defaults['listTuningJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTuningJobs.createStream( + this.innerApiCalls.listTuningJobs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listTuningJobs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the TuningJobs from. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. The standard list filter. + * @param {number} [request.pageSize] + * Optional. The standard list page size. + * @param {string} [request.pageToken] + * Optional. The standard list page token. + * Typically obtained via {@link protos.|ListTuningJob.next_page_token} of the + * previous GenAiTuningService.ListTuningJob][] call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.aiplatform.v1beta1.TuningJob|TuningJob}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/gen_ai_tuning_service.list_tuning_jobs.js + * region_tag:aiplatform_v1beta1_generated_GenAiTuningService_ListTuningJobs_async + */ + listTuningJobsAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListTuningJobsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + 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 ?? '', + }); + const defaultCallSettings = this._defaults['listTuningJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTuningJobs.asyncIterate( + this.innerApiCalls['listTuningJobs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @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/interfaces/CallOptions.html | 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.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + + /** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath( + project: string, + location: string, + dataset: string, + dataItem: string, + annotation: string + ) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath( + project: string, + location: string, + dataset: string, + annotationSpec: string + ) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath( + project: string, + location: string, + metadataStore: string, + artifact: string + ) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName) + .metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath( + project: string, + location: string, + batchPredictionJob: string + ) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match( + batchPredictionJobName + ).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match( + batchPredictionJobName + ).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName( + batchPredictionJobName: string + ) { + return this.pathTemplates.batchPredictionJobPathTemplate.match( + batchPredictionJobName + ).batch_prediction_job; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath( + project: string, + location: string, + metadataStore: string, + context: string + ) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName) + .metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project: string, location: string, customJob: string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName) + .project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName) + .location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName) + .custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath( + project: string, + location: string, + dataset: string, + dataItem: string + ) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName) + .data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath( + project: string, + location: string, + dataLabelingJob: string + ) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match( + dataLabelingJobName + ).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match( + dataLabelingJobName + ).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match( + dataLabelingJobName + ).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project: string, location: string, dataset: string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified datasetVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} dataset_version + * @returns {string} Resource name string. + */ + datasetVersionPath( + project: string, + location: string, + dataset: string, + datasetVersion: string + ) { + return this.pathTemplates.datasetVersionPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + dataset_version: datasetVersion, + }); + } + + /** + * Parse the project from DatasetVersion resource. + * + * @param {string} datasetVersionName + * A fully-qualified path representing DatasetVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetVersionName(datasetVersionName: string) { + return this.pathTemplates.datasetVersionPathTemplate.match( + datasetVersionName + ).project; + } + + /** + * Parse the location from DatasetVersion resource. + * + * @param {string} datasetVersionName + * A fully-qualified path representing DatasetVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetVersionName(datasetVersionName: string) { + return this.pathTemplates.datasetVersionPathTemplate.match( + datasetVersionName + ).location; + } + + /** + * Parse the dataset from DatasetVersion resource. + * + * @param {string} datasetVersionName + * A fully-qualified path representing DatasetVersion resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetVersionName(datasetVersionName: string) { + return this.pathTemplates.datasetVersionPathTemplate.match( + datasetVersionName + ).dataset; + } + + /** + * Parse the dataset_version from DatasetVersion resource. + * + * @param {string} datasetVersionName + * A fully-qualified path representing DatasetVersion resource. + * @returns {string} A string representing the dataset_version. + */ + matchDatasetVersionFromDatasetVersionName(datasetVersionName: string) { + return this.pathTemplates.datasetVersionPathTemplate.match( + datasetVersionName + ).dataset_version; + } + + /** + * Return a fully-qualified deploymentResourcePool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment_resource_pool + * @returns {string} Resource name string. + */ + deploymentResourcePoolPath( + project: string, + location: string, + deploymentResourcePool: string + ) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ + project: project, + location: location, + deployment_resource_pool: deploymentResourcePool, + }); + } + + /** + * Parse the project from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentResourcePoolName( + deploymentResourcePoolName: string + ) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match( + deploymentResourcePoolName + ).project; + } + + /** + * Parse the location from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentResourcePoolName( + deploymentResourcePoolName: string + ) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match( + deploymentResourcePoolName + ).location; + } + + /** + * Parse the deployment_resource_pool from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the deployment_resource_pool. + */ + matchDeploymentResourcePoolFromDeploymentResourcePoolName( + deploymentResourcePoolName: string + ) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match( + deploymentResourcePoolName + ).deployment_resource_pool; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + featurestore: string, + entityType: string + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath( + project: string, + location: string, + metadataStore: string, + execution: string + ) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName) + .project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName) + .location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName) + .metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName) + .execution; + } + + /** + * Return a fully-qualified extension resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} extension + * @returns {string} Resource name string. + */ + extensionPath(project: string, location: string, extension: string) { + return this.pathTemplates.extensionPathTemplate.render({ + project: project, + location: location, + extension: extension, + }); + } + + /** + * Parse the project from Extension resource. + * + * @param {string} extensionName + * A fully-qualified path representing Extension resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExtensionName(extensionName: string) { + return this.pathTemplates.extensionPathTemplate.match(extensionName) + .project; + } + + /** + * Parse the location from Extension resource. + * + * @param {string} extensionName + * A fully-qualified path representing Extension resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExtensionName(extensionName: string) { + return this.pathTemplates.extensionPathTemplate.match(extensionName) + .location; + } + + /** + * Parse the extension from Extension resource. + * + * @param {string} extensionName + * A fully-qualified path representing Extension resource. + * @returns {string} A string representing the extension. + */ + matchExtensionFromExtensionName(extensionName: string) { + return this.pathTemplates.extensionPathTemplate.match(extensionName) + .extension; + } + + /** + * Return a fully-qualified featureGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} feature_group + * @returns {string} Resource name string. + */ + featureGroupPath(project: string, location: string, featureGroup: string) { + return this.pathTemplates.featureGroupPathTemplate.render({ + project: project, + location: location, + feature_group: featureGroup, + }); + } + + /** + * Parse the project from FeatureGroup resource. + * + * @param {string} featureGroupName + * A fully-qualified path representing FeatureGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureGroupName(featureGroupName: string) { + return this.pathTemplates.featureGroupPathTemplate.match(featureGroupName) + .project; + } + + /** + * Parse the location from FeatureGroup resource. + * + * @param {string} featureGroupName + * A fully-qualified path representing FeatureGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureGroupName(featureGroupName: string) { + return this.pathTemplates.featureGroupPathTemplate.match(featureGroupName) + .location; + } + + /** + * Parse the feature_group from FeatureGroup resource. + * + * @param {string} featureGroupName + * A fully-qualified path representing FeatureGroup resource. + * @returns {string} A string representing the feature_group. + */ + matchFeatureGroupFromFeatureGroupName(featureGroupName: string) { + return this.pathTemplates.featureGroupPathTemplate.match(featureGroupName) + .feature_group; + } + + /** + * Return a fully-qualified featureOnlineStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} feature_online_store + * @returns {string} Resource name string. + */ + featureOnlineStorePath( + project: string, + location: string, + featureOnlineStore: string + ) { + return this.pathTemplates.featureOnlineStorePathTemplate.render({ + project: project, + location: location, + feature_online_store: featureOnlineStore, + }); + } + + /** + * Parse the project from FeatureOnlineStore resource. + * + * @param {string} featureOnlineStoreName + * A fully-qualified path representing FeatureOnlineStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureOnlineStoreName(featureOnlineStoreName: string) { + return this.pathTemplates.featureOnlineStorePathTemplate.match( + featureOnlineStoreName + ).project; + } + + /** + * Parse the location from FeatureOnlineStore resource. + * + * @param {string} featureOnlineStoreName + * A fully-qualified path representing FeatureOnlineStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureOnlineStoreName(featureOnlineStoreName: string) { + return this.pathTemplates.featureOnlineStorePathTemplate.match( + featureOnlineStoreName + ).location; + } + + /** + * Parse the feature_online_store from FeatureOnlineStore resource. + * + * @param {string} featureOnlineStoreName + * A fully-qualified path representing FeatureOnlineStore resource. + * @returns {string} A string representing the feature_online_store. + */ + matchFeatureOnlineStoreFromFeatureOnlineStoreName( + featureOnlineStoreName: string + ) { + return this.pathTemplates.featureOnlineStorePathTemplate.match( + featureOnlineStoreName + ).feature_online_store; + } + + /** + * Return a fully-qualified featureView resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} feature_online_store + * @param {string} feature_view + * @returns {string} Resource name string. + */ + featureViewPath( + project: string, + location: string, + featureOnlineStore: string, + featureView: string + ) { + return this.pathTemplates.featureViewPathTemplate.render({ + project: project, + location: location, + feature_online_store: featureOnlineStore, + feature_view: featureView, + }); + } + + /** + * Parse the project from FeatureView resource. + * + * @param {string} featureViewName + * A fully-qualified path representing FeatureView resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureViewName(featureViewName: string) { + return this.pathTemplates.featureViewPathTemplate.match(featureViewName) + .project; + } + + /** + * Parse the location from FeatureView resource. + * + * @param {string} featureViewName + * A fully-qualified path representing FeatureView resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureViewName(featureViewName: string) { + return this.pathTemplates.featureViewPathTemplate.match(featureViewName) + .location; + } + + /** + * Parse the feature_online_store from FeatureView resource. + * + * @param {string} featureViewName + * A fully-qualified path representing FeatureView resource. + * @returns {string} A string representing the feature_online_store. + */ + matchFeatureOnlineStoreFromFeatureViewName(featureViewName: string) { + return this.pathTemplates.featureViewPathTemplate.match(featureViewName) + .feature_online_store; + } + + /** + * Parse the feature_view from FeatureView resource. + * + * @param {string} featureViewName + * A fully-qualified path representing FeatureView resource. + * @returns {string} A string representing the feature_view. + */ + matchFeatureViewFromFeatureViewName(featureViewName: string) { + return this.pathTemplates.featureViewPathTemplate.match(featureViewName) + .feature_view; + } + + /** + * Return a fully-qualified featureViewSync resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} feature_online_store + * @param {string} feature_view + * @returns {string} Resource name string. + */ + featureViewSyncPath( + project: string, + location: string, + featureOnlineStore: string, + featureView: string + ) { + return this.pathTemplates.featureViewSyncPathTemplate.render({ + project: project, + location: location, + feature_online_store: featureOnlineStore, + feature_view: featureView, + }); + } + + /** + * Parse the project from FeatureViewSync resource. + * + * @param {string} featureViewSyncName + * A fully-qualified path representing FeatureViewSync resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureViewSyncName(featureViewSyncName: string) { + return this.pathTemplates.featureViewSyncPathTemplate.match( + featureViewSyncName + ).project; + } + + /** + * Parse the location from FeatureViewSync resource. + * + * @param {string} featureViewSyncName + * A fully-qualified path representing FeatureViewSync resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureViewSyncName(featureViewSyncName: string) { + return this.pathTemplates.featureViewSyncPathTemplate.match( + featureViewSyncName + ).location; + } + + /** + * Parse the feature_online_store from FeatureViewSync resource. + * + * @param {string} featureViewSyncName + * A fully-qualified path representing FeatureViewSync resource. + * @returns {string} A string representing the feature_online_store. + */ + matchFeatureOnlineStoreFromFeatureViewSyncName(featureViewSyncName: string) { + return this.pathTemplates.featureViewSyncPathTemplate.match( + featureViewSyncName + ).feature_online_store; + } + + /** + * Parse the feature_view from FeatureViewSync resource. + * + * @param {string} featureViewSyncName + * A fully-qualified path representing FeatureViewSync resource. + * @returns {string} A string representing the feature_view. + */ + matchFeatureViewFromFeatureViewSyncName(featureViewSyncName: string) { + return this.pathTemplates.featureViewSyncPathTemplate.match( + featureViewSyncName + ).feature_view; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project: string, location: string, featurestore: string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName) + .project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName) + .location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName) + .featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath( + project: string, + location: string, + hyperparameterTuningJob: string + ) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName( + hyperparameterTuningJobName: string + ) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match( + hyperparameterTuningJobName + ).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName( + hyperparameterTuningJobName: string + ) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match( + hyperparameterTuningJobName + ).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName( + hyperparameterTuningJobName: string + ) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match( + hyperparameterTuningJobName + ).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project: string, location: string, index: string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project: string, location: string, indexEndpoint: string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName) + .project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName) + .location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName) + .index_endpoint; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath( + project: string, + location: string, + metadataStore: string, + metadataSchema: string + ) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match( + metadataSchemaName + ).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match( + metadataSchemaName + ).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match( + metadataSchemaName + ).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match( + metadataSchemaName + ).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project: string, location: string, metadataStore: string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName) + .project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName) + .location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName) + .metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project: string, location: string, model: string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath( + project: string, + location: string, + modelDeploymentMonitoringJob: string + ) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName( + modelDeploymentMonitoringJobName: string + ) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match( + modelDeploymentMonitoringJobName + ).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName( + modelDeploymentMonitoringJobName: string + ) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match( + modelDeploymentMonitoringJobName + ).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName( + modelDeploymentMonitoringJobName: string + ) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match( + modelDeploymentMonitoringJobName + ).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath( + project: string, + location: string, + model: string, + evaluation: string + ) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath( + project: string, + location: string, + model: string, + evaluation: string, + slice: string + ) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName( + modelEvaluationSliceName: string + ) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).slice; + } + + /** + * Return a fully-qualified modelMonitor resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_monitor + * @returns {string} Resource name string. + */ + modelMonitorPath(project: string, location: string, modelMonitor: string) { + return this.pathTemplates.modelMonitorPathTemplate.render({ + project: project, + location: location, + model_monitor: modelMonitor, + }); + } + + /** + * Parse the project from ModelMonitor resource. + * + * @param {string} modelMonitorName + * A fully-qualified path representing ModelMonitor resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelMonitorName(modelMonitorName: string) { + return this.pathTemplates.modelMonitorPathTemplate.match(modelMonitorName) + .project; + } + + /** + * Parse the location from ModelMonitor resource. + * + * @param {string} modelMonitorName + * A fully-qualified path representing ModelMonitor resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelMonitorName(modelMonitorName: string) { + return this.pathTemplates.modelMonitorPathTemplate.match(modelMonitorName) + .location; + } + + /** + * Parse the model_monitor from ModelMonitor resource. + * + * @param {string} modelMonitorName + * A fully-qualified path representing ModelMonitor resource. + * @returns {string} A string representing the model_monitor. + */ + matchModelMonitorFromModelMonitorName(modelMonitorName: string) { + return this.pathTemplates.modelMonitorPathTemplate.match(modelMonitorName) + .model_monitor; + } + + /** + * Return a fully-qualified modelMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_monitor + * @param {string} model_monitoring_job + * @returns {string} Resource name string. + */ + modelMonitoringJobPath( + project: string, + location: string, + modelMonitor: string, + modelMonitoringJob: string + ) { + return this.pathTemplates.modelMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_monitor: modelMonitor, + model_monitoring_job: modelMonitoringJob, + }); + } + + /** + * Parse the project from ModelMonitoringJob resource. + * + * @param {string} modelMonitoringJobName + * A fully-qualified path representing ModelMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelMonitoringJobName(modelMonitoringJobName: string) { + return this.pathTemplates.modelMonitoringJobPathTemplate.match( + modelMonitoringJobName + ).project; + } + + /** + * Parse the location from ModelMonitoringJob resource. + * + * @param {string} modelMonitoringJobName + * A fully-qualified path representing ModelMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelMonitoringJobName(modelMonitoringJobName: string) { + return this.pathTemplates.modelMonitoringJobPathTemplate.match( + modelMonitoringJobName + ).location; + } + + /** + * Parse the model_monitor from ModelMonitoringJob resource. + * + * @param {string} modelMonitoringJobName + * A fully-qualified path representing ModelMonitoringJob resource. + * @returns {string} A string representing the model_monitor. + */ + matchModelMonitorFromModelMonitoringJobName(modelMonitoringJobName: string) { + return this.pathTemplates.modelMonitoringJobPathTemplate.match( + modelMonitoringJobName + ).model_monitor; + } + + /** + * Parse the model_monitoring_job from ModelMonitoringJob resource. + * + * @param {string} modelMonitoringJobName + * A fully-qualified path representing ModelMonitoringJob resource. + * @returns {string} A string representing the model_monitoring_job. + */ + matchModelMonitoringJobFromModelMonitoringJobName( + modelMonitoringJobName: string + ) { + return this.pathTemplates.modelMonitoringJobPathTemplate.match( + modelMonitoringJobName + ).model_monitoring_job; + } + + /** + * Return a fully-qualified nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project: string, location: string, nasJob: string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath( + project: string, + location: string, + nasJob: string, + nasTrialDetail: string + ) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match( + nasTrialDetailName + ).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match( + nasTrialDetailName + ).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match( + nasTrialDetailName + ).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match( + nasTrialDetailName + ).nas_trial_detail; + } + + /** + * Return a fully-qualified notebookExecutionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} notebook_execution_job + * @returns {string} Resource name string. + */ + notebookExecutionJobPath( + project: string, + location: string, + notebookExecutionJob: string + ) { + return this.pathTemplates.notebookExecutionJobPathTemplate.render({ + project: project, + location: location, + notebook_execution_job: notebookExecutionJob, + }); + } + + /** + * Parse the project from NotebookExecutionJob resource. + * + * @param {string} notebookExecutionJobName + * A fully-qualified path representing NotebookExecutionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNotebookExecutionJobName(notebookExecutionJobName: string) { + return this.pathTemplates.notebookExecutionJobPathTemplate.match( + notebookExecutionJobName + ).project; + } + + /** + * Parse the location from NotebookExecutionJob resource. + * + * @param {string} notebookExecutionJobName + * A fully-qualified path representing NotebookExecutionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNotebookExecutionJobName(notebookExecutionJobName: string) { + return this.pathTemplates.notebookExecutionJobPathTemplate.match( + notebookExecutionJobName + ).location; + } + + /** + * Parse the notebook_execution_job from NotebookExecutionJob resource. + * + * @param {string} notebookExecutionJobName + * A fully-qualified path representing NotebookExecutionJob resource. + * @returns {string} A string representing the notebook_execution_job. + */ + matchNotebookExecutionJobFromNotebookExecutionJobName( + notebookExecutionJobName: string + ) { + return this.pathTemplates.notebookExecutionJobPathTemplate.match( + notebookExecutionJobName + ).notebook_execution_job; + } + + /** + * Return a fully-qualified notebookRuntime resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} notebook_runtime + * @returns {string} Resource name string. + */ + notebookRuntimePath( + project: string, + location: string, + notebookRuntime: string + ) { + return this.pathTemplates.notebookRuntimePathTemplate.render({ + project: project, + location: location, + notebook_runtime: notebookRuntime, + }); + } + + /** + * Parse the project from NotebookRuntime resource. + * + * @param {string} notebookRuntimeName + * A fully-qualified path representing NotebookRuntime resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNotebookRuntimeName(notebookRuntimeName: string) { + return this.pathTemplates.notebookRuntimePathTemplate.match( + notebookRuntimeName + ).project; + } + + /** + * Parse the location from NotebookRuntime resource. + * + * @param {string} notebookRuntimeName + * A fully-qualified path representing NotebookRuntime resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNotebookRuntimeName(notebookRuntimeName: string) { + return this.pathTemplates.notebookRuntimePathTemplate.match( + notebookRuntimeName + ).location; + } + + /** + * Parse the notebook_runtime from NotebookRuntime resource. + * + * @param {string} notebookRuntimeName + * A fully-qualified path representing NotebookRuntime resource. + * @returns {string} A string representing the notebook_runtime. + */ + matchNotebookRuntimeFromNotebookRuntimeName(notebookRuntimeName: string) { + return this.pathTemplates.notebookRuntimePathTemplate.match( + notebookRuntimeName + ).notebook_runtime; + } + + /** + * Return a fully-qualified notebookRuntimeTemplate resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} notebook_runtime_template + * @returns {string} Resource name string. + */ + notebookRuntimeTemplatePath( + project: string, + location: string, + notebookRuntimeTemplate: string + ) { + return this.pathTemplates.notebookRuntimeTemplatePathTemplate.render({ + project: project, + location: location, + notebook_runtime_template: notebookRuntimeTemplate, + }); + } + + /** + * Parse the project from NotebookRuntimeTemplate resource. + * + * @param {string} notebookRuntimeTemplateName + * A fully-qualified path representing NotebookRuntimeTemplate resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNotebookRuntimeTemplateName( + notebookRuntimeTemplateName: string + ) { + return this.pathTemplates.notebookRuntimeTemplatePathTemplate.match( + notebookRuntimeTemplateName + ).project; + } + + /** + * Parse the location from NotebookRuntimeTemplate resource. + * + * @param {string} notebookRuntimeTemplateName + * A fully-qualified path representing NotebookRuntimeTemplate resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNotebookRuntimeTemplateName( + notebookRuntimeTemplateName: string + ) { + return this.pathTemplates.notebookRuntimeTemplatePathTemplate.match( + notebookRuntimeTemplateName + ).location; + } + + /** + * Parse the notebook_runtime_template from NotebookRuntimeTemplate resource. + * + * @param {string} notebookRuntimeTemplateName + * A fully-qualified path representing NotebookRuntimeTemplate resource. + * @returns {string} A string representing the notebook_runtime_template. + */ + matchNotebookRuntimeTemplateFromNotebookRuntimeTemplateName( + notebookRuntimeTemplateName: string + ) { + return this.pathTemplates.notebookRuntimeTemplatePathTemplate.match( + notebookRuntimeTemplateName + ).notebook_runtime_template; + } + + /** + * Return a fully-qualified persistentResource resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} persistent_resource + * @returns {string} Resource name string. + */ + persistentResourcePath( + project: string, + location: string, + persistentResource: string + ) { + return this.pathTemplates.persistentResourcePathTemplate.render({ + project: project, + location: location, + persistent_resource: persistentResource, + }); + } + + /** + * Parse the project from PersistentResource resource. + * + * @param {string} persistentResourceName + * A fully-qualified path representing PersistentResource resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPersistentResourceName(persistentResourceName: string) { + return this.pathTemplates.persistentResourcePathTemplate.match( + persistentResourceName + ).project; + } + + /** + * Parse the location from PersistentResource resource. + * + * @param {string} persistentResourceName + * A fully-qualified path representing PersistentResource resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPersistentResourceName(persistentResourceName: string) { + return this.pathTemplates.persistentResourcePathTemplate.match( + persistentResourceName + ).location; + } + + /** + * Parse the persistent_resource from PersistentResource resource. + * + * @param {string} persistentResourceName + * A fully-qualified path representing PersistentResource resource. + * @returns {string} A string representing the persistent_resource. + */ + matchPersistentResourceFromPersistentResourceName( + persistentResourceName: string + ) { + return this.pathTemplates.persistentResourcePathTemplate.match( + persistentResourceName + ).persistent_resource; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project: string, location: string, pipelineJob: string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName) + .project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName) + .location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName) + .pipeline_job; + } + + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationFeatureGroupFeature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} feature_group + * @param {string} feature + * @returns {string} Resource name string. + */ + projectLocationFeatureGroupFeaturePath( + project: string, + location: string, + featureGroup: string, + feature: string + ) { + return this.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.render( + { + project: project, + location: location, + feature_group: featureGroup, + feature: feature, + } + ); + } + + /** + * Parse the project from ProjectLocationFeatureGroupFeature resource. + * + * @param {string} projectLocationFeatureGroupFeatureName + * A fully-qualified path representing project_location_feature_group_feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationFeatureGroupFeatureName( + projectLocationFeatureGroupFeatureName: string + ) { + return this.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.match( + projectLocationFeatureGroupFeatureName + ).project; + } + + /** + * Parse the location from ProjectLocationFeatureGroupFeature resource. + * + * @param {string} projectLocationFeatureGroupFeatureName + * A fully-qualified path representing project_location_feature_group_feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationFeatureGroupFeatureName( + projectLocationFeatureGroupFeatureName: string + ) { + return this.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.match( + projectLocationFeatureGroupFeatureName + ).location; + } + + /** + * Parse the feature_group from ProjectLocationFeatureGroupFeature resource. + * + * @param {string} projectLocationFeatureGroupFeatureName + * A fully-qualified path representing project_location_feature_group_feature resource. + * @returns {string} A string representing the feature_group. + */ + matchFeatureGroupFromProjectLocationFeatureGroupFeatureName( + projectLocationFeatureGroupFeatureName: string + ) { + return this.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.match( + projectLocationFeatureGroupFeatureName + ).feature_group; + } + + /** + * Parse the feature from ProjectLocationFeatureGroupFeature resource. + * + * @param {string} projectLocationFeatureGroupFeatureName + * A fully-qualified path representing project_location_feature_group_feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromProjectLocationFeatureGroupFeatureName( + projectLocationFeatureGroupFeatureName: string + ) { + return this.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.match( + projectLocationFeatureGroupFeatureName + ).feature; + } + + /** + * Return a fully-qualified projectLocationFeaturestoreEntityTypeFeature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + projectLocationFeaturestoreEntityTypeFeaturePath( + project: string, + location: string, + featurestore: string, + entityType: string, + feature: string + ) { + return this.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.render( + { + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + } + ); + } + + /** + * Parse the project from ProjectLocationFeaturestoreEntityTypeFeature resource. + * + * @param {string} projectLocationFeaturestoreEntityTypeFeatureName + * A fully-qualified path representing project_location_featurestore_entity_type_feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationFeaturestoreEntityTypeFeatureName( + projectLocationFeaturestoreEntityTypeFeatureName: string + ) { + return this.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.match( + projectLocationFeaturestoreEntityTypeFeatureName + ).project; + } + + /** + * Parse the location from ProjectLocationFeaturestoreEntityTypeFeature resource. + * + * @param {string} projectLocationFeaturestoreEntityTypeFeatureName + * A fully-qualified path representing project_location_featurestore_entity_type_feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationFeaturestoreEntityTypeFeatureName( + projectLocationFeaturestoreEntityTypeFeatureName: string + ) { + return this.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.match( + projectLocationFeaturestoreEntityTypeFeatureName + ).location; + } + + /** + * Parse the featurestore from ProjectLocationFeaturestoreEntityTypeFeature resource. + * + * @param {string} projectLocationFeaturestoreEntityTypeFeatureName + * A fully-qualified path representing project_location_featurestore_entity_type_feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromProjectLocationFeaturestoreEntityTypeFeatureName( + projectLocationFeaturestoreEntityTypeFeatureName: string + ) { + return this.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.match( + projectLocationFeaturestoreEntityTypeFeatureName + ).featurestore; + } + + /** + * Parse the entity_type from ProjectLocationFeaturestoreEntityTypeFeature resource. + * + * @param {string} projectLocationFeaturestoreEntityTypeFeatureName + * A fully-qualified path representing project_location_featurestore_entity_type_feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationFeaturestoreEntityTypeFeatureName( + projectLocationFeaturestoreEntityTypeFeatureName: string + ) { + return this.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.match( + projectLocationFeaturestoreEntityTypeFeatureName + ).entity_type; + } + + /** + * Parse the feature from ProjectLocationFeaturestoreEntityTypeFeature resource. + * + * @param {string} projectLocationFeaturestoreEntityTypeFeatureName + * A fully-qualified path representing project_location_featurestore_entity_type_feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromProjectLocationFeaturestoreEntityTypeFeatureName( + projectLocationFeaturestoreEntityTypeFeatureName: string + ) { + return this.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.match( + projectLocationFeaturestoreEntityTypeFeatureName + ).feature; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + + /** + * Return a fully-qualified publisherModel resource name string. + * + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + publisherModelPath(publisher: string, model: string) { + return this.pathTemplates.publisherModelPathTemplate.render({ + publisher: publisher, + model: model, + }); + } + + /** + * Parse the publisher from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).publisher; + } + + /** + * Parse the model from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the model. + */ + matchModelFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).model; + } + + /** + * Return a fully-qualified ragCorpus resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @returns {string} Resource name string. + */ + ragCorpusPath(project: string, location: string, ragCorpus: string) { + return this.pathTemplates.ragCorpusPathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + }); + } + + /** + * Parse the project from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .project; + } + + /** + * Parse the location from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .location; + } + + /** + * Parse the rag_corpus from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .rag_corpus; + } + + /** + * Return a fully-qualified ragFile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @param {string} rag_file + * @returns {string} Resource name string. + */ + ragFilePath( + project: string, + location: string, + ragCorpus: string, + ragFile: string + ) { + return this.pathTemplates.ragFilePathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + rag_file: ragFile, + }); + } + + /** + * Parse the project from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).project; + } + + /** + * Parse the location from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).location; + } + + /** + * Parse the rag_corpus from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_corpus; + } + + /** + * Parse the rag_file from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_file. + */ + matchRagFileFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_file; + } + + /** + * Return a fully-qualified reasoningEngine resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reasoning_engine + * @returns {string} Resource name string. + */ + reasoningEnginePath( + project: string, + location: string, + reasoningEngine: string + ) { + return this.pathTemplates.reasoningEnginePathTemplate.render({ + project: project, + location: location, + reasoning_engine: reasoningEngine, + }); + } + + /** + * Parse the project from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).project; + } + + /** + * Parse the location from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).location; + } + + /** + * Parse the reasoning_engine from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the reasoning_engine. + */ + matchReasoningEngineFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).reasoning_engine; + } + + /** + * Return a fully-qualified savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath( + project: string, + location: string, + dataset: string, + savedQuery: string + ) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName) + .project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName) + .location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName) + .dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName) + .saved_query; + } + + /** + * Return a fully-qualified schedule resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} schedule + * @returns {string} Resource name string. + */ + schedulePath(project: string, location: string, schedule: string) { + return this.pathTemplates.schedulePathTemplate.render({ + project: project, + location: location, + schedule: schedule, + }); + } + + /** + * Parse the project from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the project. + */ + matchProjectFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; + } + + /** + * Parse the location from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the location. + */ + matchLocationFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; + } + + /** + * Parse the schedule from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the schedule. + */ + matchScheduleFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath( + project: string, + location: string, + specialistPool: string + ) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match( + specialistPoolName + ).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match( + specialistPoolName + ).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match( + specialistPoolName + ).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project: string, location: string, study: string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project: string, location: string, tensorboard: string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName) + .project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName) + .location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName) + .tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath( + project: string, + location: string, + tensorboard: string, + experiment: string + ) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match( + tensorboardExperimentName + ).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName( + tensorboardExperimentName: string + ) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match( + tensorboardExperimentName + ).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName( + tensorboardExperimentName: string + ) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match( + tensorboardExperimentName + ).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName( + tensorboardExperimentName: string + ) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match( + tensorboardExperimentName + ).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath( + project: string, + location: string, + tensorboard: string, + experiment: string, + run: string + ) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath( + project: string, + location: string, + tensorboard: string, + experiment: string, + run: string, + timeSeries: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName( + tensorboardTimeSeriesName: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName( + tensorboardTimeSeriesName: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName( + tensorboardTimeSeriesName: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName( + tensorboardTimeSeriesName: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath( + project: string, + location: string, + trainingPipeline: string + ) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match( + trainingPipelineName + ).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match( + trainingPipelineName + ).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match( + trainingPipelineName + ).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project: string, location: string, study: string, trial: string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.genAiTuningServiceStub && !this._terminated) { + return this.genAiTuningServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.iamClient.close(); + this.locationsClient.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 new file mode 100644 index 00000000000..41eac2e9d50 --- /dev/null +++ b/packages/google-cloud-aiplatform/src/v1beta1/gen_ai_tuning_service_client_config.json @@ -0,0 +1,42 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1beta1.GenAiTuningService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateTuningJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetTuningJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListTuningJobs": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CancelTuningJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-aiplatform/src/v1beta1/gen_ai_tuning_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/gen_ai_tuning_service_proto_list.json new file mode 100644 index 00000000000..3311f6e20d8 --- /dev/null +++ b/packages/google-cloud-aiplatform/src/v1beta1/gen_ai_tuning_service_proto_list.json @@ -0,0 +1,168 @@ +[ + "../../protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1beta1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1beta1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1beta1/content.proto", + "../../protos/google/cloud/aiplatform/v1beta1/context.proto", + "../../protos/google/cloud/aiplatform/v1beta1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1beta1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/dataset_version.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1beta1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1beta1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1beta1/evaluated_annotation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/evaluation_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/event.proto", + "../../protos/google/cloud/aiplatform/v1beta1/execution.proto", + "../../protos/google/cloud/aiplatform/v1beta1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/extension.proto", + "../../protos/google/cloud/aiplatform/v1beta1/extension_execution_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/extension_registry_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_group.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_online_store.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_online_store_admin_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_online_store_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_registry_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_view.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_view_sync.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/io.proto", + "../../protos/google/cloud/aiplatform/v1beta1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1beta1/llm_utility_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1beta1/match_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1beta1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_garden_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_monitor.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_monitoring_alert.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_monitoring_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_monitoring_spec.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/nas_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/network_spec.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_euc_config.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_execution_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_idle_shutdown_config.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime_template_ref.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/openapi.proto", + "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto", + "../../protos/google/cloud/aiplatform/v1beta1/persistent_resource_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_failure_policy.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1beta1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/publisher_model.proto", + "../../protos/google/cloud/aiplatform/v1beta1/reasoning_engine.proto", + "../../protos/google/cloud/aiplatform/v1beta1/reasoning_engine_execution_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/reasoning_engine_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/saved_query.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schedule.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schedule_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1beta1/service_networking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/study.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tool.proto", + "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/types.proto", + "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1beta1/value.proto", + "../../protos/google/cloud/aiplatform/v1beta1/vertex_rag_data.proto", + "../../protos/google/cloud/aiplatform/v1beta1/vertex_rag_data_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/vertex_rag_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/vizier_service.proto" +] diff --git a/packages/google-cloud-aiplatform/src/v1beta1/index.ts b/packages/google-cloud-aiplatform/src/v1beta1/index.ts index 172e9e14064..dd0c05cb5f5 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/index.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/index.ts @@ -27,6 +27,7 @@ export {FeatureOnlineStoreServiceClient} from './feature_online_store_service_cl export {FeatureRegistryServiceClient} from './feature_registry_service_client'; export {FeaturestoreOnlineServingServiceClient} from './featurestore_online_serving_service_client'; export {FeaturestoreServiceClient} from './featurestore_service_client'; +export {GenAiTuningServiceClient} from './gen_ai_tuning_service_client'; export {IndexEndpointServiceClient} from './index_endpoint_service_client'; export {IndexServiceClient} from './index_service_client'; export {JobServiceClient} from './job_service_client'; diff --git a/packages/google-cloud-aiplatform/src/v1beta1/index_endpoint_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/index_endpoint_service_client.ts index aff2a5f5e1b..8d0bce139e0 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/index_endpoint_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/index_endpoint_service_client.ts @@ -383,6 +383,9 @@ export class IndexEndpointServiceClient { trialPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), }; // Some of the methods on this service return "paged" results, @@ -7436,6 +7439,58 @@ export class IndexEndpointServiceClient { return this.pathTemplates.trialPathTemplate.match(trialName).trial; } + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/index_endpoint_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/index_endpoint_service_proto_list.json index b6b7020e38d..3311f6e20d8 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/index_endpoint_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/index_endpoint_service_proto_list.json @@ -45,6 +45,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/index.proto", "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", @@ -155,6 +156,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", "../../protos/google/cloud/aiplatform/v1beta1/tool.proto", "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/types.proto", "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/index_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/index_service_client.ts index 113fa685160..a6ab5ad1353 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/index_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/index_service_client.ts @@ -383,6 +383,9 @@ export class IndexServiceClient { trialPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), }; // Some of the methods on this service return "paged" results, @@ -7181,6 +7184,58 @@ export class IndexServiceClient { return this.pathTemplates.trialPathTemplate.match(trialName).trial; } + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/index_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/index_service_proto_list.json index b6b7020e38d..3311f6e20d8 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/index_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/index_service_proto_list.json @@ -45,6 +45,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/index.proto", "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", @@ -155,6 +156,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", "../../protos/google/cloud/aiplatform/v1beta1/tool.proto", "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/types.proto", "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/job_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/job_service_client.ts index 3d56dbc7052..97500d8dfca 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/job_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/job_service_client.ts @@ -383,6 +383,9 @@ export class JobServiceClient { trialPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), }; // Some of the methods on this service return "paged" results, @@ -11535,6 +11538,58 @@ export class JobServiceClient { return this.pathTemplates.trialPathTemplate.match(trialName).trial; } + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/job_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/job_service_proto_list.json index b6b7020e38d..3311f6e20d8 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/job_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/job_service_proto_list.json @@ -45,6 +45,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/index.proto", "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", @@ -155,6 +156,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", "../../protos/google/cloud/aiplatform/v1beta1/tool.proto", "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/types.proto", "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/llm_utility_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/llm_utility_service_client.ts index 32deb6b38a6..9de1e5c2766 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/llm_utility_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/llm_utility_service_client.ts @@ -375,6 +375,9 @@ export class LlmUtilityServiceClient { trialPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), }; // Put together the default options sent with requests. @@ -4456,6 +4459,58 @@ export class LlmUtilityServiceClient { return this.pathTemplates.trialPathTemplate.match(trialName).trial; } + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/llm_utility_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/llm_utility_service_proto_list.json index b6b7020e38d..3311f6e20d8 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/llm_utility_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/llm_utility_service_proto_list.json @@ -45,6 +45,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/index.proto", "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", @@ -155,6 +156,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", "../../protos/google/cloud/aiplatform/v1beta1/tool.proto", "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/types.proto", "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/match_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/match_service_client.ts index 27c85146aba..19c1bda4254 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/match_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/match_service_client.ts @@ -376,6 +376,9 @@ export class MatchServiceClient { trialPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), }; // Put together the default options sent with requests. @@ -4570,6 +4573,58 @@ export class MatchServiceClient { return this.pathTemplates.trialPathTemplate.match(trialName).trial; } + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/match_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/match_service_proto_list.json index b6b7020e38d..3311f6e20d8 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/match_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/match_service_proto_list.json @@ -45,6 +45,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/index.proto", "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", @@ -155,6 +156,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", "../../protos/google/cloud/aiplatform/v1beta1/tool.proto", "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/types.proto", "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/metadata_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/metadata_service_client.ts index c22ebb6da4b..bc17616c6e0 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/metadata_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/metadata_service_client.ts @@ -386,6 +386,9 @@ export class MetadataServiceClient { trialPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), }; // Some of the methods on this service return "paged" results, @@ -10944,6 +10947,58 @@ export class MetadataServiceClient { return this.pathTemplates.trialPathTemplate.match(trialName).trial; } + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/metadata_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/metadata_service_proto_list.json index b6b7020e38d..3311f6e20d8 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/metadata_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/metadata_service_proto_list.json @@ -45,6 +45,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/index.proto", "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", @@ -155,6 +156,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", "../../protos/google/cloud/aiplatform/v1beta1/tool.proto", "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/types.proto", "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/migration_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/migration_service_client.ts index 2dcfdf2c3a8..a3b3770990e 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/migration_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/migration_service_client.ts @@ -384,6 +384,9 @@ export class MigrationServiceClient { trialPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), }; // Some of the methods on this service return "paged" results, @@ -6610,6 +6613,58 @@ export class MigrationServiceClient { return this.pathTemplates.trialPathTemplate.match(trialName).trial; } + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/migration_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/migration_service_proto_list.json index b6b7020e38d..3311f6e20d8 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/migration_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/migration_service_proto_list.json @@ -45,6 +45,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/index.proto", "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", @@ -155,6 +156,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", "../../protos/google/cloud/aiplatform/v1beta1/tool.proto", "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/types.proto", "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/model_garden_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/model_garden_service_client.ts index fa39766d096..142ac141d62 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/model_garden_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/model_garden_service_client.ts @@ -377,6 +377,9 @@ export class ModelGardenServiceClient { trialPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), }; // Some of the methods on this service return "paged" results, @@ -4717,6 +4720,58 @@ export class ModelGardenServiceClient { return this.pathTemplates.trialPathTemplate.match(trialName).trial; } + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/model_garden_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/model_garden_service_proto_list.json index b6b7020e38d..3311f6e20d8 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/model_garden_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/model_garden_service_proto_list.json @@ -45,6 +45,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/index.proto", "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", @@ -155,6 +156,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", "../../protos/google/cloud/aiplatform/v1beta1/tool.proto", "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/types.proto", "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/model_monitoring_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/model_monitoring_service_client.ts index fc63c9a6e92..49f69d21004 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/model_monitoring_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/model_monitoring_service_client.ts @@ -385,6 +385,9 @@ export class ModelMonitoringServiceClient { trialPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), }; // Some of the methods on this service return "paged" results, @@ -8026,6 +8029,58 @@ export class ModelMonitoringServiceClient { return this.pathTemplates.trialPathTemplate.match(trialName).trial; } + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/model_monitoring_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/model_monitoring_service_proto_list.json index b6b7020e38d..3311f6e20d8 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/model_monitoring_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/model_monitoring_service_proto_list.json @@ -45,6 +45,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/index.proto", "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", @@ -155,6 +156,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", "../../protos/google/cloud/aiplatform/v1beta1/tool.proto", "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/types.proto", "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/model_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/model_service_client.ts index 3e6d8efb0cb..59a35e2ad9e 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/model_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/model_service_client.ts @@ -383,6 +383,9 @@ export class ModelServiceClient { trialPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), }; // Some of the methods on this service return "paged" results, @@ -9014,6 +9017,58 @@ export class ModelServiceClient { return this.pathTemplates.trialPathTemplate.match(trialName).trial; } + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/model_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/model_service_proto_list.json index b6b7020e38d..3311f6e20d8 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/model_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/model_service_proto_list.json @@ -45,6 +45,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/index.proto", "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", @@ -155,6 +156,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", "../../protos/google/cloud/aiplatform/v1beta1/tool.proto", "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/types.proto", "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/notebook_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/notebook_service_client.ts index e078ef52876..ec6dbfb2694 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/notebook_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/notebook_service_client.ts @@ -383,6 +383,9 @@ export class NotebookServiceClient { trialPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), }; // Some of the methods on this service return "paged" results, @@ -8560,6 +8563,58 @@ export class NotebookServiceClient { return this.pathTemplates.trialPathTemplate.match(trialName).trial; } + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/notebook_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/notebook_service_proto_list.json index b6b7020e38d..3311f6e20d8 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/notebook_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/notebook_service_proto_list.json @@ -45,6 +45,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/index.proto", "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", @@ -155,6 +156,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", "../../protos/google/cloud/aiplatform/v1beta1/tool.proto", "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/types.proto", "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/persistent_resource_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/persistent_resource_service_client.ts index 347306507ba..08d53ebba09 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/persistent_resource_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/persistent_resource_service_client.ts @@ -384,6 +384,9 @@ export class PersistentResourceServiceClient { trialPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), }; // Some of the methods on this service return "paged" results, @@ -7153,6 +7156,58 @@ export class PersistentResourceServiceClient { return this.pathTemplates.trialPathTemplate.match(trialName).trial; } + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/persistent_resource_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/persistent_resource_service_proto_list.json index b6b7020e38d..3311f6e20d8 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/persistent_resource_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/persistent_resource_service_proto_list.json @@ -45,6 +45,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/index.proto", "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", @@ -155,6 +156,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", "../../protos/google/cloud/aiplatform/v1beta1/tool.proto", "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/types.proto", "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/pipeline_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/pipeline_service_client.ts index ee7258365e5..ebd6d957b8c 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/pipeline_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/pipeline_service_client.ts @@ -388,6 +388,9 @@ export class PipelineServiceClient { trialPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), }; // Some of the methods on this service return "paged" results, @@ -8141,6 +8144,58 @@ export class PipelineServiceClient { return this.pathTemplates.trialPathTemplate.match(trialName).trial; } + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/pipeline_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/pipeline_service_proto_list.json index b6b7020e38d..3311f6e20d8 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/pipeline_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/pipeline_service_proto_list.json @@ -45,6 +45,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/index.proto", "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", @@ -155,6 +156,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", "../../protos/google/cloud/aiplatform/v1beta1/tool.proto", "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/types.proto", "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/prediction_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/prediction_service_client.ts index 6e64e863ead..d085c0bfb8e 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/prediction_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/prediction_service_client.ts @@ -375,6 +375,9 @@ export class PredictionServiceClient { trialPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), }; // Some of the methods on this service provide streaming responses. @@ -383,32 +386,32 @@ export class PredictionServiceClient { streamDirectPredict: new this._gaxModule.StreamDescriptor( this._gaxModule.StreamType.BIDI_STREAMING, !!opts.fallback, - /* gaxStreamingRetries: */ false + !!opts.gaxServerStreamingRetries ), streamDirectRawPredict: new this._gaxModule.StreamDescriptor( this._gaxModule.StreamType.BIDI_STREAMING, !!opts.fallback, - /* gaxStreamingRetries: */ false + !!opts.gaxServerStreamingRetries ), streamingPredict: new this._gaxModule.StreamDescriptor( this._gaxModule.StreamType.BIDI_STREAMING, !!opts.fallback, - /* gaxStreamingRetries: */ false + !!opts.gaxServerStreamingRetries ), serverStreamingPredict: new this._gaxModule.StreamDescriptor( this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback, - /* gaxStreamingRetries: */ false + !!opts.gaxServerStreamingRetries ), streamingRawPredict: new this._gaxModule.StreamDescriptor( this._gaxModule.StreamType.BIDI_STREAMING, !!opts.fallback, - /* gaxStreamingRetries: */ false + !!opts.gaxServerStreamingRetries ), streamGenerateContent: new this._gaxModule.StreamDescriptor( this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback, - /* gaxStreamingRetries: */ false + !!opts.gaxServerStreamingRetries ), }; @@ -5384,6 +5387,58 @@ export class PredictionServiceClient { return this.pathTemplates.trialPathTemplate.match(trialName).trial; } + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/prediction_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/prediction_service_proto_list.json index b6b7020e38d..3311f6e20d8 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/prediction_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/prediction_service_proto_list.json @@ -45,6 +45,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/index.proto", "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", @@ -155,6 +156,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", "../../protos/google/cloud/aiplatform/v1beta1/tool.proto", "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/types.proto", "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/reasoning_engine_execution_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/reasoning_engine_execution_service_client.ts index bf73a0a6850..43a972fd412 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/reasoning_engine_execution_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/reasoning_engine_execution_service_client.ts @@ -376,6 +376,9 @@ export class ReasoningEngineExecutionServiceClient { trialPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), }; // Put together the default options sent with requests. @@ -4463,6 +4466,58 @@ export class ReasoningEngineExecutionServiceClient { return this.pathTemplates.trialPathTemplate.match(trialName).trial; } + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/reasoning_engine_execution_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/reasoning_engine_execution_service_proto_list.json index b6b7020e38d..3311f6e20d8 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/reasoning_engine_execution_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/reasoning_engine_execution_service_proto_list.json @@ -45,6 +45,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/index.proto", "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", @@ -155,6 +156,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", "../../protos/google/cloud/aiplatform/v1beta1/tool.proto", "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/types.proto", "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/reasoning_engine_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/reasoning_engine_service_client.ts index 798a0811f98..0a2eb795601 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/reasoning_engine_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/reasoning_engine_service_client.ts @@ -384,6 +384,9 @@ export class ReasoningEngineServiceClient { trialPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), }; // Some of the methods on this service return "paged" results, @@ -6810,6 +6813,58 @@ export class ReasoningEngineServiceClient { return this.pathTemplates.trialPathTemplate.match(trialName).trial; } + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/reasoning_engine_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/reasoning_engine_service_proto_list.json index b6b7020e38d..3311f6e20d8 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/reasoning_engine_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/reasoning_engine_service_proto_list.json @@ -45,6 +45,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/index.proto", "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", @@ -155,6 +156,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", "../../protos/google/cloud/aiplatform/v1beta1/tool.proto", "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/types.proto", "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/schedule_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/schedule_service_client.ts index 80f398ab529..6c3e958135d 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/schedule_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/schedule_service_client.ts @@ -384,6 +384,9 @@ export class ScheduleServiceClient { trialPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), }; // Some of the methods on this service return "paged" results, @@ -7205,6 +7208,58 @@ export class ScheduleServiceClient { return this.pathTemplates.trialPathTemplate.match(trialName).trial; } + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/schedule_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/schedule_service_proto_list.json index b6b7020e38d..3311f6e20d8 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/schedule_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/schedule_service_proto_list.json @@ -45,6 +45,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/index.proto", "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", @@ -155,6 +156,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", "../../protos/google/cloud/aiplatform/v1beta1/tool.proto", "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/types.proto", "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/specialist_pool_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/specialist_pool_service_client.ts index 6464a848f55..d1576e86ad4 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/specialist_pool_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/specialist_pool_service_client.ts @@ -389,6 +389,9 @@ export class SpecialistPoolServiceClient { trialPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), }; // Some of the methods on this service return "paged" results, @@ -6976,6 +6979,58 @@ export class SpecialistPoolServiceClient { return this.pathTemplates.trialPathTemplate.match(trialName).trial; } + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/specialist_pool_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/specialist_pool_service_proto_list.json index b6b7020e38d..3311f6e20d8 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/specialist_pool_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/specialist_pool_service_proto_list.json @@ -45,6 +45,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/index.proto", "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", @@ -155,6 +156,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", "../../protos/google/cloud/aiplatform/v1beta1/tool.proto", "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/types.proto", "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/tensorboard_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/tensorboard_service_client.ts index 339d92dbddf..eaf1d7a69d8 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/tensorboard_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/tensorboard_service_client.ts @@ -386,6 +386,9 @@ export class TensorboardServiceClient { trialPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), }; // Some of the methods on this service return "paged" results, @@ -425,7 +428,7 @@ export class TensorboardServiceClient { readTensorboardBlobData: new this._gaxModule.StreamDescriptor( this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback, - /* gaxStreamingRetries: */ false + !!opts.gaxServerStreamingRetries ), }; @@ -10357,6 +10360,58 @@ export class TensorboardServiceClient { return this.pathTemplates.trialPathTemplate.match(trialName).trial; } + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/tensorboard_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/tensorboard_service_proto_list.json index b6b7020e38d..3311f6e20d8 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/tensorboard_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/tensorboard_service_proto_list.json @@ -45,6 +45,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/index.proto", "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", @@ -155,6 +156,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", "../../protos/google/cloud/aiplatform/v1beta1/tool.proto", "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/types.proto", "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/vertex_rag_data_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/vertex_rag_data_service_client.ts index c1ca44f72cf..8797904ac3e 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/vertex_rag_data_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/vertex_rag_data_service_client.ts @@ -383,6 +383,9 @@ export class VertexRagDataServiceClient { trialPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), }; // Some of the methods on this service return "paged" results, @@ -7517,6 +7520,58 @@ export class VertexRagDataServiceClient { return this.pathTemplates.trialPathTemplate.match(trialName).trial; } + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/vertex_rag_data_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/vertex_rag_data_service_proto_list.json index b6b7020e38d..3311f6e20d8 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/vertex_rag_data_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/vertex_rag_data_service_proto_list.json @@ -45,6 +45,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/index.proto", "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", @@ -155,6 +156,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", "../../protos/google/cloud/aiplatform/v1beta1/tool.proto", "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/types.proto", "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/vertex_rag_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/vertex_rag_service_client.ts index e3270b68d31..65eb13b86ed 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/vertex_rag_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/vertex_rag_service_client.ts @@ -378,6 +378,9 @@ export class VertexRagServiceClient { trialPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), }; // Put together the default options sent with requests. @@ -4503,6 +4506,58 @@ export class VertexRagServiceClient { return this.pathTemplates.trialPathTemplate.match(trialName).trial; } + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/vertex_rag_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/vertex_rag_service_proto_list.json index b6b7020e38d..3311f6e20d8 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/vertex_rag_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/vertex_rag_service_proto_list.json @@ -45,6 +45,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/index.proto", "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", @@ -155,6 +156,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", "../../protos/google/cloud/aiplatform/v1beta1/tool.proto", "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/types.proto", "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/vizier_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/vizier_service_client.ts index 0ce7540920c..ed32086de4c 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/vizier_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/vizier_service_client.ts @@ -387,6 +387,9 @@ export class VizierServiceClient { trialPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), }; // Some of the methods on this service return "paged" results, @@ -8018,6 +8021,58 @@ export class VizierServiceClient { return this.pathTemplates.trialPathTemplate.match(trialName).trial; } + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/vizier_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/vizier_service_proto_list.json index b6b7020e38d..3311f6e20d8 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/vizier_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/vizier_service_proto_list.json @@ -45,6 +45,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/index.proto", "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", @@ -155,6 +156,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", "../../protos/google/cloud/aiplatform/v1beta1/tool.proto", "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tuning_job.proto", "../../protos/google/cloud/aiplatform/v1beta1/types.proto", "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", diff --git a/packages/google-cloud-aiplatform/test/gapic_dataset_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_dataset_service_v1beta1.ts index 6bd3daaceca..4f1e12eb5de 100644 --- a/packages/google-cloud-aiplatform/test/gapic_dataset_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_dataset_service_v1beta1.ts @@ -9583,5 +9583,69 @@ describe('v1beta1.DatasetServiceClient', () => { ); }); }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-aiplatform/test/gapic_deployment_resource_pool_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_deployment_resource_pool_service_v1beta1.ts index cd7b5abda76..08ccbc70f69 100644 --- a/packages/google-cloud-aiplatform/test/gapic_deployment_resource_pool_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_deployment_resource_pool_service_v1beta1.ts @@ -7028,5 +7028,72 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ); }); }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = + new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-aiplatform/test/gapic_endpoint_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_endpoint_service_v1beta1.ts index 0541daba22c..ce8c077ee60 100644 --- a/packages/google-cloud-aiplatform/test/gapic_endpoint_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_endpoint_service_v1beta1.ts @@ -6960,5 +6960,69 @@ describe('v1beta1.EndpointServiceClient', () => { ); }); }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-aiplatform/test/gapic_evaluation_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_evaluation_service_v1beta1.ts index 13824068221..d5e40bbb1c5 100644 --- a/packages/google-cloud-aiplatform/test/gapic_evaluation_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_evaluation_service_v1beta1.ts @@ -5236,5 +5236,70 @@ describe('v1beta1.EvaluationServiceClient', () => { ); }); }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = + new evaluationserviceModule.v1beta1.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-aiplatform/test/gapic_extension_execution_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_extension_execution_service_v1beta1.ts index 4f690e62677..ad01c0693bc 100644 --- a/packages/google-cloud-aiplatform/test/gapic_extension_execution_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_extension_execution_service_v1beta1.ts @@ -5489,5 +5489,72 @@ describe('v1beta1.ExtensionExecutionServiceClient', () => { ); }); }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = + new extensionexecutionserviceModule.v1beta1.ExtensionExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-aiplatform/test/gapic_extension_registry_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_extension_registry_service_v1beta1.ts index 91453d4c8ae..db69544dcb2 100644 --- a/packages/google-cloud-aiplatform/test/gapic_extension_registry_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_extension_registry_service_v1beta1.ts @@ -6734,5 +6734,72 @@ describe('v1beta1.ExtensionRegistryServiceClient', () => { ); }); }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = + new extensionregistryserviceModule.v1beta1.ExtensionRegistryServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-aiplatform/test/gapic_feature_online_store_admin_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_feature_online_store_admin_service_v1beta1.ts index 244de8b4419..a64be231c05 100644 --- a/packages/google-cloud-aiplatform/test/gapic_feature_online_store_admin_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_feature_online_store_admin_service_v1beta1.ts @@ -8671,5 +8671,72 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ); }); }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = + new featureonlinestoreadminserviceModule.v1beta1.FeatureOnlineStoreAdminServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-aiplatform/test/gapic_feature_online_store_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_feature_online_store_service_v1beta1.ts index 8d73cba9e10..3838e044865 100644 --- a/packages/google-cloud-aiplatform/test/gapic_feature_online_store_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_feature_online_store_service_v1beta1.ts @@ -5609,5 +5609,72 @@ describe('v1beta1.FeatureOnlineStoreServiceClient', () => { ); }); }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = + new featureonlinestoreserviceModule.v1beta1.FeatureOnlineStoreServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-aiplatform/test/gapic_feature_registry_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_feature_registry_service_v1beta1.ts index c7fe6597dfc..7e46970dbe0 100644 --- a/packages/google-cloud-aiplatform/test/gapic_feature_registry_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_feature_registry_service_v1beta1.ts @@ -7686,5 +7686,70 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ); }); }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = + new featureregistryserviceModule.v1beta1.FeatureRegistryServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-aiplatform/test/gapic_featurestore_online_serving_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_featurestore_online_serving_service_v1.ts index da72bd115a2..dec486f3410 100644 --- a/packages/google-cloud-aiplatform/test/gapic_featurestore_online_serving_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_featurestore_online_serving_service_v1.ts @@ -657,6 +657,52 @@ describe('v1.FeaturestoreOnlineServingServiceClient', () => { assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); + it('invokes streamingReadFeatureValues without error and gaxServerStreamingRetries enabled', async () => { + const client = + new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient( + {gaxServerStreamingRetries: true} + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.StreamingReadFeatureValuesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.StreamingReadFeatureValuesRequest', + ['entityType'] + ); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ReadFeatureValuesResponse() + ); + client.innerApiCalls.streamingReadFeatureValues = + stubServerStreamingCall(expectedResponse); + const stream = client.streamingReadFeatureValues(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.aiplatform.v1.ReadFeatureValuesResponse + ) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.streamingReadFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.streamingReadFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + it('invokes streamingReadFeatureValues with error', async () => { const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient( @@ -742,6 +788,15 @@ describe('v1.FeaturestoreOnlineServingServiceClient', () => { }); await assert.rejects(promise, expectedError); }); + it('should create a client with gaxServerStreamingRetries enabled', () => { + const client = + new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient( + { + gaxServerStreamingRetries: true, + } + ); + assert(client); + }); }); describe('getIamPolicy', () => { it('invokes getIamPolicy without error', async () => { diff --git a/packages/google-cloud-aiplatform/test/gapic_featurestore_online_serving_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_featurestore_online_serving_service_v1beta1.ts index 11415dcd3f1..f82b2ef9650 100644 --- a/packages/google-cloud-aiplatform/test/gapic_featurestore_online_serving_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_featurestore_online_serving_service_v1beta1.ts @@ -657,6 +657,52 @@ describe('v1beta1.FeaturestoreOnlineServingServiceClient', () => { assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); + it('invokes streamingReadFeatureValues without error and gaxServerStreamingRetries enabled', async () => { + const client = + new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient( + {gaxServerStreamingRetries: true} + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.StreamingReadFeatureValuesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.StreamingReadFeatureValuesRequest', + ['entityType'] + ); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse() + ); + client.innerApiCalls.streamingReadFeatureValues = + stubServerStreamingCall(expectedResponse); + const stream = client.streamingReadFeatureValues(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse + ) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.streamingReadFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.streamingReadFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + it('invokes streamingReadFeatureValues with error', async () => { const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient( @@ -742,6 +788,15 @@ describe('v1beta1.FeaturestoreOnlineServingServiceClient', () => { }); await assert.rejects(promise, expectedError); }); + it('should create a client with gaxServerStreamingRetries enabled', () => { + const client = + new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient( + { + gaxServerStreamingRetries: true, + } + ); + assert(client); + }); }); describe('getIamPolicy', () => { it('invokes getIamPolicy without error', async () => { @@ -5656,5 +5711,72 @@ describe('v1beta1.FeaturestoreOnlineServingServiceClient', () => { ); }); }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = + new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-aiplatform/test/gapic_featurestore_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_featurestore_service_v1beta1.ts index 5c27acd7341..4189f44fdb9 100644 --- a/packages/google-cloud-aiplatform/test/gapic_featurestore_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_featurestore_service_v1beta1.ts @@ -9963,5 +9963,70 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ); }); }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = + new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); 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 new file mode 100644 index 00000000000..b38aca36f18 --- /dev/null +++ b/packages/google-cloud-aiplatform/test/gapic_gen_ai_tuning_service_v1beta1.ts @@ -0,0 +1,5949 @@ +// 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. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as genaituningserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1beta1.GenAiTuningServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'aiplatform.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + genaituningserviceModule.v1beta1.GenAiTuningServiceClient.servicePath; + assert.strictEqual(servicePath, 'aiplatform.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + genaituningserviceModule.v1beta1.GenAiTuningServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'aiplatform.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'aiplatform.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'aiplatform.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'aiplatform.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'aiplatform.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = + genaituningserviceModule.v1beta1.GenAiTuningServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.genAiTuningServiceStub, undefined); + await client.initialize(); + assert(client.genAiTuningServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.genAiTuningServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.genAiTuningServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('createTuningJob', () => { + it('invokes createTuningJob 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.CreateTuningJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.CreateTuningJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.TuningJob() + ); + client.innerApiCalls.createTuningJob = stubSimpleCall(expectedResponse); + const [response] = await client.createTuningJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTuningJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTuningJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTuningJob 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.CreateTuningJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.CreateTuningJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.TuningJob() + ); + client.innerApiCalls.createTuningJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTuningJob( + request, + ( + err?: Error | null, + result?: protos.google.cloud.aiplatform.v1beta1.ITuningJob | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTuningJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTuningJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTuningJob with 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.CreateTuningJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.CreateTuningJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTuningJob = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createTuningJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createTuningJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTuningJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTuningJob with closed client', 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.CreateTuningJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.CreateTuningJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createTuningJob(request), expectedError); + }); + }); + + describe('getTuningJob', () => { + it('invokes getTuningJob 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.GetTuningJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.GetTuningJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.TuningJob() + ); + client.innerApiCalls.getTuningJob = stubSimpleCall(expectedResponse); + const [response] = await client.getTuningJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTuningJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTuningJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTuningJob 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.GetTuningJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.GetTuningJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.TuningJob() + ); + client.innerApiCalls.getTuningJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTuningJob( + request, + ( + err?: Error | null, + result?: protos.google.cloud.aiplatform.v1beta1.ITuningJob | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTuningJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTuningJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTuningJob with 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.GetTuningJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.GetTuningJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTuningJob = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getTuningJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getTuningJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTuningJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTuningJob with closed client', 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.GetTuningJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.GetTuningJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTuningJob(request), expectedError); + }); + }); + + describe('cancelTuningJob', () => { + it('invokes cancelTuningJob 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.CancelTuningJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.CancelTuningJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.cancelTuningJob = stubSimpleCall(expectedResponse); + const [response] = await client.cancelTuningJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.cancelTuningJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelTuningJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelTuningJob 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.CancelTuningJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.CancelTuningJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.cancelTuningJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cancelTuningJob( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.cancelTuningJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelTuningJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelTuningJob with 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.CancelTuningJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.CancelTuningJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelTuningJob = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.cancelTuningJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.cancelTuningJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelTuningJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelTuningJob with closed client', 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.CancelTuningJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.CancelTuningJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.cancelTuningJob(request), expectedError); + }); + }); + + describe('listTuningJobs', () => { + it('invokes listTuningJobs 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.ListTuningJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.ListTuningJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.TuningJob() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.TuningJob() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.TuningJob() + ), + ]; + client.innerApiCalls.listTuningJobs = stubSimpleCall(expectedResponse); + const [response] = await client.listTuningJobs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTuningJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTuningJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTuningJobs 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.ListTuningJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.ListTuningJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.TuningJob() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.TuningJob() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.TuningJob() + ), + ]; + client.innerApiCalls.listTuningJobs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTuningJobs( + request, + ( + err?: Error | null, + result?: protos.google.cloud.aiplatform.v1beta1.ITuningJob[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTuningJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTuningJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTuningJobs with 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.ListTuningJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.ListTuningJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTuningJobs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listTuningJobs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listTuningJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTuningJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTuningJobsStream 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.ListTuningJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.ListTuningJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.TuningJob() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.TuningJob() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.TuningJob() + ), + ]; + client.descriptors.page.listTuningJobs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listTuningJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.TuningJob[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.aiplatform.v1beta1.TuningJob) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listTuningJobs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTuningJobs, request) + ); + assert( + (client.descriptors.page.listTuningJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('invokes listTuningJobsStream with 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.ListTuningJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.ListTuningJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTuningJobs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listTuningJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.TuningJob[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.aiplatform.v1beta1.TuningJob) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listTuningJobs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTuningJobs, request) + ); + assert( + (client.descriptors.page.listTuningJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listTuningJobs 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.ListTuningJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.ListTuningJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.TuningJob() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.TuningJob() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.TuningJob() + ), + ]; + client.descriptors.page.listTuningJobs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.ITuningJob[] = []; + const iterable = client.listTuningJobsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listTuningJobs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listTuningJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listTuningJobs with 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.ListTuningJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.ListTuningJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTuningJobs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTuningJobsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.ITuningJob[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listTuningJobs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listTuningJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub).getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.getIamPolicy(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub).getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.setIamPolicy(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions( + request, + expectedOptions + ); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.TestIamPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub).getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.testIamPermissions(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('annotation', () => { + const fakePath = '/rendered/path/annotation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + data_item: 'dataItemValue', + annotation: 'annotationValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'dataItemValue', + 'annotationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, 'dataItemValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, 'annotationValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('annotationSpec', () => { + const fakePath = '/rendered/path/annotationSpec'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + annotation_spec: 'annotationSpecValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'annotationSpecValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = + client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'annotationSpecValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('artifact', () => { + const fakePath = '/rendered/path/artifact'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + artifact: 'artifactValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath( + 'projectValue', + 'locationValue', + 'metadataStoreValue', + 'artifactValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, 'artifactValue'); + assert( + (client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = '/rendered/path/batchPredictionJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + batch_prediction_job: 'batchPredictionJobValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath( + 'projectValue', + 'locationValue', + 'batchPredictionJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.batchPredictionJobPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.batchPredictionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.batchPredictionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = + client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, 'batchPredictionJobValue'); + assert( + ( + client.pathTemplates.batchPredictionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('context', () => { + const fakePath = '/rendered/path/context'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + context: 'contextValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.contextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath( + 'projectValue', + 'locationValue', + 'metadataStoreValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, 'contextValue'); + assert( + (client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('customJob', () => { + const fakePath = '/rendered/path/customJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + custom_job: 'customJobValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath( + 'projectValue', + 'locationValue', + 'customJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, 'customJobValue'); + assert( + (client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dataItem', () => { + const fakePath = '/rendered/path/dataItem'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + data_item: 'dataItemValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'dataItemValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, 'dataItemValue'); + assert( + (client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = '/rendered/path/dataLabelingJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_labeling_job: 'dataLabelingJobValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath( + 'projectValue', + 'locationValue', + 'dataLabelingJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = + client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, 'dataLabelingJobValue'); + assert( + (client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dataset', () => { + const fakePath = '/rendered/path/dataset'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath( + 'projectValue', + 'locationValue', + 'datasetValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('datasetVersion', () => { + const fakePath = '/rendered/path/datasetVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + dataset_version: 'datasetVersionValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.datasetVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('datasetVersionPath', () => { + const result = client.datasetVersionPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'datasetVersionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.datasetVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDatasetVersionName', () => { + const result = client.matchProjectFromDatasetVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.datasetVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDatasetVersionName', () => { + const result = client.matchLocationFromDatasetVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.datasetVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromDatasetVersionName', () => { + const result = client.matchDatasetFromDatasetVersionName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.datasetVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetVersionFromDatasetVersionName', () => { + const result = + client.matchDatasetVersionFromDatasetVersionName(fakePath); + assert.strictEqual(result, 'datasetVersionValue'); + assert( + (client.pathTemplates.datasetVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('deploymentResourcePool', () => { + const fakePath = '/rendered/path/deploymentResourcePool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deployment_resource_pool: 'deploymentResourcePoolValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentResourcePoolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentResourcePoolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentResourcePoolPath', () => { + const result = client.deploymentResourcePoolPath( + 'projectValue', + 'locationValue', + 'deploymentResourcePoolValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.deploymentResourcePoolPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDeploymentResourcePoolName', () => { + const result = + client.matchProjectFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.deploymentResourcePoolPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDeploymentResourcePoolName', () => { + const result = + client.matchLocationFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.deploymentResourcePoolPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { + const result = + client.matchDeploymentResourcePoolFromDeploymentResourcePoolName( + fakePath + ); + assert.strictEqual(result, 'deploymentResourcePoolValue'); + assert( + ( + client.pathTemplates.deploymentResourcePoolPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('entityType', () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + featurestore: 'featurestoreValue', + entity_type: 'entityTypeValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'featurestoreValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, 'featurestoreValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('execution', () => { + const fakePath = '/rendered/path/execution'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + execution: 'executionValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.executionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath( + 'projectValue', + 'locationValue', + 'metadataStoreValue', + 'executionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, 'executionValue'); + assert( + (client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('extension', () => { + const fakePath = '/rendered/path/extension'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + extension: 'extensionValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.extensionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.extensionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('extensionPath', () => { + const result = client.extensionPath( + 'projectValue', + 'locationValue', + 'extensionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.extensionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromExtensionName', () => { + const result = client.matchProjectFromExtensionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.extensionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromExtensionName', () => { + const result = client.matchLocationFromExtensionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.extensionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExtensionFromExtensionName', () => { + const result = client.matchExtensionFromExtensionName(fakePath); + assert.strictEqual(result, 'extensionValue'); + assert( + (client.pathTemplates.extensionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('featureGroup', () => { + const fakePath = '/rendered/path/featureGroup'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + feature_group: 'featureGroupValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featureGroupPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.featureGroupPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('featureGroupPath', () => { + const result = client.featureGroupPath( + 'projectValue', + 'locationValue', + 'featureGroupValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.featureGroupPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFeatureGroupName', () => { + const result = client.matchProjectFromFeatureGroupName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.featureGroupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFeatureGroupName', () => { + const result = client.matchLocationFromFeatureGroupName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.featureGroupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureGroupFromFeatureGroupName', () => { + const result = client.matchFeatureGroupFromFeatureGroupName(fakePath); + assert.strictEqual(result, 'featureGroupValue'); + assert( + (client.pathTemplates.featureGroupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('featureOnlineStore', () => { + const fakePath = '/rendered/path/featureOnlineStore'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + feature_online_store: 'featureOnlineStoreValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featureOnlineStorePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.featureOnlineStorePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('featureOnlineStorePath', () => { + const result = client.featureOnlineStorePath( + 'projectValue', + 'locationValue', + 'featureOnlineStoreValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.featureOnlineStorePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFeatureOnlineStoreName', () => { + const result = client.matchProjectFromFeatureOnlineStoreName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.featureOnlineStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFeatureOnlineStoreName', () => { + const result = client.matchLocationFromFeatureOnlineStoreName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.featureOnlineStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureOnlineStoreFromFeatureOnlineStoreName', () => { + const result = + client.matchFeatureOnlineStoreFromFeatureOnlineStoreName(fakePath); + assert.strictEqual(result, 'featureOnlineStoreValue'); + assert( + ( + client.pathTemplates.featureOnlineStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('featureView', () => { + const fakePath = '/rendered/path/featureView'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + feature_online_store: 'featureOnlineStoreValue', + feature_view: 'featureViewValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featureViewPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.featureViewPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('featureViewPath', () => { + const result = client.featureViewPath( + 'projectValue', + 'locationValue', + 'featureOnlineStoreValue', + 'featureViewValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.featureViewPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFeatureViewName', () => { + const result = client.matchProjectFromFeatureViewName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.featureViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFeatureViewName', () => { + const result = client.matchLocationFromFeatureViewName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.featureViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureOnlineStoreFromFeatureViewName', () => { + const result = + client.matchFeatureOnlineStoreFromFeatureViewName(fakePath); + assert.strictEqual(result, 'featureOnlineStoreValue'); + assert( + (client.pathTemplates.featureViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureViewFromFeatureViewName', () => { + const result = client.matchFeatureViewFromFeatureViewName(fakePath); + assert.strictEqual(result, 'featureViewValue'); + assert( + (client.pathTemplates.featureViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('featureViewSync', () => { + const fakePath = '/rendered/path/featureViewSync'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + feature_online_store: 'featureOnlineStoreValue', + feature_view: 'featureViewValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featureViewSyncPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.featureViewSyncPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('featureViewSyncPath', () => { + const result = client.featureViewSyncPath( + 'projectValue', + 'locationValue', + 'featureOnlineStoreValue', + 'featureViewValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.featureViewSyncPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFeatureViewSyncName', () => { + const result = client.matchProjectFromFeatureViewSyncName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.featureViewSyncPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFeatureViewSyncName', () => { + const result = client.matchLocationFromFeatureViewSyncName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.featureViewSyncPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureOnlineStoreFromFeatureViewSyncName', () => { + const result = + client.matchFeatureOnlineStoreFromFeatureViewSyncName(fakePath); + assert.strictEqual(result, 'featureOnlineStoreValue'); + assert( + (client.pathTemplates.featureViewSyncPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureViewFromFeatureViewSyncName', () => { + const result = client.matchFeatureViewFromFeatureViewSyncName(fakePath); + assert.strictEqual(result, 'featureViewValue'); + assert( + (client.pathTemplates.featureViewSyncPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('featurestore', () => { + const fakePath = '/rendered/path/featurestore'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + featurestore: 'featurestoreValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath( + 'projectValue', + 'locationValue', + 'featurestoreValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, 'featurestoreValue'); + assert( + (client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = '/rendered/path/hyperparameterTuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + hyperparameter_tuning_job: 'hyperparameterTuningJobValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath( + 'projectValue', + 'locationValue', + 'hyperparameterTuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.hyperparameterTuningJobPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = + client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.hyperparameterTuningJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = + client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.hyperparameterTuningJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = + client.matchHyperparameterTuningJobFromHyperparameterTuningJobName( + fakePath + ); + assert.strictEqual(result, 'hyperparameterTuningJobValue'); + assert( + ( + client.pathTemplates.hyperparameterTuningJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('index', () => { + const fakePath = '/rendered/path/index'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + index: 'indexValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.indexPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath( + 'projectValue', + 'locationValue', + 'indexValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, 'indexValue'); + assert( + (client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = '/rendered/path/indexEndpoint'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + index_endpoint: 'indexEndpointValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath( + 'projectValue', + 'locationValue', + 'indexEndpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, 'indexEndpointValue'); + assert( + (client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('metadataSchema', () => { + const fakePath = '/rendered/path/metadataSchema'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + metadata_schema: 'metadataSchemaValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath( + 'projectValue', + 'locationValue', + 'metadataStoreValue', + 'metadataSchemaValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = + client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = + client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, 'metadataSchemaValue'); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('metadataStore', () => { + const fakePath = '/rendered/path/metadataStore'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath( + 'projectValue', + 'locationValue', + 'metadataStoreValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('model', () => { + const fakePath = '/rendered/path/model'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath( + 'projectValue', + 'locationValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = '/rendered/path/modelDeploymentMonitoringJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model_deployment_monitoring_job: 'modelDeploymentMonitoringJobValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath( + 'projectValue', + 'locationValue', + 'modelDeploymentMonitoringJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = + client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = + client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = + client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName( + fakePath + ); + assert.strictEqual(result, 'modelDeploymentMonitoringJobValue'); + assert( + ( + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = '/rendered/path/modelEvaluation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + evaluation: 'evaluationValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath( + 'projectValue', + 'locationValue', + 'modelValue', + 'evaluationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'evaluationValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = '/rendered/path/modelEvaluationSlice'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + evaluation: 'evaluationValue', + slice: 'sliceValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath( + 'projectValue', + 'locationValue', + 'modelValue', + 'evaluationValue', + 'sliceValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = + client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = + client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = + client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'evaluationValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'sliceValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('modelMonitor', () => { + const fakePath = '/rendered/path/modelMonitor'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model_monitor: 'modelMonitorValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelMonitorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelMonitorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelMonitorPath', () => { + const result = client.modelMonitorPath( + 'projectValue', + 'locationValue', + 'modelMonitorValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelMonitorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelMonitorName', () => { + const result = client.matchProjectFromModelMonitorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.modelMonitorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelMonitorName', () => { + const result = client.matchLocationFromModelMonitorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.modelMonitorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelMonitorFromModelMonitorName', () => { + const result = client.matchModelMonitorFromModelMonitorName(fakePath); + assert.strictEqual(result, 'modelMonitorValue'); + assert( + (client.pathTemplates.modelMonitorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('modelMonitoringJob', () => { + const fakePath = '/rendered/path/modelMonitoringJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model_monitor: 'modelMonitorValue', + model_monitoring_job: 'modelMonitoringJobValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelMonitoringJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelMonitoringJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelMonitoringJobPath', () => { + const result = client.modelMonitoringJobPath( + 'projectValue', + 'locationValue', + 'modelMonitorValue', + 'modelMonitoringJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.modelMonitoringJobPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelMonitoringJobName', () => { + const result = client.matchProjectFromModelMonitoringJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.modelMonitoringJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelMonitoringJobName', () => { + const result = client.matchLocationFromModelMonitoringJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.modelMonitoringJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelMonitorFromModelMonitoringJobName', () => { + const result = + client.matchModelMonitorFromModelMonitoringJobName(fakePath); + assert.strictEqual(result, 'modelMonitorValue'); + assert( + ( + client.pathTemplates.modelMonitoringJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelMonitoringJobFromModelMonitoringJobName', () => { + const result = + client.matchModelMonitoringJobFromModelMonitoringJobName(fakePath); + assert.strictEqual(result, 'modelMonitoringJobValue'); + assert( + ( + client.pathTemplates.modelMonitoringJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('nasJob', () => { + const fakePath = '/rendered/path/nasJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + nas_job: 'nasJobValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath( + 'projectValue', + 'locationValue', + 'nasJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, 'nasJobValue'); + assert( + (client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = '/rendered/path/nasTrialDetail'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + nas_job: 'nasJobValue', + nas_trial_detail: 'nasTrialDetailValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath( + 'projectValue', + 'locationValue', + 'nasJobValue', + 'nasTrialDetailValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, 'nasJobValue'); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = + client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, 'nasTrialDetailValue'); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('notebookExecutionJob', () => { + const fakePath = '/rendered/path/notebookExecutionJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + notebook_execution_job: 'notebookExecutionJobValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.notebookExecutionJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.notebookExecutionJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('notebookExecutionJobPath', () => { + const result = client.notebookExecutionJobPath( + 'projectValue', + 'locationValue', + 'notebookExecutionJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.notebookExecutionJobPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNotebookExecutionJobName', () => { + const result = + client.matchProjectFromNotebookExecutionJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.notebookExecutionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNotebookExecutionJobName', () => { + const result = + client.matchLocationFromNotebookExecutionJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.notebookExecutionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNotebookExecutionJobFromNotebookExecutionJobName', () => { + const result = + client.matchNotebookExecutionJobFromNotebookExecutionJobName( + fakePath + ); + assert.strictEqual(result, 'notebookExecutionJobValue'); + assert( + ( + client.pathTemplates.notebookExecutionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('notebookRuntime', () => { + const fakePath = '/rendered/path/notebookRuntime'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + notebook_runtime: 'notebookRuntimeValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.notebookRuntimePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.notebookRuntimePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('notebookRuntimePath', () => { + const result = client.notebookRuntimePath( + 'projectValue', + 'locationValue', + 'notebookRuntimeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.notebookRuntimePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNotebookRuntimeName', () => { + const result = client.matchProjectFromNotebookRuntimeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.notebookRuntimePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNotebookRuntimeName', () => { + const result = client.matchLocationFromNotebookRuntimeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.notebookRuntimePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNotebookRuntimeFromNotebookRuntimeName', () => { + const result = + client.matchNotebookRuntimeFromNotebookRuntimeName(fakePath); + assert.strictEqual(result, 'notebookRuntimeValue'); + assert( + (client.pathTemplates.notebookRuntimePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('notebookRuntimeTemplate', () => { + const fakePath = '/rendered/path/notebookRuntimeTemplate'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + notebook_runtime_template: 'notebookRuntimeTemplateValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.notebookRuntimeTemplatePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.notebookRuntimeTemplatePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('notebookRuntimeTemplatePath', () => { + const result = client.notebookRuntimeTemplatePath( + 'projectValue', + 'locationValue', + 'notebookRuntimeTemplateValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.notebookRuntimeTemplatePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNotebookRuntimeTemplateName', () => { + const result = + client.matchProjectFromNotebookRuntimeTemplateName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.notebookRuntimeTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNotebookRuntimeTemplateName', () => { + const result = + client.matchLocationFromNotebookRuntimeTemplateName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.notebookRuntimeTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNotebookRuntimeTemplateFromNotebookRuntimeTemplateName', () => { + const result = + client.matchNotebookRuntimeTemplateFromNotebookRuntimeTemplateName( + fakePath + ); + assert.strictEqual(result, 'notebookRuntimeTemplateValue'); + assert( + ( + client.pathTemplates.notebookRuntimeTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('persistentResource', () => { + const fakePath = '/rendered/path/persistentResource'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + persistent_resource: 'persistentResourceValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.persistentResourcePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.persistentResourcePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('persistentResourcePath', () => { + const result = client.persistentResourcePath( + 'projectValue', + 'locationValue', + 'persistentResourceValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.persistentResourcePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromPersistentResourceName', () => { + const result = client.matchProjectFromPersistentResourceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.persistentResourcePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromPersistentResourceName', () => { + const result = client.matchLocationFromPersistentResourceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.persistentResourcePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPersistentResourceFromPersistentResourceName', () => { + const result = + client.matchPersistentResourceFromPersistentResourceName(fakePath); + assert.strictEqual(result, 'persistentResourceValue'); + assert( + ( + client.pathTemplates.persistentResourcePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('pipelineJob', () => { + const fakePath = '/rendered/path/pipelineJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + pipeline_job: 'pipelineJobValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath( + 'projectValue', + 'locationValue', + 'pipelineJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, 'pipelineJobValue'); + assert( + (client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + endpoint: 'endpointValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationFeatureGroupFeature', () => { + const fakePath = '/rendered/path/projectLocationFeatureGroupFeature'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + feature_group: 'featureGroupValue', + feature: 'featureValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationFeatureGroupFeaturePath', () => { + const result = client.projectLocationFeatureGroupFeaturePath( + 'projectValue', + 'locationValue', + 'featureGroupValue', + 'featureValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationFeatureGroupFeatureName', () => { + const result = + client.matchProjectFromProjectLocationFeatureGroupFeatureName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationFeatureGroupFeatureName', () => { + const result = + client.matchLocationFromProjectLocationFeatureGroupFeatureName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureGroupFromProjectLocationFeatureGroupFeatureName', () => { + const result = + client.matchFeatureGroupFromProjectLocationFeatureGroupFeatureName( + fakePath + ); + assert.strictEqual(result, 'featureGroupValue'); + assert( + ( + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureFromProjectLocationFeatureGroupFeatureName', () => { + const result = + client.matchFeatureFromProjectLocationFeatureGroupFeatureName( + fakePath + ); + assert.strictEqual(result, 'featureValue'); + assert( + ( + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationFeaturestoreEntityTypeFeature', () => { + const fakePath = + '/rendered/path/projectLocationFeaturestoreEntityTypeFeature'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + featurestore: 'featurestoreValue', + entity_type: 'entityTypeValue', + feature: 'featureValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationFeaturestoreEntityTypeFeaturePath', () => { + const result = client.projectLocationFeaturestoreEntityTypeFeaturePath( + 'projectValue', + 'locationValue', + 'featurestoreValue', + 'entityTypeValue', + 'featureValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationFeaturestoreEntityTypeFeaturePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationFeaturestoreEntityTypeFeatureName', () => { + const result = + client.matchProjectFromProjectLocationFeaturestoreEntityTypeFeatureName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationFeaturestoreEntityTypeFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationFeaturestoreEntityTypeFeatureName', () => { + const result = + client.matchLocationFromProjectLocationFeaturestoreEntityTypeFeatureName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationFeaturestoreEntityTypeFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeaturestoreFromProjectLocationFeaturestoreEntityTypeFeatureName', () => { + const result = + client.matchFeaturestoreFromProjectLocationFeaturestoreEntityTypeFeatureName( + fakePath + ); + assert.strictEqual(result, 'featurestoreValue'); + assert( + ( + client.pathTemplates + .projectLocationFeaturestoreEntityTypeFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectLocationFeaturestoreEntityTypeFeatureName', () => { + const result = + client.matchEntityTypeFromProjectLocationFeaturestoreEntityTypeFeatureName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationFeaturestoreEntityTypeFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureFromProjectLocationFeaturestoreEntityTypeFeatureName', () => { + const result = + client.matchFeatureFromProjectLocationFeaturestoreEntityTypeFeatureName( + fakePath + ); + assert.strictEqual(result, 'featureValue'); + assert( + ( + client.pathTemplates + .projectLocationFeaturestoreEntityTypeFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('publisherModel', () => { + const fakePath = '/rendered/path/publisherModel'; + const expectedParameters = { + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.publisherModelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.publisherModelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('publisherModelPath', () => { + const result = client.publisherModelPath( + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.publisherModelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchPublisherFromPublisherModelName', () => { + const result = client.matchPublisherFromPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromPublisherModelName', () => { + const result = client.matchModelFromPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragCorpus', () => { + const fakePath = '/rendered/path/ragCorpus'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragCorpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragCorpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragCorpusPath', () => { + const result = client.ragCorpusPath( + 'projectValue', + 'locationValue', + 'ragCorpusValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragCorpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagCorpusName', () => { + const result = client.matchProjectFromRagCorpusName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagCorpusName', () => { + const result = client.matchLocationFromRagCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagCorpusName', () => { + const result = client.matchRagCorpusFromRagCorpusName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragFile', () => { + const fakePath = '/rendered/path/ragFile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + rag_file: 'ragFileValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragFilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragFilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragFilePath', () => { + const result = client.ragFilePath( + 'projectValue', + 'locationValue', + 'ragCorpusValue', + 'ragFileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragFilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagFileName', () => { + const result = client.matchProjectFromRagFileName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagFileName', () => { + const result = client.matchLocationFromRagFileName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagFileName', () => { + const result = client.matchRagCorpusFromRagFileName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagFileFromRagFileName', () => { + const result = client.matchRagFileFromRagFileName(fakePath); + assert.strictEqual(result, 'ragFileValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('reasoningEngine', () => { + const fakePath = '/rendered/path/reasoningEngine'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reasoning_engine: 'reasoningEngineValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.reasoningEnginePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reasoningEnginePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reasoningEnginePath', () => { + const result = client.reasoningEnginePath( + 'projectValue', + 'locationValue', + 'reasoningEngineValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReasoningEngineName', () => { + const result = client.matchProjectFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReasoningEngineName', () => { + const result = client.matchLocationFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReasoningEngineFromReasoningEngineName', () => { + const result = + client.matchReasoningEngineFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'reasoningEngineValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('savedQuery', () => { + const fakePath = '/rendered/path/savedQuery'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + saved_query: 'savedQueryValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'savedQueryValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, 'savedQueryValue'); + assert( + (client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('schedule', () => { + const fakePath = '/rendered/path/schedule'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + schedule: 'scheduleValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.schedulePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.schedulePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('schedulePath', () => { + const result = client.schedulePath( + 'projectValue', + 'locationValue', + 'scheduleValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.schedulePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromScheduleName', () => { + const result = client.matchProjectFromScheduleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromScheduleName', () => { + const result = client.matchLocationFromScheduleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchScheduleFromScheduleName', () => { + const result = client.matchScheduleFromScheduleName(fakePath); + assert.strictEqual(result, 'scheduleValue'); + assert( + (client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('specialistPool', () => { + const fakePath = '/rendered/path/specialistPool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + specialist_pool: 'specialistPoolValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath( + 'projectValue', + 'locationValue', + 'specialistPoolValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = + client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, 'specialistPoolValue'); + assert( + (client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('study', () => { + const fakePath = '/rendered/path/study'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + study: 'studyValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.studyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath( + 'projectValue', + 'locationValue', + 'studyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, 'studyValue'); + assert( + (client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tensorboard', () => { + const fakePath = '/rendered/path/tensorboard'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tensorboard: 'tensorboardValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath( + 'projectValue', + 'locationValue', + 'tensorboardValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, 'tensorboardValue'); + assert( + (client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = '/rendered/path/tensorboardExperiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tensorboard: 'tensorboardValue', + experiment: 'experimentValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath( + 'projectValue', + 'locationValue', + 'tensorboardValue', + 'experimentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = + client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = + client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = + client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, 'tensorboardValue'); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = + client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = '/rendered/path/tensorboardRun'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tensorboard: 'tensorboardValue', + experiment: 'experimentValue', + run: 'runValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath( + 'projectValue', + 'locationValue', + 'tensorboardValue', + 'experimentValue', + 'runValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'tensorboardValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'runValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = '/rendered/path/tensorboardTimeSeries'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tensorboard: 'tensorboardValue', + experiment: 'experimentValue', + run: 'runValue', + time_series: 'timeSeriesValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath( + 'projectValue', + 'locationValue', + 'tensorboardValue', + 'experimentValue', + 'runValue', + 'timeSeriesValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = + client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = + client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = + client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'tensorboardValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = + client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'runValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = + client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'timeSeriesValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = '/rendered/path/trainingPipeline'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + training_pipeline: 'trainingPipelineValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath( + 'projectValue', + 'locationValue', + 'trainingPipelineValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.trainingPipelinePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = + client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, 'trainingPipelineValue'); + assert( + (client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('trial', () => { + const fakePath = '/rendered/path/trial'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + study: 'studyValue', + trial: 'trialValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.trialPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath( + 'projectValue', + 'locationValue', + 'studyValue', + 'trialValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, 'studyValue'); + assert( + (client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, 'trialValue'); + assert( + (client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = + new genaituningserviceModule.v1beta1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-aiplatform/test/gapic_index_endpoint_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_index_endpoint_service_v1beta1.ts index 87c4d277eb5..e1010ca6152 100644 --- a/packages/google-cloud-aiplatform/test/gapic_index_endpoint_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_index_endpoint_service_v1beta1.ts @@ -7107,5 +7107,70 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ); }); }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = + new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-aiplatform/test/gapic_index_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_index_service_v1beta1.ts index e55361f2454..567070ea89c 100644 --- a/packages/google-cloud-aiplatform/test/gapic_index_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_index_service_v1beta1.ts @@ -6692,5 +6692,69 @@ describe('v1beta1.IndexServiceClient', () => { ); }); }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-aiplatform/test/gapic_job_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_job_service_v1beta1.ts index 8a9837de317..94003725ba1 100644 --- a/packages/google-cloud-aiplatform/test/gapic_job_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_job_service_v1beta1.ts @@ -12247,5 +12247,69 @@ describe('v1beta1.JobServiceClient', () => { ); }); }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-aiplatform/test/gapic_llm_utility_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_llm_utility_service_v1beta1.ts index 986e249c2e1..0941ccc12fb 100644 --- a/packages/google-cloud-aiplatform/test/gapic_llm_utility_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_llm_utility_service_v1beta1.ts @@ -5186,5 +5186,70 @@ describe('v1beta1.LlmUtilityServiceClient', () => { ); }); }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = + new llmutilityserviceModule.v1beta1.LlmUtilityServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-aiplatform/test/gapic_match_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_match_service_v1beta1.ts index 3ba9c021a51..5463e21e03b 100644 --- a/packages/google-cloud-aiplatform/test/gapic_match_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_match_service_v1beta1.ts @@ -5231,5 +5231,69 @@ describe('v1beta1.MatchServiceClient', () => { ); }); }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = new matchserviceModule.v1beta1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-aiplatform/test/gapic_metadata_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_metadata_service_v1beta1.ts index 526b2e13d82..d8fe4b3b52f 100644 --- a/packages/google-cloud-aiplatform/test/gapic_metadata_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_metadata_service_v1beta1.ts @@ -11159,5 +11159,69 @@ describe('v1beta1.MetadataServiceClient', () => { ); }); }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-aiplatform/test/gapic_migration_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_migration_service_v1beta1.ts index 2d9c4a07c66..52b718b67af 100644 --- a/packages/google-cloud-aiplatform/test/gapic_migration_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_migration_service_v1beta1.ts @@ -5963,5 +5963,69 @@ describe('v1beta1.MigrationServiceClient', () => { ); }); }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-aiplatform/test/gapic_model_garden_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_model_garden_service_v1beta1.ts index 030d504a46d..1fcea45f8d6 100644 --- a/packages/google-cloud-aiplatform/test/gapic_model_garden_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_model_garden_service_v1beta1.ts @@ -5566,5 +5566,70 @@ describe('v1beta1.ModelGardenServiceClient', () => { ); }); }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = + new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-aiplatform/test/gapic_model_monitoring_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_model_monitoring_service_v1beta1.ts index 6c785f1b5af..50d0a7d757f 100644 --- a/packages/google-cloud-aiplatform/test/gapic_model_monitoring_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_model_monitoring_service_v1beta1.ts @@ -8159,5 +8159,70 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ); }); }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = + new modelmonitoringserviceModule.v1beta1.ModelMonitoringServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-aiplatform/test/gapic_model_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_model_service_v1beta1.ts index c685dd5bec0..44f0c2c8181 100644 --- a/packages/google-cloud-aiplatform/test/gapic_model_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_model_service_v1beta1.ts @@ -8974,5 +8974,69 @@ describe('v1beta1.ModelServiceClient', () => { ); }); }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-aiplatform/test/gapic_notebook_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_notebook_service_v1beta1.ts index 2b56d2a207a..af632eb58ce 100644 --- a/packages/google-cloud-aiplatform/test/gapic_notebook_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_notebook_service_v1beta1.ts @@ -8248,5 +8248,69 @@ describe('v1beta1.NotebookServiceClient', () => { ); }); }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = new notebookserviceModule.v1beta1.NotebookServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-aiplatform/test/gapic_persistent_resource_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_persistent_resource_service_v1beta1.ts index edb08bf0b7b..7979fb39359 100644 --- a/packages/google-cloud-aiplatform/test/gapic_persistent_resource_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_persistent_resource_service_v1beta1.ts @@ -7070,5 +7070,72 @@ describe('v1beta1.PersistentResourceServiceClient', () => { ); }); }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = + new persistentresourceserviceModule.v1beta1.PersistentResourceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-aiplatform/test/gapic_pipeline_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_pipeline_service_v1beta1.ts index 4be35f30140..80f1d6a19e1 100644 --- a/packages/google-cloud-aiplatform/test/gapic_pipeline_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_pipeline_service_v1beta1.ts @@ -7714,5 +7714,69 @@ describe('v1beta1.PipelineServiceClient', () => { ); }); }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-aiplatform/test/gapic_prediction_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_prediction_service_v1.ts index 268baed6914..e0911a466fe 100644 --- a/packages/google-cloud-aiplatform/test/gapic_prediction_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_prediction_service_v1.ts @@ -1116,6 +1116,46 @@ describe('v1.PredictionServiceClient', () => { assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); + it('invokes streamRawPredict without error and gaxServerStreamingRetries enabled', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + gaxServerStreamingRetries: true, + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.StreamRawPredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.StreamRawPredictRequest', + ['endpoint'] + ); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.HttpBody() + ); + client.innerApiCalls.streamRawPredict = + stubServerStreamingCall(expectedResponse); + const stream = client.streamRawPredict(request); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.api.HttpBody) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.streamRawPredict as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.streamRawPredict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + it('invokes streamRawPredict with error', async () => { const client = new predictionserviceModule.v1.PredictionServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1185,6 +1225,12 @@ describe('v1.PredictionServiceClient', () => { }); await assert.rejects(promise, expectedError); }); + it('should create a client with gaxServerStreamingRetries enabled', () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + gaxServerStreamingRetries: true, + }); + assert(client); + }); }); describe('serverStreamingPredict', () => { @@ -1234,6 +1280,51 @@ describe('v1.PredictionServiceClient', () => { assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); + it('invokes serverStreamingPredict without error and gaxServerStreamingRetries enabled', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + gaxServerStreamingRetries: true, + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.StreamingPredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.StreamingPredictRequest', + ['endpoint'] + ); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.StreamingPredictResponse() + ); + client.innerApiCalls.serverStreamingPredict = + stubServerStreamingCall(expectedResponse); + const stream = client.serverStreamingPredict(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.aiplatform.v1.StreamingPredictResponse + ) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.serverStreamingPredict as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.serverStreamingPredict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + it('invokes serverStreamingPredict with error', async () => { const client = new predictionserviceModule.v1.PredictionServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1313,6 +1404,12 @@ describe('v1.PredictionServiceClient', () => { }); await assert.rejects(promise, expectedError); }); + it('should create a client with gaxServerStreamingRetries enabled', () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + gaxServerStreamingRetries: true, + }); + assert(client); + }); }); describe('streamGenerateContent', () => { @@ -1362,6 +1459,51 @@ describe('v1.PredictionServiceClient', () => { assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); + it('invokes streamGenerateContent without error and gaxServerStreamingRetries enabled', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + gaxServerStreamingRetries: true, + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.GenerateContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.GenerateContentRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.GenerateContentResponse() + ); + client.innerApiCalls.streamGenerateContent = + stubServerStreamingCall(expectedResponse); + const stream = client.streamGenerateContent(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.aiplatform.v1.GenerateContentResponse + ) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.streamGenerateContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.streamGenerateContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + it('invokes streamGenerateContent with error', async () => { const client = new predictionserviceModule.v1.PredictionServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1441,6 +1583,12 @@ describe('v1.PredictionServiceClient', () => { }); await assert.rejects(promise, expectedError); }); + it('should create a client with gaxServerStreamingRetries enabled', () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + gaxServerStreamingRetries: true, + }); + assert(client); + }); }); describe('streamDirectPredict', () => { diff --git a/packages/google-cloud-aiplatform/test/gapic_prediction_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_prediction_service_v1beta1.ts index 2df35142191..8324f8f6fa0 100644 --- a/packages/google-cloud-aiplatform/test/gapic_prediction_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_prediction_service_v1beta1.ts @@ -1292,6 +1292,52 @@ describe('v1beta1.PredictionServiceClient', () => { assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); + it('invokes serverStreamingPredict without error and gaxServerStreamingRetries enabled', async () => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + gaxServerStreamingRetries: true, + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.StreamingPredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.StreamingPredictRequest', + ['endpoint'] + ); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.StreamingPredictResponse() + ); + client.innerApiCalls.serverStreamingPredict = + stubServerStreamingCall(expectedResponse); + const stream = client.serverStreamingPredict(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.aiplatform.v1beta1.StreamingPredictResponse + ) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.serverStreamingPredict as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.serverStreamingPredict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + it('invokes serverStreamingPredict with error', async () => { const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ @@ -1373,6 +1419,13 @@ describe('v1beta1.PredictionServiceClient', () => { }); await assert.rejects(promise, expectedError); }); + it('should create a client with gaxServerStreamingRetries enabled', () => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + gaxServerStreamingRetries: true, + }); + assert(client); + }); }); describe('streamGenerateContent', () => { @@ -1423,6 +1476,52 @@ describe('v1beta1.PredictionServiceClient', () => { assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); + it('invokes streamGenerateContent without error and gaxServerStreamingRetries enabled', async () => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + gaxServerStreamingRetries: true, + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.GenerateContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.GenerateContentRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.GenerateContentResponse() + ); + client.innerApiCalls.streamGenerateContent = + stubServerStreamingCall(expectedResponse); + const stream = client.streamGenerateContent(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.aiplatform.v1beta1.GenerateContentResponse + ) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.streamGenerateContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.streamGenerateContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + it('invokes streamGenerateContent with error', async () => { const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ @@ -1504,6 +1603,13 @@ describe('v1beta1.PredictionServiceClient', () => { }); await assert.rejects(promise, expectedError); }); + it('should create a client with gaxServerStreamingRetries enabled', () => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + gaxServerStreamingRetries: true, + }); + assert(client); + }); }); describe('streamDirectPredict', () => { @@ -6648,5 +6754,70 @@ describe('v1beta1.PredictionServiceClient', () => { ); }); }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-aiplatform/test/gapic_reasoning_engine_execution_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_reasoning_engine_execution_service_v1beta1.ts index 5ba5cd86e3a..b248840527b 100644 --- a/packages/google-cloud-aiplatform/test/gapic_reasoning_engine_execution_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_reasoning_engine_execution_service_v1beta1.ts @@ -5348,5 +5348,72 @@ describe('v1beta1.ReasoningEngineExecutionServiceClient', () => { ); }); }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1beta1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-aiplatform/test/gapic_reasoning_engine_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_reasoning_engine_service_v1beta1.ts index d30906c0228..499458dd656 100644 --- a/packages/google-cloud-aiplatform/test/gapic_reasoning_engine_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_reasoning_engine_service_v1beta1.ts @@ -6383,5 +6383,70 @@ describe('v1beta1.ReasoningEngineServiceClient', () => { ); }); }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = + new reasoningengineserviceModule.v1beta1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-aiplatform/test/gapic_schedule_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_schedule_service_v1beta1.ts index 382399254b3..a9da2e325d5 100644 --- a/packages/google-cloud-aiplatform/test/gapic_schedule_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_schedule_service_v1beta1.ts @@ -6578,5 +6578,69 @@ describe('v1beta1.ScheduleServiceClient', () => { ); }); }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = new scheduleserviceModule.v1beta1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-aiplatform/test/gapic_specialist_pool_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_specialist_pool_service_v1beta1.ts index 981b2a04eba..d451efdd8c8 100644 --- a/packages/google-cloud-aiplatform/test/gapic_specialist_pool_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_specialist_pool_service_v1beta1.ts @@ -6576,5 +6576,70 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { ); }); }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = + new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-aiplatform/test/gapic_tensorboard_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_tensorboard_service_v1.ts index 6c98906b968..a038b033233 100644 --- a/packages/google-cloud-aiplatform/test/gapic_tensorboard_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_tensorboard_service_v1.ts @@ -4030,6 +4030,51 @@ describe('v1.TensorboardServiceClient', () => { assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); + it('invokes readTensorboardBlobData without error and gaxServerStreamingRetries enabled', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + gaxServerStreamingRetries: true, + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest', + ['timeSeries'] + ); + request.timeSeries = defaultValue1; + const expectedHeaderRequestParams = `time_series=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse() + ); + client.innerApiCalls.readTensorboardBlobData = + stubServerStreamingCall(expectedResponse); + const stream = client.readTensorboardBlobData(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse + ) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.readTensorboardBlobData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.readTensorboardBlobData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + it('invokes readTensorboardBlobData with error', async () => { const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -4109,6 +4154,12 @@ describe('v1.TensorboardServiceClient', () => { }); await assert.rejects(promise, expectedError); }); + it('should create a client with gaxServerStreamingRetries enabled', () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + gaxServerStreamingRetries: true, + }); + assert(client); + }); }); describe('listTensorboards', () => { diff --git a/packages/google-cloud-aiplatform/test/gapic_tensorboard_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_tensorboard_service_v1beta1.ts index d73d39db596..d2ae6431d2e 100644 --- a/packages/google-cloud-aiplatform/test/gapic_tensorboard_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_tensorboard_service_v1beta1.ts @@ -4151,6 +4151,52 @@ describe('v1beta1.TensorboardServiceClient', () => { assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); + it('invokes readTensorboardBlobData without error and gaxServerStreamingRetries enabled', async () => { + const client = + new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + gaxServerStreamingRetries: true, + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardBlobDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.ReadTensorboardBlobDataRequest', + ['timeSeries'] + ); + request.timeSeries = defaultValue1; + const expectedHeaderRequestParams = `time_series=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardBlobDataResponse() + ); + client.innerApiCalls.readTensorboardBlobData = + stubServerStreamingCall(expectedResponse); + const stream = client.readTensorboardBlobData(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.aiplatform.v1beta1.ReadTensorboardBlobDataResponse + ) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.readTensorboardBlobData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.readTensorboardBlobData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + it('invokes readTensorboardBlobData with error', async () => { const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ @@ -4232,6 +4278,13 @@ describe('v1beta1.TensorboardServiceClient', () => { }); await assert.rejects(promise, expectedError); }); + it('should create a client with gaxServerStreamingRetries enabled', () => { + const client = + new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + gaxServerStreamingRetries: true, + }); + assert(client); + }); }); describe('listTensorboards', () => { @@ -11194,5 +11247,70 @@ describe('v1beta1.TensorboardServiceClient', () => { ); }); }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = + new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-aiplatform/test/gapic_vertex_rag_data_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_vertex_rag_data_service_v1beta1.ts index 9c7b6000f05..739fa25db73 100644 --- a/packages/google-cloud-aiplatform/test/gapic_vertex_rag_data_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_vertex_rag_data_service_v1beta1.ts @@ -7370,5 +7370,70 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ); }); }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = + new vertexragdataserviceModule.v1beta1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-aiplatform/test/gapic_vertex_rag_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_vertex_rag_service_v1beta1.ts index 138f4a02941..900a59d68cb 100644 --- a/packages/google-cloud-aiplatform/test/gapic_vertex_rag_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_vertex_rag_service_v1beta1.ts @@ -5154,5 +5154,69 @@ describe('v1beta1.VertexRagServiceClient', () => { ); }); }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = new vertexragserviceModule.v1beta1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-aiplatform/test/gapic_vizier_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_vizier_service_v1beta1.ts index 01c343f6893..ca95df4ca89 100644 --- a/packages/google-cloud-aiplatform/test/gapic_vizier_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_vizier_service_v1beta1.ts @@ -7874,5 +7874,69 @@ describe('v1beta1.VizierServiceClient', () => { ); }); }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); });