diff --git a/packages/google-cloud-aiplatform/README.md b/packages/google-cloud-aiplatform/README.md index adf6a329d95..6ed3db785fa 100644 --- a/packages/google-cloud-aiplatform/README.md +++ b/packages/google-cloud-aiplatform/README.md @@ -126,6 +126,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Deployment_resource_pool_service.get_deployment_resource_pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.get_deployment_resource_pool.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.get_deployment_resource_pool.js,packages/google-cloud-aiplatform/samples/README.md) | | Deployment_resource_pool_service.list_deployment_resource_pools | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.list_deployment_resource_pools.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.list_deployment_resource_pools.js,packages/google-cloud-aiplatform/samples/README.md) | | Deployment_resource_pool_service.query_deployed_models | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.query_deployed_models.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.query_deployed_models.js,packages/google-cloud-aiplatform/samples/README.md) | +| Deployment_resource_pool_service.update_deployment_resource_pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.update_deployment_resource_pool.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.update_deployment_resource_pool.js,packages/google-cloud-aiplatform/samples/README.md) | | Endpoint_service.create_endpoint | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.create_endpoint.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.create_endpoint.js,packages/google-cloud-aiplatform/samples/README.md) | | Endpoint_service.delete_endpoint | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.delete_endpoint.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.delete_endpoint.js,packages/google-cloud-aiplatform/samples/README.md) | | Endpoint_service.deploy_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.deploy_model.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.deploy_model.js,packages/google-cloud-aiplatform/samples/README.md) | @@ -417,6 +418,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Deployment_resource_pool_service.get_deployment_resource_pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.get_deployment_resource_pool.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/deployment_resource_pool_service.get_deployment_resource_pool.js,packages/google-cloud-aiplatform/samples/README.md) | | Deployment_resource_pool_service.list_deployment_resource_pools | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.list_deployment_resource_pools.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/deployment_resource_pool_service.list_deployment_resource_pools.js,packages/google-cloud-aiplatform/samples/README.md) | | Deployment_resource_pool_service.query_deployed_models | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.query_deployed_models.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/deployment_resource_pool_service.query_deployed_models.js,packages/google-cloud-aiplatform/samples/README.md) | +| Deployment_resource_pool_service.update_deployment_resource_pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.update_deployment_resource_pool.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/deployment_resource_pool_service.update_deployment_resource_pool.js,packages/google-cloud-aiplatform/samples/README.md) | | Endpoint_service.create_endpoint | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.create_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/endpoint_service.create_endpoint.js,packages/google-cloud-aiplatform/samples/README.md) | | Endpoint_service.delete_endpoint | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.delete_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/endpoint_service.delete_endpoint.js,packages/google-cloud-aiplatform/samples/README.md) | | Endpoint_service.deploy_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.deploy_model.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.deploy_model.js,packages/google-cloud-aiplatform/samples/README.md) | diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/deployment_resource_pool_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/deployment_resource_pool_service.proto index 75a221c68e4..7d42ed15003 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/deployment_resource_pool_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/deployment_resource_pool_service.proto @@ -26,6 +26,7 @@ import "google/cloud/aiplatform/v1/endpoint.proto"; import "google/cloud/aiplatform/v1/operation.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; option csharp_namespace = "Google.Cloud.AIPlatform.V1"; option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; @@ -74,6 +75,21 @@ service DeploymentResourcePoolService { option (google.api.method_signature) = "parent"; } + // Update a DeploymentResourcePool. + rpc UpdateDeploymentResourcePool(UpdateDeploymentResourcePoolRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{deployment_resource_pool.name=projects/*/locations/*/deploymentResourcePools/*}" + body: "deployment_resource_pool" + }; + option (google.api.method_signature) = + "deployment_resource_pool,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "DeploymentResourcePool" + metadata_type: "UpdateDeploymentResourcePoolOperationMetadata" + }; + } + // Delete a DeploymentResourcePool. rpc DeleteDeploymentResourcePool(DeleteDeploymentResourcePoolRequest) returns (google.longrunning.Operation) { @@ -175,6 +191,22 @@ message ListDeploymentResourcePoolsResponse { string next_page_token = 2; } +// Request message for UpdateDeploymentResourcePool method. +message UpdateDeploymentResourcePoolRequest { + // Required. The DeploymentResourcePool to update. + // + // The DeploymentResourcePool's `name` field is used to identify the + // DeploymentResourcePool to update. + // Format: + // `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}` + DeploymentResourcePool deployment_resource_pool = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + // Runtime operation information for UpdateDeploymentResourcePool method. message UpdateDeploymentResourcePoolOperationMetadata { // The operation generic information. diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/feature_online_store.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/feature_online_store.proto index 1a8760a9432..4e623117365 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/feature_online_store.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/feature_online_store.proto @@ -19,6 +19,7 @@ package google.cloud.aiplatform.v1; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/aiplatform/v1/encryption_spec.proto"; +import "google/cloud/aiplatform/v1/service_networking.proto"; import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.AIPlatform.V1"; @@ -72,6 +73,19 @@ message FeatureOnlineStore { // this FeatureOnlineStore string public_endpoint_domain_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Private service connect config. The private service connection + // is available only for Optimized storage type, not for embedding + // management now. If + // [PrivateServiceConnectConfig.enable_private_service_connect][google.cloud.aiplatform.v1.PrivateServiceConnectConfig.enable_private_service_connect] + // set to true, customers will use private service connection to send + // request. Otherwise, the connection will set to public endpoint. + PrivateServiceConnectConfig private_service_connect_config = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The name of the service attachment resource. Populated if + // private service connect is enabled and after FeatureViewSync is created. + string service_attachment = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Possible states a featureOnlineStore can have. diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/llm_utility_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/llm_utility_service.proto index e63a7e7da0e..e6e8d8e8dd1 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/llm_utility_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/llm_utility_service.proto @@ -20,6 +20,7 @@ import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/content.proto"; import "google/cloud/aiplatform/v1/prediction_service.proto"; import "google/protobuf/struct.proto"; @@ -75,11 +76,19 @@ message ComputeTokensRequest { } ]; - // Required. The instances that are the input to token computing API call. + // Optional. The instances that are the input to token computing API call. // Schema is identical to the prediction schema of the text model, even for // the non-text models, like chat models, or Codey models. repeated google.protobuf.Value instances = 2 - [(google.api.field_behavior) = REQUIRED]; + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of the publisher model requested to serve the + // prediction. Format: + // projects/{project}/locations/{location}/publishers/*/models/* + string model = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Input content. + repeated Content contents = 4 [(google.api.field_behavior) = OPTIONAL]; } // Tokens info with a list of tokens and the corresponding list of token ids. @@ -89,6 +98,9 @@ message TokensInfo { // A list of token ids from the input. repeated int64 token_ids = 2; + + // Optional. Optional fields for the role from the corresponding Content. + string role = 3 [(google.api.field_behavior) = OPTIONAL]; } // Response message for ComputeTokens RPC call. diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model.proto index 99c22322335..ad721bc7c2e 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model.proto @@ -469,6 +469,12 @@ message Model { // only supports specifing the Model Garden models and Genie models. BaseModelSource base_model_source = 50 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Reserved for future use. + bool satisfies_pzs = 51 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + bool satisfies_pzi = 52 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Contains information about the Large Model. diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/persistent_resource.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/persistent_resource.proto index 8efb54f3096..83707aa2240 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/persistent_resource.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/persistent_resource.proto @@ -163,7 +163,13 @@ message ResourcePool { // The min/max number of replicas allowed if enabling autoscaling message AutoscalingSpec { // Optional. min replicas in the node pool, - // must be ≤ replica_count and < max_replica_count or will throw error + // must be ≤ replica_count and < max_replica_count or will throw error. + // For autoscaling enabled Ray-on-Vertex, we allow min_replica_count of a + // resource_pool to be 0 to match the OSS Ray + // behavior(https://docs.ray.io/en/latest/cluster/vms/user-guides/configuring-autoscaling.html#cluster-config-parameters). + // As for Persistent Resource, the min_replica_count must be > 0, we added + // a corresponding validation inside + // CreatePersistentResourceRequestValidator.java. optional int64 min_replica_count = 1 [(google.api.field_behavior) = OPTIONAL]; @@ -194,7 +200,7 @@ message ResourcePool { // this resource pool. Will replace idle_replica_count. int64 used_replica_count = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Optional. Optional spec to configure GKE autoscaling + // Optional. Optional spec to configure GKE or Ray-on-Vertex autoscaling AutoscalingSpec autoscaling_spec = 7 [(google.api.field_behavior) = OPTIONAL]; } diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/publisher_model.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/publisher_model.proto index 667613f31b4..bf99e150f47 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/publisher_model.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/publisher_model.proto @@ -115,6 +115,14 @@ message PublisherModel { // Model metadata that is needed for UploadModel or // DeployModel/CreateEndpoint requests. message Deploy { + // Metadata information about the deployment for managing deployment + // config. + message DeployMetadata { + // Optional. Labels for the deployment. For managing deployment config + // like verifying, source of deployment config, etc. + map labels = 1 [(google.api.field_behavior) = OPTIONAL]; + } + // The prediction (for example, the machine) resources that the // DeployedModel uses. oneof prediction_resources { @@ -154,6 +162,10 @@ message PublisherModel { optional string deploy_task_name = 10 [(google.api.field_behavior) = OPTIONAL]; + // Optional. Metadata information about this deployment config. + optional DeployMetadata deploy_metadata = 11 + [(google.api.field_behavior) = OPTIONAL]; + // Required. The title of the regional resource reference. string title = 8 [(google.api.field_behavior) = REQUIRED]; diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/tensorboard.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/tensorboard.proto index ec8dd638896..88788832614 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/tensorboard.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/tensorboard.proto @@ -93,4 +93,10 @@ message Tensorboard { // TensorBoard instance to be default will mark all other TensorBoard // instances (if any) as non default. bool is_default = 12; + + // Output only. Reserved for future use. + bool satisfies_pzs = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + bool satisfies_pzi = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; } diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.proto index 7a45bc8bdf5..86394bd95a4 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.proto @@ -26,6 +26,7 @@ import "google/cloud/aiplatform/v1beta1/endpoint.proto"; import "google/cloud/aiplatform/v1beta1/operation.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; @@ -74,6 +75,21 @@ service DeploymentResourcePoolService { option (google.api.method_signature) = "parent"; } + // Update a DeploymentResourcePool. + rpc UpdateDeploymentResourcePool(UpdateDeploymentResourcePoolRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta1/{deployment_resource_pool.name=projects/*/locations/*/deploymentResourcePools/*}" + body: "deployment_resource_pool" + }; + option (google.api.method_signature) = + "deployment_resource_pool,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "DeploymentResourcePool" + metadata_type: "UpdateDeploymentResourcePoolOperationMetadata" + }; + } + // Delete a DeploymentResourcePool. rpc DeleteDeploymentResourcePool(DeleteDeploymentResourcePoolRequest) returns (google.longrunning.Operation) { @@ -175,6 +191,22 @@ message ListDeploymentResourcePoolsResponse { string next_page_token = 2; } +// Request message for UpdateDeploymentResourcePool method. +message UpdateDeploymentResourcePoolRequest { + // Required. The DeploymentResourcePool to update. + // + // The DeploymentResourcePool's `name` field is used to identify the + // DeploymentResourcePool to update. + // Format: + // `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}` + DeploymentResourcePool deployment_resource_pool = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + // Runtime operation information for UpdateDeploymentResourcePool method. message UpdateDeploymentResourcePoolOperationMetadata { // The operation generic information. diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/evaluation_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/evaluation_service.proto index 818daa91c81..beac5d5cdda 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/evaluation_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/evaluation_service.proto @@ -281,7 +281,10 @@ message BleuInstance { // Spec for bleu score metric - calculates the precision of n-grams in the // prediction as compared to reference - returns a score ranging between 0 to 1. -message BleuSpec {} +message BleuSpec { + // Optional. Whether to use_effective_order to compute bleu score. + bool use_effective_order = 1 [(google.api.field_behavior) = OPTIONAL]; +} // Results for bleu metric. message BleuResults { diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/extension.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/extension.proto index 98b0e427112..a9ef88fb6bd 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/extension.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/extension.proto @@ -358,7 +358,7 @@ message RuntimeConfig { // Code execution runtime configurations for code interpreter extension. CodeInterpreterRuntimeConfig code_interpreter_runtime_config = 2; - // Runtime configuration for Vertext AI Search extension. + // Runtime configuration for Vertex AI Search extension. VertexAISearchRuntimeConfig vertex_ai_search_runtime_config = 6; } diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/llm_utility_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/llm_utility_service.proto index 02fa86a6c0d..f5f554937cc 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/llm_utility_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/llm_utility_service.proto @@ -20,6 +20,7 @@ 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/content.proto"; import "google/protobuf/struct.proto"; option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; @@ -61,11 +62,19 @@ message ComputeTokensRequest { } ]; - // Required. The instances that are the input to token computing API call. + // Optional. The instances that are the input to token computing API call. // Schema is identical to the prediction schema of the text model, even for // the non-text models, like chat models, or Codey models. repeated google.protobuf.Value instances = 2 - [(google.api.field_behavior) = REQUIRED]; + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of the publisher model requested to serve the + // prediction. Format: + // projects/{project}/locations/{location}/publishers/*/models/* + string model = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Input content. + repeated Content contents = 4 [(google.api.field_behavior) = OPTIONAL]; } // Tokens info with a list of tokens and the corresponding list of token ids. @@ -75,6 +84,9 @@ message TokensInfo { // A list of token ids from the input. repeated int64 token_ids = 2; + + // Optional. Optional fields for the role from the corresponding Content. + string role = 3 [(google.api.field_behavior) = OPTIONAL]; } // Response message for ComputeTokens RPC call. diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model.proto index 1a96665350e..2059db6494a 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model.proto @@ -428,6 +428,12 @@ message Model { // only supports specifing the Model Garden models and Genie models. BaseModelSource base_model_source = 50 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Reserved for future use. + bool satisfies_pzs = 51 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + bool satisfies_pzi = 52 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Contains information about the Large Model. diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto index e3f2e947d06..78a279edf4e 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto @@ -163,7 +163,13 @@ message ResourcePool { // The min/max number of replicas allowed if enabling autoscaling message AutoscalingSpec { // Optional. min replicas in the node pool, - // must be ≤ replica_count and < max_replica_count or will throw error + // must be ≤ replica_count and < max_replica_count or will throw error. + // For autoscaling enabled Ray-on-Vertex, we allow min_replica_count of a + // resource_pool to be 0 to match the OSS Ray + // behavior(https://docs.ray.io/en/latest/cluster/vms/user-guides/configuring-autoscaling.html#cluster-config-parameters). + // As for Persistent Resource, the min_replica_count must be > 0, we added + // a corresponding validation inside + // CreatePersistentResourceRequestValidator.java. optional int64 min_replica_count = 1 [(google.api.field_behavior) = OPTIONAL]; @@ -194,7 +200,7 @@ message ResourcePool { // this resource pool. Will replace idle_replica_count. int64 used_replica_count = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Optional. Optional spec to configure GKE autoscaling + // Optional. Optional spec to configure GKE or Ray-on-Vertex autoscaling AutoscalingSpec autoscaling_spec = 7 [(google.api.field_behavior) = OPTIONAL]; } diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/publisher_model.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/publisher_model.proto index b45dea407ea..eff93af47e0 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/publisher_model.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/publisher_model.proto @@ -125,6 +125,14 @@ message PublisherModel { // Model metadata that is needed for UploadModel or // DeployModel/CreateEndpoint requests. message Deploy { + // Metadata information about the deployment for managing deployment + // config. + message DeployMetadata { + // Optional. Labels for the deployment. For managing deployment config + // like verifying, source of deployment config, etc. + map labels = 1 [(google.api.field_behavior) = OPTIONAL]; + } + // The prediction (for example, the machine) resources that the // DeployedModel uses. oneof prediction_resources { @@ -164,6 +172,10 @@ message PublisherModel { optional string deploy_task_name = 10 [(google.api.field_behavior) = OPTIONAL]; + // Optional. Metadata information about this deployment config. + optional DeployMetadata deploy_metadata = 11 + [(google.api.field_behavior) = OPTIONAL]; + // Required. The title of the regional resource reference. string title = 8 [(google.api.field_behavior) = REQUIRED]; diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/tensorboard.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/tensorboard.proto index d4e2e44d7e8..b24a295152b 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/tensorboard.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/tensorboard.proto @@ -93,4 +93,10 @@ message Tensorboard { // TensorBoard instance to be default will mark all other TensorBoard // instances (if any) as non default. bool is_default = 12; + + // Output only. Reserved for future use. + bool satisfies_pzs = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + bool satisfies_pzi = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; } diff --git a/packages/google-cloud-aiplatform/protos/protos.d.ts b/packages/google-cloud-aiplatform/protos/protos.d.ts index d879750aeb3..f301d7b3961 100644 --- a/packages/google-cloud-aiplatform/protos/protos.d.ts +++ b/packages/google-cloud-aiplatform/protos/protos.d.ts @@ -6740,6 +6740,12 @@ export namespace google { /** Model baseModelSource */ baseModelSource?: (google.cloud.aiplatform.v1.Model.IBaseModelSource|null); + + /** Model satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Model satisfiesPzi */ + satisfiesPzi?: (boolean|null); } /** Represents a Model. */ @@ -6844,6 +6850,12 @@ export namespace google { /** Model baseModelSource. */ public baseModelSource?: (google.cloud.aiplatform.v1.Model.IBaseModelSource|null); + /** Model satisfiesPzs. */ + public satisfiesPzs: boolean; + + /** Model satisfiesPzi. */ + public satisfiesPzi: boolean; + /** * Creates a new Model instance using the specified properties. * @param [properties] Properties to set @@ -18465,6 +18477,20 @@ export namespace google { */ public listDeploymentResourcePools(request: google.cloud.aiplatform.v1.IListDeploymentResourcePoolsRequest): Promise; + /** + * Calls UpdateDeploymentResourcePool. + * @param request UpdateDeploymentResourcePoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateDeploymentResourcePool(request: google.cloud.aiplatform.v1.IUpdateDeploymentResourcePoolRequest, callback: google.cloud.aiplatform.v1.DeploymentResourcePoolService.UpdateDeploymentResourcePoolCallback): void; + + /** + * Calls UpdateDeploymentResourcePool. + * @param request UpdateDeploymentResourcePoolRequest message or plain object + * @returns Promise + */ + public updateDeploymentResourcePool(request: google.cloud.aiplatform.v1.IUpdateDeploymentResourcePoolRequest): Promise; + /** * Calls DeleteDeploymentResourcePool. * @param request DeleteDeploymentResourcePoolRequest message or plain object @@ -18517,6 +18543,13 @@ export namespace google { */ type ListDeploymentResourcePoolsCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.ListDeploymentResourcePoolsResponse) => void; + /** + * Callback as used by {@link google.cloud.aiplatform.v1.DeploymentResourcePoolService|updateDeploymentResourcePool}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateDeploymentResourcePoolCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** * Callback as used by {@link google.cloud.aiplatform.v1.DeploymentResourcePoolService|deleteDeploymentResourcePool}. * @param error Error, if any @@ -19047,6 +19080,109 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of an UpdateDeploymentResourcePoolRequest. */ + interface IUpdateDeploymentResourcePoolRequest { + + /** UpdateDeploymentResourcePoolRequest deploymentResourcePool */ + deploymentResourcePool?: (google.cloud.aiplatform.v1.IDeploymentResourcePool|null); + + /** UpdateDeploymentResourcePoolRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateDeploymentResourcePoolRequest. */ + class UpdateDeploymentResourcePoolRequest implements IUpdateDeploymentResourcePoolRequest { + + /** + * Constructs a new UpdateDeploymentResourcePoolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IUpdateDeploymentResourcePoolRequest); + + /** UpdateDeploymentResourcePoolRequest deploymentResourcePool. */ + public deploymentResourcePool?: (google.cloud.aiplatform.v1.IDeploymentResourcePool|null); + + /** UpdateDeploymentResourcePoolRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateDeploymentResourcePoolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDeploymentResourcePoolRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IUpdateDeploymentResourcePoolRequest): google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest; + + /** + * Encodes the specified UpdateDeploymentResourcePoolRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest.verify|verify} messages. + * @param message UpdateDeploymentResourcePoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IUpdateDeploymentResourcePoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDeploymentResourcePoolRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest.verify|verify} messages. + * @param message UpdateDeploymentResourcePoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IUpdateDeploymentResourcePoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDeploymentResourcePoolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDeploymentResourcePoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest; + + /** + * Decodes an UpdateDeploymentResourcePoolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDeploymentResourcePoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest; + + /** + * Verifies an UpdateDeploymentResourcePoolRequest 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 an UpdateDeploymentResourcePoolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDeploymentResourcePoolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest; + + /** + * Creates a plain object from an UpdateDeploymentResourcePoolRequest message. Also converts values to other types if specified. + * @param message UpdateDeploymentResourcePoolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDeploymentResourcePoolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDeploymentResourcePoolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of an UpdateDeploymentResourcePoolOperationMetadata. */ interface IUpdateDeploymentResourcePoolOperationMetadata { @@ -24584,6 +24720,12 @@ export namespace google { /** DedicatedServingEndpoint publicEndpointDomainName */ publicEndpointDomainName?: (string|null); + + /** DedicatedServingEndpoint privateServiceConnectConfig */ + privateServiceConnectConfig?: (google.cloud.aiplatform.v1.IPrivateServiceConnectConfig|null); + + /** DedicatedServingEndpoint serviceAttachment */ + serviceAttachment?: (string|null); } /** Represents a DedicatedServingEndpoint. */ @@ -24598,6 +24740,12 @@ export namespace google { /** DedicatedServingEndpoint publicEndpointDomainName. */ public publicEndpointDomainName: string; + /** DedicatedServingEndpoint privateServiceConnectConfig. */ + public privateServiceConnectConfig?: (google.cloud.aiplatform.v1.IPrivateServiceConnectConfig|null); + + /** DedicatedServingEndpoint serviceAttachment. */ + public serviceAttachment: string; + /** * Creates a new DedicatedServingEndpoint instance using the specified properties. * @param [properties] Properties to set @@ -58424,6 +58572,12 @@ export namespace google { /** ComputeTokensRequest instances */ instances?: (google.protobuf.IValue[]|null); + + /** ComputeTokensRequest model */ + model?: (string|null); + + /** ComputeTokensRequest contents */ + contents?: (google.cloud.aiplatform.v1.IContent[]|null); } /** Represents a ComputeTokensRequest. */ @@ -58441,6 +58595,12 @@ export namespace google { /** ComputeTokensRequest instances. */ public instances: google.protobuf.IValue[]; + /** ComputeTokensRequest model. */ + public model: string; + + /** ComputeTokensRequest contents. */ + public contents: google.cloud.aiplatform.v1.IContent[]; + /** * Creates a new ComputeTokensRequest instance using the specified properties. * @param [properties] Properties to set @@ -58527,6 +58687,9 @@ export namespace google { /** TokensInfo tokenIds */ tokenIds?: ((number|Long|string)[]|null); + + /** TokensInfo role */ + role?: (string|null); } /** Represents a TokensInfo. */ @@ -58544,6 +58707,9 @@ export namespace google { /** TokensInfo tokenIds. */ public tokenIds: (number|Long|string)[]; + /** TokensInfo role. */ + public role: string; + /** * Creates a new TokensInfo instance using the specified properties. * @param [properties] Properties to set @@ -73026,6 +73192,9 @@ export namespace google { /** Deploy deployTaskName */ deployTaskName?: (string|null); + /** Deploy deployMetadata */ + deployMetadata?: (google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.IDeployMetadata|null); + /** Deploy title */ title?: (string|null); @@ -73066,6 +73235,9 @@ export namespace google { /** Deploy deployTaskName. */ public deployTaskName?: (string|null); + /** Deploy deployMetadata. */ + public deployMetadata?: (google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.IDeployMetadata|null); + /** Deploy title. */ public title: string; @@ -73078,6 +73250,9 @@ export namespace google { /** Deploy _deployTaskName. */ public _deployTaskName?: "deployTaskName"; + /** Deploy _deployMetadata. */ + public _deployMetadata?: "deployMetadata"; + /** * Creates a new Deploy instance using the specified properties. * @param [properties] Properties to set @@ -73156,6 +73331,106 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace Deploy { + + /** Properties of a DeployMetadata. */ + interface IDeployMetadata { + + /** DeployMetadata labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a DeployMetadata. */ + class DeployMetadata implements IDeployMetadata { + + /** + * Constructs a new DeployMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.IDeployMetadata); + + /** DeployMetadata labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new DeployMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployMetadata instance + */ + public static create(properties?: google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.IDeployMetadata): google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadata; + + /** + * Encodes the specified DeployMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadata.verify|verify} messages. + * @param message DeployMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.IDeployMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadata.verify|verify} messages. + * @param message DeployMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.IDeployMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadata; + + /** + * Decodes a DeployMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadata; + + /** + * Verifies a DeployMetadata 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 DeployMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadata; + + /** + * Creates a plain object from a DeployMetadata message. Also converts values to other types if specified. + * @param message DeployMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of a DeployGke. */ interface IDeployGke { @@ -95795,6 +96070,12 @@ export namespace google { /** Tensorboard isDefault */ isDefault?: (boolean|null); + + /** Tensorboard satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Tensorboard satisfiesPzi */ + satisfiesPzi?: (boolean|null); } /** Represents a Tensorboard. */ @@ -95839,6 +96120,12 @@ export namespace google { /** Tensorboard isDefault. */ public isDefault: boolean; + /** Tensorboard satisfiesPzs. */ + public satisfiesPzs: boolean; + + /** Tensorboard satisfiesPzi. */ + public satisfiesPzi: boolean; + /** * Creates a new Tensorboard instance using the specified properties. * @param [properties] Properties to set @@ -114707,6 +114994,12 @@ export namespace google { /** Model baseModelSource */ baseModelSource?: (google.cloud.aiplatform.v1beta1.Model.IBaseModelSource|null); + + /** Model satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Model satisfiesPzi */ + satisfiesPzi?: (boolean|null); } /** Represents a Model. */ @@ -114805,6 +115098,12 @@ export namespace google { /** Model baseModelSource. */ public baseModelSource?: (google.cloud.aiplatform.v1beta1.Model.IBaseModelSource|null); + /** Model satisfiesPzs. */ + public satisfiesPzs: boolean; + + /** Model satisfiesPzi. */ + public satisfiesPzi: boolean; + /** * Creates a new Model instance using the specified properties. * @param [properties] Properties to set @@ -127700,6 +127999,20 @@ export namespace google { */ public listDeploymentResourcePools(request: google.cloud.aiplatform.v1beta1.IListDeploymentResourcePoolsRequest): Promise; + /** + * Calls UpdateDeploymentResourcePool. + * @param request UpdateDeploymentResourcePoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateDeploymentResourcePool(request: google.cloud.aiplatform.v1beta1.IUpdateDeploymentResourcePoolRequest, callback: google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService.UpdateDeploymentResourcePoolCallback): void; + + /** + * Calls UpdateDeploymentResourcePool. + * @param request UpdateDeploymentResourcePoolRequest message or plain object + * @returns Promise + */ + public updateDeploymentResourcePool(request: google.cloud.aiplatform.v1beta1.IUpdateDeploymentResourcePoolRequest): Promise; + /** * Calls DeleteDeploymentResourcePool. * @param request DeleteDeploymentResourcePoolRequest message or plain object @@ -127752,6 +128065,13 @@ export namespace google { */ type ListDeploymentResourcePoolsCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1beta1.ListDeploymentResourcePoolsResponse) => void; + /** + * Callback as used by {@link google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService|updateDeploymentResourcePool}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateDeploymentResourcePoolCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** * Callback as used by {@link google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService|deleteDeploymentResourcePool}. * @param error Error, if any @@ -128282,6 +128602,109 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of an UpdateDeploymentResourcePoolRequest. */ + interface IUpdateDeploymentResourcePoolRequest { + + /** UpdateDeploymentResourcePoolRequest deploymentResourcePool */ + deploymentResourcePool?: (google.cloud.aiplatform.v1beta1.IDeploymentResourcePool|null); + + /** UpdateDeploymentResourcePoolRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateDeploymentResourcePoolRequest. */ + class UpdateDeploymentResourcePoolRequest implements IUpdateDeploymentResourcePoolRequest { + + /** + * Constructs a new UpdateDeploymentResourcePoolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IUpdateDeploymentResourcePoolRequest); + + /** UpdateDeploymentResourcePoolRequest deploymentResourcePool. */ + public deploymentResourcePool?: (google.cloud.aiplatform.v1beta1.IDeploymentResourcePool|null); + + /** UpdateDeploymentResourcePoolRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateDeploymentResourcePoolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDeploymentResourcePoolRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IUpdateDeploymentResourcePoolRequest): google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolRequest; + + /** + * Encodes the specified UpdateDeploymentResourcePoolRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolRequest.verify|verify} messages. + * @param message UpdateDeploymentResourcePoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IUpdateDeploymentResourcePoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDeploymentResourcePoolRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolRequest.verify|verify} messages. + * @param message UpdateDeploymentResourcePoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IUpdateDeploymentResourcePoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDeploymentResourcePoolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDeploymentResourcePoolRequest + * @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.UpdateDeploymentResourcePoolRequest; + + /** + * Decodes an UpdateDeploymentResourcePoolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDeploymentResourcePoolRequest + * @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.UpdateDeploymentResourcePoolRequest; + + /** + * Verifies an UpdateDeploymentResourcePoolRequest 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 an UpdateDeploymentResourcePoolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDeploymentResourcePoolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolRequest; + + /** + * Creates a plain object from an UpdateDeploymentResourcePoolRequest message. Also converts values to other types if specified. + * @param message UpdateDeploymentResourcePoolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDeploymentResourcePoolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDeploymentResourcePoolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of an UpdateDeploymentResourcePoolOperationMetadata. */ interface IUpdateDeploymentResourcePoolOperationMetadata { @@ -133606,6 +134029,9 @@ export namespace google { /** Properties of a BleuSpec. */ interface IBleuSpec { + + /** BleuSpec useEffectiveOrder */ + useEffectiveOrder?: (boolean|null); } /** Represents a BleuSpec. */ @@ -133617,6 +134043,9 @@ export namespace google { */ constructor(properties?: google.cloud.aiplatform.v1beta1.IBleuSpec); + /** BleuSpec useEffectiveOrder. */ + public useEffectiveOrder: boolean; + /** * Creates a new BleuSpec instance using the specified properties. * @param [properties] Properties to set @@ -180178,6 +180607,12 @@ export namespace google { /** ComputeTokensRequest instances */ instances?: (google.protobuf.IValue[]|null); + + /** ComputeTokensRequest model */ + model?: (string|null); + + /** ComputeTokensRequest contents */ + contents?: (google.cloud.aiplatform.v1beta1.IContent[]|null); } /** Represents a ComputeTokensRequest. */ @@ -180195,6 +180630,12 @@ export namespace google { /** ComputeTokensRequest instances. */ public instances: google.protobuf.IValue[]; + /** ComputeTokensRequest model. */ + public model: string; + + /** ComputeTokensRequest contents. */ + public contents: google.cloud.aiplatform.v1beta1.IContent[]; + /** * Creates a new ComputeTokensRequest instance using the specified properties. * @param [properties] Properties to set @@ -180281,6 +180722,9 @@ export namespace google { /** TokensInfo tokenIds */ tokenIds?: ((number|Long|string)[]|null); + + /** TokensInfo role */ + role?: (string|null); } /** Represents a TokensInfo. */ @@ -180298,6 +180742,9 @@ export namespace google { /** TokensInfo tokenIds. */ public tokenIds: (number|Long|string)[]; + /** TokensInfo role. */ + public role: string; + /** * Creates a new TokensInfo instance using the specified properties. * @param [properties] Properties to set @@ -192324,6 +192771,9 @@ export namespace google { /** Deploy deployTaskName */ deployTaskName?: (string|null); + /** Deploy deployMetadata */ + deployMetadata?: (google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.IDeployMetadata|null); + /** Deploy title */ title?: (string|null); @@ -192364,6 +192814,9 @@ export namespace google { /** Deploy deployTaskName. */ public deployTaskName?: (string|null); + /** Deploy deployMetadata. */ + public deployMetadata?: (google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.IDeployMetadata|null); + /** Deploy title. */ public title: string; @@ -192376,6 +192829,9 @@ export namespace google { /** Deploy _deployTaskName. */ public _deployTaskName?: "deployTaskName"; + /** Deploy _deployMetadata. */ + public _deployMetadata?: "deployMetadata"; + /** * Creates a new Deploy instance using the specified properties. * @param [properties] Properties to set @@ -192454,6 +192910,106 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace Deploy { + + /** Properties of a DeployMetadata. */ + interface IDeployMetadata { + + /** DeployMetadata labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a DeployMetadata. */ + class DeployMetadata implements IDeployMetadata { + + /** + * Constructs a new DeployMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.IDeployMetadata); + + /** DeployMetadata labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new DeployMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployMetadata instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.IDeployMetadata): google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.DeployMetadata; + + /** + * Encodes the specified DeployMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.DeployMetadata.verify|verify} messages. + * @param message DeployMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.IDeployMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.DeployMetadata.verify|verify} messages. + * @param message DeployMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.IDeployMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployMetadata + * @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.PublisherModel.CallToAction.Deploy.DeployMetadata; + + /** + * Decodes a DeployMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployMetadata + * @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.PublisherModel.CallToAction.Deploy.DeployMetadata; + + /** + * Verifies a DeployMetadata 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 DeployMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.DeployMetadata; + + /** + * Creates a plain object from a DeployMetadata message. Also converts values to other types if specified. + * @param message DeployMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.DeployMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of a DeployGke. */ interface IDeployGke { @@ -231501,6 +232057,12 @@ export namespace google { /** Tensorboard isDefault */ isDefault?: (boolean|null); + + /** Tensorboard satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Tensorboard satisfiesPzi */ + satisfiesPzi?: (boolean|null); } /** Represents a Tensorboard. */ @@ -231545,6 +232107,12 @@ export namespace google { /** Tensorboard isDefault. */ public isDefault: boolean; + /** Tensorboard satisfiesPzs. */ + public satisfiesPzs: boolean; + + /** Tensorboard satisfiesPzi. */ + public satisfiesPzi: boolean; + /** * Creates a new Tensorboard instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-aiplatform/protos/protos.js b/packages/google-cloud-aiplatform/protos/protos.js index a81c8c5b9aa..0bb32f46abb 100644 --- a/packages/google-cloud-aiplatform/protos/protos.js +++ b/packages/google-cloud-aiplatform/protos/protos.js @@ -16934,6 +16934,8 @@ * @property {google.cloud.aiplatform.v1.Model.IOriginalModelInfo|null} [originalModelInfo] Model originalModelInfo * @property {string|null} [metadataArtifact] Model metadataArtifact * @property {google.cloud.aiplatform.v1.Model.IBaseModelSource|null} [baseModelSource] Model baseModelSource + * @property {boolean|null} [satisfiesPzs] Model satisfiesPzs + * @property {boolean|null} [satisfiesPzi] Model satisfiesPzi */ /** @@ -17206,6 +17208,22 @@ */ Model.prototype.baseModelSource = null; + /** + * Model satisfiesPzs. + * @member {boolean} satisfiesPzs + * @memberof google.cloud.aiplatform.v1.Model + * @instance + */ + Model.prototype.satisfiesPzs = false; + + /** + * Model satisfiesPzi. + * @member {boolean} satisfiesPzi + * @memberof google.cloud.aiplatform.v1.Model + * @instance + */ + Model.prototype.satisfiesPzi = false; + /** * Creates a new Model instance using the specified properties. * @function create @@ -17302,6 +17320,10 @@ writer.uint32(/* id 47, wireType 2 =*/378).string(message.pipelineJob); if (message.baseModelSource != null && Object.hasOwnProperty.call(message, "baseModelSource")) $root.google.cloud.aiplatform.v1.Model.BaseModelSource.encode(message.baseModelSource, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 51, wireType 0 =*/408).bool(message.satisfiesPzs); + if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) + writer.uint32(/* id 52, wireType 0 =*/416).bool(message.satisfiesPzi); return writer; }; @@ -17496,6 +17518,14 @@ message.baseModelSource = $root.google.cloud.aiplatform.v1.Model.BaseModelSource.decode(reader, reader.uint32()); break; } + case 51: { + message.satisfiesPzs = reader.bool(); + break; + } + case 52: { + message.satisfiesPzi = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -17690,6 +17720,12 @@ if (error) return "baseModelSource." + error; } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) + if (typeof message.satisfiesPzi !== "boolean") + return "satisfiesPzi: boolean expected"; return null; }; @@ -17869,6 +17905,10 @@ throw TypeError(".google.cloud.aiplatform.v1.Model.baseModelSource: object expected"); message.baseModelSource = $root.google.cloud.aiplatform.v1.Model.BaseModelSource.fromObject(object.baseModelSource); } + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.satisfiesPzi != null) + message.satisfiesPzi = Boolean(object.satisfiesPzi); return message; }; @@ -17920,6 +17960,8 @@ object.metadataArtifact = ""; object.pipelineJob = ""; object.baseModelSource = null; + object.satisfiesPzs = false; + object.satisfiesPzi = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -18005,6 +18047,10 @@ object.pipelineJob = message.pipelineJob; if (message.baseModelSource != null && message.hasOwnProperty("baseModelSource")) object.baseModelSource = $root.google.cloud.aiplatform.v1.Model.BaseModelSource.toObject(message.baseModelSource, options); + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = message.satisfiesPzs; + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) + object.satisfiesPzi = message.satisfiesPzi; return object; }; @@ -47618,6 +47664,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.aiplatform.v1.DeploymentResourcePoolService|updateDeploymentResourcePool}. + * @memberof google.cloud.aiplatform.v1.DeploymentResourcePoolService + * @typedef UpdateDeploymentResourcePoolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateDeploymentResourcePool. + * @function updateDeploymentResourcePool + * @memberof google.cloud.aiplatform.v1.DeploymentResourcePoolService + * @instance + * @param {google.cloud.aiplatform.v1.IUpdateDeploymentResourcePoolRequest} request UpdateDeploymentResourcePoolRequest message or plain object + * @param {google.cloud.aiplatform.v1.DeploymentResourcePoolService.UpdateDeploymentResourcePoolCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DeploymentResourcePoolService.prototype.updateDeploymentResourcePool = function updateDeploymentResourcePool(request, callback) { + return this.rpcCall(updateDeploymentResourcePool, $root.google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateDeploymentResourcePool" }); + + /** + * Calls UpdateDeploymentResourcePool. + * @function updateDeploymentResourcePool + * @memberof google.cloud.aiplatform.v1.DeploymentResourcePoolService + * @instance + * @param {google.cloud.aiplatform.v1.IUpdateDeploymentResourcePoolRequest} request UpdateDeploymentResourcePoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.aiplatform.v1.DeploymentResourcePoolService|deleteDeploymentResourcePool}. * @memberof google.cloud.aiplatform.v1.DeploymentResourcePoolService @@ -48851,6 +48930,243 @@ return ListDeploymentResourcePoolsResponse; })(); + v1.UpdateDeploymentResourcePoolRequest = (function() { + + /** + * Properties of an UpdateDeploymentResourcePoolRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface IUpdateDeploymentResourcePoolRequest + * @property {google.cloud.aiplatform.v1.IDeploymentResourcePool|null} [deploymentResourcePool] UpdateDeploymentResourcePoolRequest deploymentResourcePool + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDeploymentResourcePoolRequest updateMask + */ + + /** + * Constructs a new UpdateDeploymentResourcePoolRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents an UpdateDeploymentResourcePoolRequest. + * @implements IUpdateDeploymentResourcePoolRequest + * @constructor + * @param {google.cloud.aiplatform.v1.IUpdateDeploymentResourcePoolRequest=} [properties] Properties to set + */ + function UpdateDeploymentResourcePoolRequest(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]]; + } + + /** + * UpdateDeploymentResourcePoolRequest deploymentResourcePool. + * @member {google.cloud.aiplatform.v1.IDeploymentResourcePool|null|undefined} deploymentResourcePool + * @memberof google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest + * @instance + */ + UpdateDeploymentResourcePoolRequest.prototype.deploymentResourcePool = null; + + /** + * UpdateDeploymentResourcePoolRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest + * @instance + */ + UpdateDeploymentResourcePoolRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateDeploymentResourcePoolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest + * @static + * @param {google.cloud.aiplatform.v1.IUpdateDeploymentResourcePoolRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest} UpdateDeploymentResourcePoolRequest instance + */ + UpdateDeploymentResourcePoolRequest.create = function create(properties) { + return new UpdateDeploymentResourcePoolRequest(properties); + }; + + /** + * Encodes the specified UpdateDeploymentResourcePoolRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest + * @static + * @param {google.cloud.aiplatform.v1.IUpdateDeploymentResourcePoolRequest} message UpdateDeploymentResourcePoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDeploymentResourcePoolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deploymentResourcePool != null && Object.hasOwnProperty.call(message, "deploymentResourcePool")) + $root.google.cloud.aiplatform.v1.DeploymentResourcePool.encode(message.deploymentResourcePool, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateDeploymentResourcePoolRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest + * @static + * @param {google.cloud.aiplatform.v1.IUpdateDeploymentResourcePoolRequest} message UpdateDeploymentResourcePoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDeploymentResourcePoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDeploymentResourcePoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest} UpdateDeploymentResourcePoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDeploymentResourcePoolRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deploymentResourcePool = $root.google.cloud.aiplatform.v1.DeploymentResourcePool.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDeploymentResourcePoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest} UpdateDeploymentResourcePoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDeploymentResourcePoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDeploymentResourcePoolRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDeploymentResourcePoolRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deploymentResourcePool != null && message.hasOwnProperty("deploymentResourcePool")) { + var error = $root.google.cloud.aiplatform.v1.DeploymentResourcePool.verify(message.deploymentResourcePool); + if (error) + return "deploymentResourcePool." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateDeploymentResourcePoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest} UpdateDeploymentResourcePoolRequest + */ + UpdateDeploymentResourcePoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest(); + if (object.deploymentResourcePool != null) { + if (typeof object.deploymentResourcePool !== "object") + throw TypeError(".google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest.deploymentResourcePool: object expected"); + message.deploymentResourcePool = $root.google.cloud.aiplatform.v1.DeploymentResourcePool.fromObject(object.deploymentResourcePool); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateDeploymentResourcePoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest + * @static + * @param {google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest} message UpdateDeploymentResourcePoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDeploymentResourcePoolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.deploymentResourcePool = null; + object.updateMask = null; + } + if (message.deploymentResourcePool != null && message.hasOwnProperty("deploymentResourcePool")) + object.deploymentResourcePool = $root.google.cloud.aiplatform.v1.DeploymentResourcePool.toObject(message.deploymentResourcePool, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateDeploymentResourcePoolRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDeploymentResourcePoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDeploymentResourcePoolRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDeploymentResourcePoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest"; + }; + + return UpdateDeploymentResourcePoolRequest; + })(); + v1.UpdateDeploymentResourcePoolOperationMetadata = (function() { /** @@ -62867,6 +63183,8 @@ * @memberof google.cloud.aiplatform.v1.FeatureOnlineStore * @interface IDedicatedServingEndpoint * @property {string|null} [publicEndpointDomainName] DedicatedServingEndpoint publicEndpointDomainName + * @property {google.cloud.aiplatform.v1.IPrivateServiceConnectConfig|null} [privateServiceConnectConfig] DedicatedServingEndpoint privateServiceConnectConfig + * @property {string|null} [serviceAttachment] DedicatedServingEndpoint serviceAttachment */ /** @@ -62892,6 +63210,22 @@ */ DedicatedServingEndpoint.prototype.publicEndpointDomainName = ""; + /** + * DedicatedServingEndpoint privateServiceConnectConfig. + * @member {google.cloud.aiplatform.v1.IPrivateServiceConnectConfig|null|undefined} privateServiceConnectConfig + * @memberof google.cloud.aiplatform.v1.FeatureOnlineStore.DedicatedServingEndpoint + * @instance + */ + DedicatedServingEndpoint.prototype.privateServiceConnectConfig = null; + + /** + * DedicatedServingEndpoint serviceAttachment. + * @member {string} serviceAttachment + * @memberof google.cloud.aiplatform.v1.FeatureOnlineStore.DedicatedServingEndpoint + * @instance + */ + DedicatedServingEndpoint.prototype.serviceAttachment = ""; + /** * Creates a new DedicatedServingEndpoint instance using the specified properties. * @function create @@ -62918,6 +63252,10 @@ writer = $Writer.create(); if (message.publicEndpointDomainName != null && Object.hasOwnProperty.call(message, "publicEndpointDomainName")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.publicEndpointDomainName); + if (message.privateServiceConnectConfig != null && Object.hasOwnProperty.call(message, "privateServiceConnectConfig")) + $root.google.cloud.aiplatform.v1.PrivateServiceConnectConfig.encode(message.privateServiceConnectConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.serviceAttachment != null && Object.hasOwnProperty.call(message, "serviceAttachment")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.serviceAttachment); return writer; }; @@ -62956,6 +63294,14 @@ message.publicEndpointDomainName = reader.string(); break; } + case 3: { + message.privateServiceConnectConfig = $root.google.cloud.aiplatform.v1.PrivateServiceConnectConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.serviceAttachment = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -62994,6 +63340,14 @@ if (message.publicEndpointDomainName != null && message.hasOwnProperty("publicEndpointDomainName")) if (!$util.isString(message.publicEndpointDomainName)) return "publicEndpointDomainName: string expected"; + if (message.privateServiceConnectConfig != null && message.hasOwnProperty("privateServiceConnectConfig")) { + var error = $root.google.cloud.aiplatform.v1.PrivateServiceConnectConfig.verify(message.privateServiceConnectConfig); + if (error) + return "privateServiceConnectConfig." + error; + } + if (message.serviceAttachment != null && message.hasOwnProperty("serviceAttachment")) + if (!$util.isString(message.serviceAttachment)) + return "serviceAttachment: string expected"; return null; }; @@ -63011,6 +63365,13 @@ var message = new $root.google.cloud.aiplatform.v1.FeatureOnlineStore.DedicatedServingEndpoint(); if (object.publicEndpointDomainName != null) message.publicEndpointDomainName = String(object.publicEndpointDomainName); + if (object.privateServiceConnectConfig != null) { + if (typeof object.privateServiceConnectConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1.FeatureOnlineStore.DedicatedServingEndpoint.privateServiceConnectConfig: object expected"); + message.privateServiceConnectConfig = $root.google.cloud.aiplatform.v1.PrivateServiceConnectConfig.fromObject(object.privateServiceConnectConfig); + } + if (object.serviceAttachment != null) + message.serviceAttachment = String(object.serviceAttachment); return message; }; @@ -63027,10 +63388,17 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.publicEndpointDomainName = ""; + object.privateServiceConnectConfig = null; + object.serviceAttachment = ""; + } if (message.publicEndpointDomainName != null && message.hasOwnProperty("publicEndpointDomainName")) object.publicEndpointDomainName = message.publicEndpointDomainName; + if (message.privateServiceConnectConfig != null && message.hasOwnProperty("privateServiceConnectConfig")) + object.privateServiceConnectConfig = $root.google.cloud.aiplatform.v1.PrivateServiceConnectConfig.toObject(message.privateServiceConnectConfig, options); + if (message.serviceAttachment != null && message.hasOwnProperty("serviceAttachment")) + object.serviceAttachment = message.serviceAttachment; return object; }; @@ -144328,6 +144696,8 @@ * @interface IComputeTokensRequest * @property {string|null} [endpoint] ComputeTokensRequest endpoint * @property {Array.|null} [instances] ComputeTokensRequest instances + * @property {string|null} [model] ComputeTokensRequest model + * @property {Array.|null} [contents] ComputeTokensRequest contents */ /** @@ -144340,6 +144710,7 @@ */ function ComputeTokensRequest(properties) { this.instances = []; + this.contents = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -144362,6 +144733,22 @@ */ ComputeTokensRequest.prototype.instances = $util.emptyArray; + /** + * ComputeTokensRequest model. + * @member {string} model + * @memberof google.cloud.aiplatform.v1.ComputeTokensRequest + * @instance + */ + ComputeTokensRequest.prototype.model = ""; + + /** + * ComputeTokensRequest contents. + * @member {Array.} contents + * @memberof google.cloud.aiplatform.v1.ComputeTokensRequest + * @instance + */ + ComputeTokensRequest.prototype.contents = $util.emptyArray; + /** * Creates a new ComputeTokensRequest instance using the specified properties. * @function create @@ -144391,6 +144778,11 @@ if (message.instances != null && message.instances.length) for (var i = 0; i < message.instances.length; ++i) $root.google.protobuf.Value.encode(message.instances[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.model); + if (message.contents != null && message.contents.length) + for (var i = 0; i < message.contents.length; ++i) + $root.google.cloud.aiplatform.v1.Content.encode(message.contents[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -144435,6 +144827,16 @@ message.instances.push($root.google.protobuf.Value.decode(reader, reader.uint32())); break; } + case 3: { + message.model = reader.string(); + break; + } + case 4: { + if (!(message.contents && message.contents.length)) + message.contents = []; + message.contents.push($root.google.cloud.aiplatform.v1.Content.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -144482,6 +144884,18 @@ return "instances." + error; } } + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.contents != null && message.hasOwnProperty("contents")) { + if (!Array.isArray(message.contents)) + return "contents: array expected"; + for (var i = 0; i < message.contents.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.Content.verify(message.contents[i]); + if (error) + return "contents." + error; + } + } return null; }; @@ -144509,6 +144923,18 @@ message.instances[i] = $root.google.protobuf.Value.fromObject(object.instances[i]); } } + if (object.model != null) + message.model = String(object.model); + if (object.contents) { + if (!Array.isArray(object.contents)) + throw TypeError(".google.cloud.aiplatform.v1.ComputeTokensRequest.contents: array expected"); + message.contents = []; + for (var i = 0; i < object.contents.length; ++i) { + if (typeof object.contents[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ComputeTokensRequest.contents: object expected"); + message.contents[i] = $root.google.cloud.aiplatform.v1.Content.fromObject(object.contents[i]); + } + } return message; }; @@ -144525,10 +144951,14 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.instances = []; - if (options.defaults) + object.contents = []; + } + if (options.defaults) { object.endpoint = ""; + object.model = ""; + } if (message.endpoint != null && message.hasOwnProperty("endpoint")) object.endpoint = message.endpoint; if (message.instances && message.instances.length) { @@ -144536,6 +144966,13 @@ for (var j = 0; j < message.instances.length; ++j) object.instances[j] = $root.google.protobuf.Value.toObject(message.instances[j], options); } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.contents && message.contents.length) { + object.contents = []; + for (var j = 0; j < message.contents.length; ++j) + object.contents[j] = $root.google.cloud.aiplatform.v1.Content.toObject(message.contents[j], options); + } return object; }; @@ -144576,6 +145013,7 @@ * @interface ITokensInfo * @property {Array.|null} [tokens] TokensInfo tokens * @property {Array.|null} [tokenIds] TokensInfo tokenIds + * @property {string|null} [role] TokensInfo role */ /** @@ -144611,6 +145049,14 @@ */ TokensInfo.prototype.tokenIds = $util.emptyArray; + /** + * TokensInfo role. + * @member {string} role + * @memberof google.cloud.aiplatform.v1.TokensInfo + * @instance + */ + TokensInfo.prototype.role = ""; + /** * Creates a new TokensInfo instance using the specified properties. * @function create @@ -144644,6 +145090,8 @@ writer.int64(message.tokenIds[i]); writer.ldelim(); } + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.role); return writer; }; @@ -144695,6 +145143,10 @@ message.tokenIds.push(reader.int64()); break; } + case 3: { + message.role = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -144744,6 +145196,9 @@ if (!$util.isInteger(message.tokenIds[i]) && !(message.tokenIds[i] && $util.isInteger(message.tokenIds[i].low) && $util.isInteger(message.tokenIds[i].high))) return "tokenIds: integer|Long[] expected"; } + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; return null; }; @@ -144783,6 +145238,8 @@ else if (typeof object.tokenIds[i] === "object") message.tokenIds[i] = new $util.LongBits(object.tokenIds[i].low >>> 0, object.tokenIds[i].high >>> 0).toNumber(); } + if (object.role != null) + message.role = String(object.role); return message; }; @@ -144803,6 +145260,8 @@ object.tokens = []; object.tokenIds = []; } + if (options.defaults) + object.role = ""; if (message.tokens && message.tokens.length) { object.tokens = []; for (var j = 0; j < message.tokens.length; ++j) @@ -144816,6 +145275,8 @@ else object.tokenIds[j] = options.longs === String ? $util.Long.prototype.toString.call(message.tokenIds[j]) : options.longs === Number ? new $util.LongBits(message.tokenIds[j].low >>> 0, message.tokenIds[j].high >>> 0).toNumber() : message.tokenIds[j]; } + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; return object; }; @@ -178535,6 +178996,7 @@ * @property {google.cloud.aiplatform.v1.IModelContainerSpec|null} [containerSpec] Deploy containerSpec * @property {string|null} [artifactUri] Deploy artifactUri * @property {string|null} [deployTaskName] Deploy deployTaskName + * @property {google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.IDeployMetadata|null} [deployMetadata] Deploy deployMetadata * @property {string|null} [title] Deploy title * @property {string|null} [publicArtifactUri] Deploy publicArtifactUri */ @@ -178618,6 +179080,14 @@ */ Deploy.prototype.deployTaskName = null; + /** + * Deploy deployMetadata. + * @member {google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.IDeployMetadata|null|undefined} deployMetadata + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy + * @instance + */ + Deploy.prototype.deployMetadata = null; + /** * Deploy title. * @member {string} title @@ -178659,6 +179129,17 @@ set: $util.oneOfSetter($oneOfFields) }); + /** + * Deploy _deployMetadata. + * @member {"deployMetadata"|undefined} _deployMetadata + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy + * @instance + */ + Object.defineProperty(Deploy.prototype, "_deployMetadata", { + get: $util.oneOfGetter($oneOfFields = ["deployMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new Deploy instance using the specified properties. * @function create @@ -178703,6 +179184,8 @@ writer.uint32(/* id 9, wireType 2 =*/74).string(message.publicArtifactUri); if (message.deployTaskName != null && Object.hasOwnProperty.call(message, "deployTaskName")) writer.uint32(/* id 10, wireType 2 =*/82).string(message.deployTaskName); + if (message.deployMetadata != null && Object.hasOwnProperty.call(message, "deployMetadata")) + $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadata.encode(message.deployMetadata, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); return writer; }; @@ -178769,6 +179252,10 @@ message.deployTaskName = reader.string(); break; } + case 11: { + message.deployMetadata = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadata.decode(reader, reader.uint32()); + break; + } case 8: { message.title = reader.string(); break; @@ -178859,6 +179346,14 @@ if (!$util.isString(message.deployTaskName)) return "deployTaskName: string expected"; } + if (message.deployMetadata != null && message.hasOwnProperty("deployMetadata")) { + properties._deployMetadata = 1; + { + var error = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadata.verify(message.deployMetadata); + if (error) + return "deployMetadata." + error; + } + } if (message.title != null && message.hasOwnProperty("title")) if (!$util.isString(message.title)) return "title: string expected"; @@ -178908,6 +179403,11 @@ message.artifactUri = String(object.artifactUri); if (object.deployTaskName != null) message.deployTaskName = String(object.deployTaskName); + if (object.deployMetadata != null) { + if (typeof object.deployMetadata !== "object") + throw TypeError(".google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.deployMetadata: object expected"); + message.deployMetadata = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadata.fromObject(object.deployMetadata); + } if (object.title != null) message.title = String(object.title); if (object.publicArtifactUri != null) @@ -178968,6 +179468,11 @@ if (options.oneofs) object._deployTaskName = "deployTaskName"; } + if (message.deployMetadata != null && message.hasOwnProperty("deployMetadata")) { + object.deployMetadata = $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadata.toObject(message.deployMetadata, options); + if (options.oneofs) + object._deployMetadata = "deployMetadata"; + } return object; }; @@ -178997,6 +179502,244 @@ return typeUrlPrefix + "/google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy"; }; + Deploy.DeployMetadata = (function() { + + /** + * Properties of a DeployMetadata. + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy + * @interface IDeployMetadata + * @property {Object.|null} [labels] DeployMetadata labels + */ + + /** + * Constructs a new DeployMetadata. + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy + * @classdesc Represents a DeployMetadata. + * @implements IDeployMetadata + * @constructor + * @param {google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.IDeployMetadata=} [properties] Properties to set + */ + function DeployMetadata(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]]; + } + + /** + * DeployMetadata labels. + * @member {Object.} labels + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadata + * @instance + */ + DeployMetadata.prototype.labels = $util.emptyObject; + + /** + * Creates a new DeployMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadata + * @static + * @param {google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.IDeployMetadata=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadata} DeployMetadata instance + */ + DeployMetadata.create = function create(properties) { + return new DeployMetadata(properties); + }; + + /** + * Encodes the specified DeployMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadata + * @static + * @param {google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.IDeployMetadata} message DeployMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + 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 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeployMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadata + * @static + * @param {google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.IDeployMetadata} message DeployMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadata} DeployMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadata(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeployMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadata} DeployMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployMetadata message. + * @function verify + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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"; + } + return null; + }; + + /** + * Creates a DeployMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadata} DeployMetadata + */ + DeployMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadata) + return object; + var message = new $root.google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadata(); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadata.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]]); + } + return message; + }; + + /** + * Creates a plain object from a DeployMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadata + * @static + * @param {google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadata} message DeployMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + 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]]; + } + return object; + }; + + /** + * Converts this DeployMetadata to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadata + * @instance + * @returns {Object.} JSON object + */ + DeployMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployMetadata + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.PublisherModel.CallToAction.Deploy.DeployMetadata"; + }; + + return DeployMetadata; + })(); + return Deploy; })(); @@ -232965,6 +233708,8 @@ * @property {Object.|null} [labels] Tensorboard labels * @property {string|null} [etag] Tensorboard etag * @property {boolean|null} [isDefault] Tensorboard isDefault + * @property {boolean|null} [satisfiesPzs] Tensorboard satisfiesPzs + * @property {boolean|null} [satisfiesPzi] Tensorboard satisfiesPzi */ /** @@ -233071,6 +233816,22 @@ */ Tensorboard.prototype.isDefault = false; + /** + * Tensorboard satisfiesPzs. + * @member {boolean} satisfiesPzs + * @memberof google.cloud.aiplatform.v1.Tensorboard + * @instance + */ + Tensorboard.prototype.satisfiesPzs = false; + + /** + * Tensorboard satisfiesPzi. + * @member {boolean} satisfiesPzi + * @memberof google.cloud.aiplatform.v1.Tensorboard + * @instance + */ + Tensorboard.prototype.satisfiesPzi = false; + /** * Creates a new Tensorboard instance using the specified properties. * @function create @@ -233118,6 +233879,10 @@ $root.google.cloud.aiplatform.v1.EncryptionSpec.encode(message.encryptionSpec, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); if (message.isDefault != null && Object.hasOwnProperty.call(message, "isDefault")) writer.uint32(/* id 12, wireType 0 =*/96).bool(message.isDefault); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.satisfiesPzs); + if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.satisfiesPzi); return writer; }; @@ -233215,6 +233980,14 @@ message.isDefault = reader.bool(); break; } + case 13: { + message.satisfiesPzs = reader.bool(); + break; + } + case 14: { + message.satisfiesPzi = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -233294,6 +234067,12 @@ if (message.isDefault != null && message.hasOwnProperty("isDefault")) if (typeof message.isDefault !== "boolean") return "isDefault: boolean expected"; + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) + if (typeof message.satisfiesPzi !== "boolean") + return "satisfiesPzi: boolean expected"; return null; }; @@ -233345,6 +234124,10 @@ message.etag = String(object.etag); if (object.isDefault != null) message.isDefault = Boolean(object.isDefault); + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.satisfiesPzi != null) + message.satisfiesPzi = Boolean(object.satisfiesPzi); return message; }; @@ -233374,6 +234157,8 @@ object.blobStoragePathPrefix = ""; object.encryptionSpec = null; object.isDefault = false; + object.satisfiesPzs = false; + object.satisfiesPzi = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -233401,6 +234186,10 @@ object.encryptionSpec = $root.google.cloud.aiplatform.v1.EncryptionSpec.toObject(message.encryptionSpec, options); if (message.isDefault != null && message.hasOwnProperty("isDefault")) object.isDefault = message.isDefault; + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = message.satisfiesPzs; + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) + object.satisfiesPzi = message.satisfiesPzi; return object; }; @@ -278657,6 +279446,8 @@ * @property {google.cloud.aiplatform.v1beta1.Model.IOriginalModelInfo|null} [originalModelInfo] Model originalModelInfo * @property {string|null} [metadataArtifact] Model metadataArtifact * @property {google.cloud.aiplatform.v1beta1.Model.IBaseModelSource|null} [baseModelSource] Model baseModelSource + * @property {boolean|null} [satisfiesPzs] Model satisfiesPzs + * @property {boolean|null} [satisfiesPzi] Model satisfiesPzi */ /** @@ -278913,6 +279704,22 @@ */ Model.prototype.baseModelSource = null; + /** + * Model satisfiesPzs. + * @member {boolean} satisfiesPzs + * @memberof google.cloud.aiplatform.v1beta1.Model + * @instance + */ + Model.prototype.satisfiesPzs = false; + + /** + * Model satisfiesPzi. + * @member {boolean} satisfiesPzi + * @memberof google.cloud.aiplatform.v1beta1.Model + * @instance + */ + Model.prototype.satisfiesPzi = false; + /** * Creates a new Model instance using the specified properties. * @function create @@ -279005,6 +279812,10 @@ writer.uint32(/* id 44, wireType 2 =*/354).string(message.metadataArtifact); if (message.baseModelSource != null && Object.hasOwnProperty.call(message, "baseModelSource")) $root.google.cloud.aiplatform.v1beta1.Model.BaseModelSource.encode(message.baseModelSource, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 51, wireType 0 =*/408).bool(message.satisfiesPzs); + if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) + writer.uint32(/* id 52, wireType 0 =*/416).bool(message.satisfiesPzi); return writer; }; @@ -279191,6 +280002,14 @@ message.baseModelSource = $root.google.cloud.aiplatform.v1beta1.Model.BaseModelSource.decode(reader, reader.uint32()); break; } + case 51: { + message.satisfiesPzs = reader.bool(); + break; + } + case 52: { + message.satisfiesPzi = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -279377,6 +280196,12 @@ if (error) return "baseModelSource." + error; } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) + if (typeof message.satisfiesPzi !== "boolean") + return "satisfiesPzi: boolean expected"; return null; }; @@ -279549,6 +280374,10 @@ throw TypeError(".google.cloud.aiplatform.v1beta1.Model.baseModelSource: object expected"); message.baseModelSource = $root.google.cloud.aiplatform.v1beta1.Model.BaseModelSource.fromObject(object.baseModelSource); } + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.satisfiesPzi != null) + message.satisfiesPzi = Boolean(object.satisfiesPzi); return message; }; @@ -279598,6 +280427,8 @@ object.modelSourceInfo = null; object.metadataArtifact = ""; object.baseModelSource = null; + object.satisfiesPzs = false; + object.satisfiesPzi = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -279679,6 +280510,10 @@ object.metadataArtifact = message.metadataArtifact; if (message.baseModelSource != null && message.hasOwnProperty("baseModelSource")) object.baseModelSource = $root.google.cloud.aiplatform.v1beta1.Model.BaseModelSource.toObject(message.baseModelSource, options); + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = message.satisfiesPzs; + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) + object.satisfiesPzi = message.satisfiesPzi; return object; }; @@ -312603,6 +313438,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService|updateDeploymentResourcePool}. + * @memberof google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService + * @typedef UpdateDeploymentResourcePoolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateDeploymentResourcePool. + * @function updateDeploymentResourcePool + * @memberof google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService + * @instance + * @param {google.cloud.aiplatform.v1beta1.IUpdateDeploymentResourcePoolRequest} request UpdateDeploymentResourcePoolRequest message or plain object + * @param {google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService.UpdateDeploymentResourcePoolCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DeploymentResourcePoolService.prototype.updateDeploymentResourcePool = function updateDeploymentResourcePool(request, callback) { + return this.rpcCall(updateDeploymentResourcePool, $root.google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateDeploymentResourcePool" }); + + /** + * Calls UpdateDeploymentResourcePool. + * @function updateDeploymentResourcePool + * @memberof google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService + * @instance + * @param {google.cloud.aiplatform.v1beta1.IUpdateDeploymentResourcePoolRequest} request UpdateDeploymentResourcePoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService|deleteDeploymentResourcePool}. * @memberof google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService @@ -313836,6 +314704,243 @@ return ListDeploymentResourcePoolsResponse; })(); + v1beta1.UpdateDeploymentResourcePoolRequest = (function() { + + /** + * Properties of an UpdateDeploymentResourcePoolRequest. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IUpdateDeploymentResourcePoolRequest + * @property {google.cloud.aiplatform.v1beta1.IDeploymentResourcePool|null} [deploymentResourcePool] UpdateDeploymentResourcePoolRequest deploymentResourcePool + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDeploymentResourcePoolRequest updateMask + */ + + /** + * Constructs a new UpdateDeploymentResourcePoolRequest. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents an UpdateDeploymentResourcePoolRequest. + * @implements IUpdateDeploymentResourcePoolRequest + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IUpdateDeploymentResourcePoolRequest=} [properties] Properties to set + */ + function UpdateDeploymentResourcePoolRequest(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]]; + } + + /** + * UpdateDeploymentResourcePoolRequest deploymentResourcePool. + * @member {google.cloud.aiplatform.v1beta1.IDeploymentResourcePool|null|undefined} deploymentResourcePool + * @memberof google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolRequest + * @instance + */ + UpdateDeploymentResourcePoolRequest.prototype.deploymentResourcePool = null; + + /** + * UpdateDeploymentResourcePoolRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolRequest + * @instance + */ + UpdateDeploymentResourcePoolRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateDeploymentResourcePoolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IUpdateDeploymentResourcePoolRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolRequest} UpdateDeploymentResourcePoolRequest instance + */ + UpdateDeploymentResourcePoolRequest.create = function create(properties) { + return new UpdateDeploymentResourcePoolRequest(properties); + }; + + /** + * Encodes the specified UpdateDeploymentResourcePoolRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IUpdateDeploymentResourcePoolRequest} message UpdateDeploymentResourcePoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDeploymentResourcePoolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deploymentResourcePool != null && Object.hasOwnProperty.call(message, "deploymentResourcePool")) + $root.google.cloud.aiplatform.v1beta1.DeploymentResourcePool.encode(message.deploymentResourcePool, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateDeploymentResourcePoolRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IUpdateDeploymentResourcePoolRequest} message UpdateDeploymentResourcePoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDeploymentResourcePoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDeploymentResourcePoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolRequest + * @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.UpdateDeploymentResourcePoolRequest} UpdateDeploymentResourcePoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDeploymentResourcePoolRequest.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.UpdateDeploymentResourcePoolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deploymentResourcePool = $root.google.cloud.aiplatform.v1beta1.DeploymentResourcePool.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDeploymentResourcePoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolRequest} UpdateDeploymentResourcePoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDeploymentResourcePoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDeploymentResourcePoolRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDeploymentResourcePoolRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deploymentResourcePool != null && message.hasOwnProperty("deploymentResourcePool")) { + var error = $root.google.cloud.aiplatform.v1beta1.DeploymentResourcePool.verify(message.deploymentResourcePool); + if (error) + return "deploymentResourcePool." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateDeploymentResourcePoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolRequest} UpdateDeploymentResourcePoolRequest + */ + UpdateDeploymentResourcePoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolRequest(); + if (object.deploymentResourcePool != null) { + if (typeof object.deploymentResourcePool !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolRequest.deploymentResourcePool: object expected"); + message.deploymentResourcePool = $root.google.cloud.aiplatform.v1beta1.DeploymentResourcePool.fromObject(object.deploymentResourcePool); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateDeploymentResourcePoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolRequest} message UpdateDeploymentResourcePoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDeploymentResourcePoolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.deploymentResourcePool = null; + object.updateMask = null; + } + if (message.deploymentResourcePool != null && message.hasOwnProperty("deploymentResourcePool")) + object.deploymentResourcePool = $root.google.cloud.aiplatform.v1beta1.DeploymentResourcePool.toObject(message.deploymentResourcePool, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateDeploymentResourcePoolRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDeploymentResourcePoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDeploymentResourcePoolRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDeploymentResourcePoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolRequest"; + }; + + return UpdateDeploymentResourcePoolRequest; + })(); + v1beta1.UpdateDeploymentResourcePoolOperationMetadata = (function() { /** @@ -327493,6 +328598,7 @@ * Properties of a BleuSpec. * @memberof google.cloud.aiplatform.v1beta1 * @interface IBleuSpec + * @property {boolean|null} [useEffectiveOrder] BleuSpec useEffectiveOrder */ /** @@ -327510,6 +328616,14 @@ this[keys[i]] = properties[keys[i]]; } + /** + * BleuSpec useEffectiveOrder. + * @member {boolean} useEffectiveOrder + * @memberof google.cloud.aiplatform.v1beta1.BleuSpec + * @instance + */ + BleuSpec.prototype.useEffectiveOrder = false; + /** * Creates a new BleuSpec instance using the specified properties. * @function create @@ -327534,6 +328648,8 @@ BleuSpec.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.useEffectiveOrder != null && Object.hasOwnProperty.call(message, "useEffectiveOrder")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.useEffectiveOrder); return writer; }; @@ -327568,6 +328684,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + message.useEffectiveOrder = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -327603,6 +328723,9 @@ BleuSpec.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.useEffectiveOrder != null && message.hasOwnProperty("useEffectiveOrder")) + if (typeof message.useEffectiveOrder !== "boolean") + return "useEffectiveOrder: boolean expected"; return null; }; @@ -327617,7 +328740,10 @@ BleuSpec.fromObject = function fromObject(object) { if (object instanceof $root.google.cloud.aiplatform.v1beta1.BleuSpec) return object; - return new $root.google.cloud.aiplatform.v1beta1.BleuSpec(); + var message = new $root.google.cloud.aiplatform.v1beta1.BleuSpec(); + if (object.useEffectiveOrder != null) + message.useEffectiveOrder = Boolean(object.useEffectiveOrder); + return message; }; /** @@ -327629,8 +328755,15 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BleuSpec.toObject = function toObject() { - return {}; + BleuSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.useEffectiveOrder = false; + if (message.useEffectiveOrder != null && message.hasOwnProperty("useEffectiveOrder")) + object.useEffectiveOrder = message.useEffectiveOrder; + return object; }; /** @@ -438932,6 +440065,8 @@ * @interface IComputeTokensRequest * @property {string|null} [endpoint] ComputeTokensRequest endpoint * @property {Array.|null} [instances] ComputeTokensRequest instances + * @property {string|null} [model] ComputeTokensRequest model + * @property {Array.|null} [contents] ComputeTokensRequest contents */ /** @@ -438944,6 +440079,7 @@ */ function ComputeTokensRequest(properties) { this.instances = []; + this.contents = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -438966,6 +440102,22 @@ */ ComputeTokensRequest.prototype.instances = $util.emptyArray; + /** + * ComputeTokensRequest model. + * @member {string} model + * @memberof google.cloud.aiplatform.v1beta1.ComputeTokensRequest + * @instance + */ + ComputeTokensRequest.prototype.model = ""; + + /** + * ComputeTokensRequest contents. + * @member {Array.} contents + * @memberof google.cloud.aiplatform.v1beta1.ComputeTokensRequest + * @instance + */ + ComputeTokensRequest.prototype.contents = $util.emptyArray; + /** * Creates a new ComputeTokensRequest instance using the specified properties. * @function create @@ -438995,6 +440147,11 @@ if (message.instances != null && message.instances.length) for (var i = 0; i < message.instances.length; ++i) $root.google.protobuf.Value.encode(message.instances[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.model); + if (message.contents != null && message.contents.length) + for (var i = 0; i < message.contents.length; ++i) + $root.google.cloud.aiplatform.v1beta1.Content.encode(message.contents[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -439039,6 +440196,16 @@ message.instances.push($root.google.protobuf.Value.decode(reader, reader.uint32())); break; } + case 3: { + message.model = reader.string(); + break; + } + case 4: { + if (!(message.contents && message.contents.length)) + message.contents = []; + message.contents.push($root.google.cloud.aiplatform.v1beta1.Content.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -439086,6 +440253,18 @@ return "instances." + error; } } + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.contents != null && message.hasOwnProperty("contents")) { + if (!Array.isArray(message.contents)) + return "contents: array expected"; + for (var i = 0; i < message.contents.length; ++i) { + var error = $root.google.cloud.aiplatform.v1beta1.Content.verify(message.contents[i]); + if (error) + return "contents." + error; + } + } return null; }; @@ -439113,6 +440292,18 @@ message.instances[i] = $root.google.protobuf.Value.fromObject(object.instances[i]); } } + if (object.model != null) + message.model = String(object.model); + if (object.contents) { + if (!Array.isArray(object.contents)) + throw TypeError(".google.cloud.aiplatform.v1beta1.ComputeTokensRequest.contents: array expected"); + message.contents = []; + for (var i = 0; i < object.contents.length; ++i) { + if (typeof object.contents[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.ComputeTokensRequest.contents: object expected"); + message.contents[i] = $root.google.cloud.aiplatform.v1beta1.Content.fromObject(object.contents[i]); + } + } return message; }; @@ -439129,10 +440320,14 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.instances = []; - if (options.defaults) + object.contents = []; + } + if (options.defaults) { object.endpoint = ""; + object.model = ""; + } if (message.endpoint != null && message.hasOwnProperty("endpoint")) object.endpoint = message.endpoint; if (message.instances && message.instances.length) { @@ -439140,6 +440335,13 @@ for (var j = 0; j < message.instances.length; ++j) object.instances[j] = $root.google.protobuf.Value.toObject(message.instances[j], options); } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.contents && message.contents.length) { + object.contents = []; + for (var j = 0; j < message.contents.length; ++j) + object.contents[j] = $root.google.cloud.aiplatform.v1beta1.Content.toObject(message.contents[j], options); + } return object; }; @@ -439180,6 +440382,7 @@ * @interface ITokensInfo * @property {Array.|null} [tokens] TokensInfo tokens * @property {Array.|null} [tokenIds] TokensInfo tokenIds + * @property {string|null} [role] TokensInfo role */ /** @@ -439215,6 +440418,14 @@ */ TokensInfo.prototype.tokenIds = $util.emptyArray; + /** + * TokensInfo role. + * @member {string} role + * @memberof google.cloud.aiplatform.v1beta1.TokensInfo + * @instance + */ + TokensInfo.prototype.role = ""; + /** * Creates a new TokensInfo instance using the specified properties. * @function create @@ -439248,6 +440459,8 @@ writer.int64(message.tokenIds[i]); writer.ldelim(); } + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.role); return writer; }; @@ -439299,6 +440512,10 @@ message.tokenIds.push(reader.int64()); break; } + case 3: { + message.role = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -439348,6 +440565,9 @@ if (!$util.isInteger(message.tokenIds[i]) && !(message.tokenIds[i] && $util.isInteger(message.tokenIds[i].low) && $util.isInteger(message.tokenIds[i].high))) return "tokenIds: integer|Long[] expected"; } + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; return null; }; @@ -439387,6 +440607,8 @@ else if (typeof object.tokenIds[i] === "object") message.tokenIds[i] = new $util.LongBits(object.tokenIds[i].low >>> 0, object.tokenIds[i].high >>> 0).toNumber(); } + if (object.role != null) + message.role = String(object.role); return message; }; @@ -439407,6 +440629,8 @@ object.tokens = []; object.tokenIds = []; } + if (options.defaults) + object.role = ""; if (message.tokens && message.tokens.length) { object.tokens = []; for (var j = 0; j < message.tokens.length; ++j) @@ -439420,6 +440644,8 @@ else object.tokenIds[j] = options.longs === String ? $util.Long.prototype.toString.call(message.tokenIds[j]) : options.longs === Number ? new $util.LongBits(message.tokenIds[j].low >>> 0, message.tokenIds[j].high >>> 0).toNumber() : message.tokenIds[j]; } + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; return object; }; @@ -467262,6 +468488,7 @@ * @property {google.cloud.aiplatform.v1beta1.IModelContainerSpec|null} [containerSpec] Deploy containerSpec * @property {string|null} [artifactUri] Deploy artifactUri * @property {string|null} [deployTaskName] Deploy deployTaskName + * @property {google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.IDeployMetadata|null} [deployMetadata] Deploy deployMetadata * @property {string|null} [title] Deploy title * @property {string|null} [publicArtifactUri] Deploy publicArtifactUri */ @@ -467345,6 +468572,14 @@ */ Deploy.prototype.deployTaskName = null; + /** + * Deploy deployMetadata. + * @member {google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.IDeployMetadata|null|undefined} deployMetadata + * @memberof google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy + * @instance + */ + Deploy.prototype.deployMetadata = null; + /** * Deploy title. * @member {string} title @@ -467386,6 +468621,17 @@ set: $util.oneOfSetter($oneOfFields) }); + /** + * Deploy _deployMetadata. + * @member {"deployMetadata"|undefined} _deployMetadata + * @memberof google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy + * @instance + */ + Object.defineProperty(Deploy.prototype, "_deployMetadata", { + get: $util.oneOfGetter($oneOfFields = ["deployMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new Deploy instance using the specified properties. * @function create @@ -467430,6 +468676,8 @@ writer.uint32(/* id 9, wireType 2 =*/74).string(message.publicArtifactUri); if (message.deployTaskName != null && Object.hasOwnProperty.call(message, "deployTaskName")) writer.uint32(/* id 10, wireType 2 =*/82).string(message.deployTaskName); + if (message.deployMetadata != null && Object.hasOwnProperty.call(message, "deployMetadata")) + $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.DeployMetadata.encode(message.deployMetadata, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); return writer; }; @@ -467496,6 +468744,10 @@ message.deployTaskName = reader.string(); break; } + case 11: { + message.deployMetadata = $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.DeployMetadata.decode(reader, reader.uint32()); + break; + } case 8: { message.title = reader.string(); break; @@ -467586,6 +468838,14 @@ if (!$util.isString(message.deployTaskName)) return "deployTaskName: string expected"; } + if (message.deployMetadata != null && message.hasOwnProperty("deployMetadata")) { + properties._deployMetadata = 1; + { + var error = $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.DeployMetadata.verify(message.deployMetadata); + if (error) + return "deployMetadata." + error; + } + } if (message.title != null && message.hasOwnProperty("title")) if (!$util.isString(message.title)) return "title: string expected"; @@ -467635,6 +468895,11 @@ message.artifactUri = String(object.artifactUri); if (object.deployTaskName != null) message.deployTaskName = String(object.deployTaskName); + if (object.deployMetadata != null) { + if (typeof object.deployMetadata !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.deployMetadata: object expected"); + message.deployMetadata = $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.DeployMetadata.fromObject(object.deployMetadata); + } if (object.title != null) message.title = String(object.title); if (object.publicArtifactUri != null) @@ -467695,6 +468960,11 @@ if (options.oneofs) object._deployTaskName = "deployTaskName"; } + if (message.deployMetadata != null && message.hasOwnProperty("deployMetadata")) { + object.deployMetadata = $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.DeployMetadata.toObject(message.deployMetadata, options); + if (options.oneofs) + object._deployMetadata = "deployMetadata"; + } return object; }; @@ -467724,6 +468994,244 @@ return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy"; }; + Deploy.DeployMetadata = (function() { + + /** + * Properties of a DeployMetadata. + * @memberof google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy + * @interface IDeployMetadata + * @property {Object.|null} [labels] DeployMetadata labels + */ + + /** + * Constructs a new DeployMetadata. + * @memberof google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy + * @classdesc Represents a DeployMetadata. + * @implements IDeployMetadata + * @constructor + * @param {google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.IDeployMetadata=} [properties] Properties to set + */ + function DeployMetadata(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]]; + } + + /** + * DeployMetadata labels. + * @member {Object.} labels + * @memberof google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.DeployMetadata + * @instance + */ + DeployMetadata.prototype.labels = $util.emptyObject; + + /** + * Creates a new DeployMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.DeployMetadata + * @static + * @param {google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.IDeployMetadata=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.DeployMetadata} DeployMetadata instance + */ + DeployMetadata.create = function create(properties) { + return new DeployMetadata(properties); + }; + + /** + * Encodes the specified DeployMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.DeployMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.DeployMetadata + * @static + * @param {google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.IDeployMetadata} message DeployMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + 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 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeployMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.DeployMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.DeployMetadata + * @static + * @param {google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.IDeployMetadata} message DeployMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.DeployMetadata + * @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.PublisherModel.CallToAction.Deploy.DeployMetadata} DeployMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployMetadata.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.PublisherModel.CallToAction.Deploy.DeployMetadata(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeployMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.DeployMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.DeployMetadata} DeployMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployMetadata message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.DeployMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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"; + } + return null; + }; + + /** + * Creates a DeployMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.DeployMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.DeployMetadata} DeployMetadata + */ + DeployMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.DeployMetadata) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.DeployMetadata(); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.DeployMetadata.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]]); + } + return message; + }; + + /** + * Creates a plain object from a DeployMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.DeployMetadata + * @static + * @param {google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.DeployMetadata} message DeployMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + 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]]; + } + return object; + }; + + /** + * Converts this DeployMetadata to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.DeployMetadata + * @instance + * @returns {Object.} JSON object + */ + DeployMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployMetadata + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.DeployMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.DeployMetadata"; + }; + + return DeployMetadata; + })(); + return Deploy; })(); @@ -561073,6 +562581,8 @@ * @property {Object.|null} [labels] Tensorboard labels * @property {string|null} [etag] Tensorboard etag * @property {boolean|null} [isDefault] Tensorboard isDefault + * @property {boolean|null} [satisfiesPzs] Tensorboard satisfiesPzs + * @property {boolean|null} [satisfiesPzi] Tensorboard satisfiesPzi */ /** @@ -561179,6 +562689,22 @@ */ Tensorboard.prototype.isDefault = false; + /** + * Tensorboard satisfiesPzs. + * @member {boolean} satisfiesPzs + * @memberof google.cloud.aiplatform.v1beta1.Tensorboard + * @instance + */ + Tensorboard.prototype.satisfiesPzs = false; + + /** + * Tensorboard satisfiesPzi. + * @member {boolean} satisfiesPzi + * @memberof google.cloud.aiplatform.v1beta1.Tensorboard + * @instance + */ + Tensorboard.prototype.satisfiesPzi = false; + /** * Creates a new Tensorboard instance using the specified properties. * @function create @@ -561226,6 +562752,10 @@ $root.google.cloud.aiplatform.v1beta1.EncryptionSpec.encode(message.encryptionSpec, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); if (message.isDefault != null && Object.hasOwnProperty.call(message, "isDefault")) writer.uint32(/* id 12, wireType 0 =*/96).bool(message.isDefault); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.satisfiesPzs); + if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.satisfiesPzi); return writer; }; @@ -561323,6 +562853,14 @@ message.isDefault = reader.bool(); break; } + case 13: { + message.satisfiesPzs = reader.bool(); + break; + } + case 14: { + message.satisfiesPzi = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -561402,6 +562940,12 @@ if (message.isDefault != null && message.hasOwnProperty("isDefault")) if (typeof message.isDefault !== "boolean") return "isDefault: boolean expected"; + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) + if (typeof message.satisfiesPzi !== "boolean") + return "satisfiesPzi: boolean expected"; return null; }; @@ -561453,6 +562997,10 @@ message.etag = String(object.etag); if (object.isDefault != null) message.isDefault = Boolean(object.isDefault); + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.satisfiesPzi != null) + message.satisfiesPzi = Boolean(object.satisfiesPzi); return message; }; @@ -561482,6 +563030,8 @@ object.blobStoragePathPrefix = ""; object.encryptionSpec = null; object.isDefault = false; + object.satisfiesPzs = false; + object.satisfiesPzi = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -561509,6 +563059,10 @@ object.encryptionSpec = $root.google.cloud.aiplatform.v1beta1.EncryptionSpec.toObject(message.encryptionSpec, options); if (message.isDefault != null && message.hasOwnProperty("isDefault")) object.isDefault = message.isDefault; + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = message.satisfiesPzs; + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) + object.satisfiesPzi = message.satisfiesPzi; return object; }; diff --git a/packages/google-cloud-aiplatform/protos/protos.json b/packages/google-cloud-aiplatform/protos/protos.json index 05f5bb4af03..90364769667 100644 --- a/packages/google-cloud-aiplatform/protos/protos.json +++ b/packages/google-cloud-aiplatform/protos/protos.json @@ -1757,6 +1757,20 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "satisfiesPzs": { + "type": "bool", + "id": 51, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzi": { + "type": "bool", + "id": 52, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { @@ -5199,6 +5213,34 @@ } ] }, + "UpdateDeploymentResourcePool": { + "requestType": "UpdateDeploymentResourcePoolRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{deployment_resource_pool.name=projects/*/locations/*/deploymentResourcePools/*}", + "(google.api.http).body": "deployment_resource_pool", + "(google.api.method_signature)": "deployment_resource_pool,update_mask", + "(google.longrunning.operation_info).response_type": "DeploymentResourcePool", + "(google.longrunning.operation_info).metadata_type": "UpdateDeploymentResourcePoolOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{deployment_resource_pool.name=projects/*/locations/*/deploymentResourcePools/*}", + "body": "deployment_resource_pool" + } + }, + { + "(google.api.method_signature)": "deployment_resource_pool,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "DeploymentResourcePool", + "metadata_type": "UpdateDeploymentResourcePoolOperationMetadata" + } + } + ] + }, "DeleteDeploymentResourcePool": { "requestType": "DeleteDeploymentResourcePoolRequest", "responseType": "google.longrunning.Operation", @@ -5324,6 +5366,24 @@ } } }, + "UpdateDeploymentResourcePoolRequest": { + "fields": { + "deploymentResourcePool": { + "type": "DeploymentResourcePool", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, "UpdateDeploymentResourcePoolOperationMetadata": { "fields": { "genericMetadata": { @@ -6870,6 +6930,20 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "privateServiceConnectConfig": { + "type": "PrivateServiceConnectConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceAttachment": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, @@ -15801,7 +15875,22 @@ "type": "google.protobuf.Value", "id": 2, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "model": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "contents": { + "rule": "repeated", + "type": "Content", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" } } } @@ -15817,6 +15906,13 @@ "rule": "repeated", "type": "int64", "id": 2 + }, + "role": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -19527,6 +19623,11 @@ "oneof": [ "deployTaskName" ] + }, + "_deployMetadata": { + "oneof": [ + "deployMetadata" + ] } }, "fields": { @@ -19578,6 +19679,14 @@ "proto3_optional": true } }, + "deployMetadata": { + "type": "DeployMetadata", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, "title": { "type": "string", "id": 8, @@ -19592,6 +19701,20 @@ "(google.api.field_behavior)": "OPTIONAL" } } + }, + "nested": { + "DeployMetadata": { + "fields": { + "labels": { + "keyType": "string", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } } }, "DeployGke": { @@ -25360,6 +25483,20 @@ "isDefault": { "type": "bool", "id": 12 + }, + "satisfiesPzs": { + "type": "bool", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzi": { + "type": "bool", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, @@ -30079,6 +30216,20 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "satisfiesPzs": { + "type": "bool", + "id": 51, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzi": { + "type": "bool", + "id": 52, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { @@ -33939,6 +34090,34 @@ } ] }, + "UpdateDeploymentResourcePool": { + "requestType": "UpdateDeploymentResourcePoolRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1beta1/{deployment_resource_pool.name=projects/*/locations/*/deploymentResourcePools/*}", + "(google.api.http).body": "deployment_resource_pool", + "(google.api.method_signature)": "deployment_resource_pool,update_mask", + "(google.longrunning.operation_info).response_type": "DeploymentResourcePool", + "(google.longrunning.operation_info).metadata_type": "UpdateDeploymentResourcePoolOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta1/{deployment_resource_pool.name=projects/*/locations/*/deploymentResourcePools/*}", + "body": "deployment_resource_pool" + } + }, + { + "(google.api.method_signature)": "deployment_resource_pool,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "DeploymentResourcePool", + "metadata_type": "UpdateDeploymentResourcePoolOperationMetadata" + } + } + ] + }, "DeleteDeploymentResourcePool": { "requestType": "DeleteDeploymentResourcePoolRequest", "responseType": "google.longrunning.Operation", @@ -34064,6 +34243,24 @@ } } }, + "UpdateDeploymentResourcePoolRequest": { + "fields": { + "deploymentResourcePool": { + "type": "DeploymentResourcePool", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, "UpdateDeploymentResourcePoolOperationMetadata": { "fields": { "genericMetadata": { @@ -35529,7 +35726,15 @@ } }, "BleuSpec": { - "fields": {} + "fields": { + "useEffectiveOrder": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } }, "BleuResults": { "fields": { @@ -47833,7 +48038,22 @@ "type": "google.protobuf.Value", "id": 2, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "model": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "contents": { + "rule": "repeated", + "type": "Content", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" } } } @@ -47849,6 +48069,13 @@ "rule": "repeated", "type": "int64", "id": 2 + }, + "role": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -50903,6 +51130,11 @@ "oneof": [ "deployTaskName" ] + }, + "_deployMetadata": { + "oneof": [ + "deployMetadata" + ] } }, "fields": { @@ -50954,6 +51186,14 @@ "proto3_optional": true } }, + "deployMetadata": { + "type": "DeployMetadata", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, "title": { "type": "string", "id": 8, @@ -50968,6 +51208,20 @@ "(google.api.field_behavior)": "OPTIONAL" } } + }, + "nested": { + "DeployMetadata": { + "fields": { + "labels": { + "keyType": "string", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } } }, "DeployGke": { @@ -60443,6 +60697,20 @@ "isDefault": { "type": "bool", "id": 12 + }, + "satisfiesPzs": { + "type": "bool", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzi": { + "type": "bool", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, diff --git a/packages/google-cloud-aiplatform/samples/README.md b/packages/google-cloud-aiplatform/samples/README.md index 1ed31fa1f92..43a62d35e16 100644 --- a/packages/google-cloud-aiplatform/samples/README.md +++ b/packages/google-cloud-aiplatform/samples/README.md @@ -36,6 +36,7 @@ * [Deployment_resource_pool_service.get_deployment_resource_pool](#deployment_resource_pool_service.get_deployment_resource_pool) * [Deployment_resource_pool_service.list_deployment_resource_pools](#deployment_resource_pool_service.list_deployment_resource_pools) * [Deployment_resource_pool_service.query_deployed_models](#deployment_resource_pool_service.query_deployed_models) + * [Deployment_resource_pool_service.update_deployment_resource_pool](#deployment_resource_pool_service.update_deployment_resource_pool) * [Endpoint_service.create_endpoint](#endpoint_service.create_endpoint) * [Endpoint_service.delete_endpoint](#endpoint_service.delete_endpoint) * [Endpoint_service.deploy_model](#endpoint_service.deploy_model) @@ -327,6 +328,7 @@ * [Deployment_resource_pool_service.get_deployment_resource_pool](#deployment_resource_pool_service.get_deployment_resource_pool) * [Deployment_resource_pool_service.list_deployment_resource_pools](#deployment_resource_pool_service.list_deployment_resource_pools) * [Deployment_resource_pool_service.query_deployed_models](#deployment_resource_pool_service.query_deployed_models) + * [Deployment_resource_pool_service.update_deployment_resource_pool](#deployment_resource_pool_service.update_deployment_resource_pool) * [Endpoint_service.create_endpoint](#endpoint_service.create_endpoint) * [Endpoint_service.delete_endpoint](#endpoint_service.delete_endpoint) * [Endpoint_service.deploy_model](#endpoint_service.deploy_model) @@ -1067,6 +1069,23 @@ __Usage:__ +### Deployment_resource_pool_service.update_deployment_resource_pool + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.update_deployment_resource_pool.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.update_deployment_resource_pool.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.update_deployment_resource_pool.js` + + +----- + + + + ### Endpoint_service.create_endpoint View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.create_endpoint.js). @@ -6014,6 +6033,23 @@ __Usage:__ +### Deployment_resource_pool_service.update_deployment_resource_pool + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.update_deployment_resource_pool.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/deployment_resource_pool_service.update_deployment_resource_pool.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.update_deployment_resource_pool.js` + + +----- + + + + ### Endpoint_service.create_endpoint View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.create_endpoint.js). diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.update_deployment_resource_pool.js b/packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.update_deployment_resource_pool.js new file mode 100644 index 00000000000..4eff333f0a9 --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.update_deployment_resource_pool.js @@ -0,0 +1,71 @@ +// 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(deploymentResourcePool, updateMask) { + // [START aiplatform_v1_generated_DeploymentResourcePoolService_UpdateDeploymentResourcePool_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 DeploymentResourcePool to update. + * The DeploymentResourcePool's `name` field is used to identify the + * DeploymentResourcePool to update. + * Format: + * `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}` + */ + // const deploymentResourcePool = {} + /** + * Required. The list of fields to update. + */ + // const updateMask = {} + + // Imports the Aiplatform library + const {DeploymentResourcePoolServiceClient} = require('@google-cloud/aiplatform').v1; + + // Instantiates a client + const aiplatformClient = new DeploymentResourcePoolServiceClient(); + + async function callUpdateDeploymentResourcePool() { + // Construct request + const request = { + deploymentResourcePool, + updateMask, + }; + + // Run request + const [operation] = await aiplatformClient.updateDeploymentResourcePool(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateDeploymentResourcePool(); + // [END aiplatform_v1_generated_DeploymentResourcePoolService_UpdateDeploymentResourcePool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/llm_utility_service.compute_tokens.js b/packages/google-cloud-aiplatform/samples/generated/v1/llm_utility_service.compute_tokens.js index 3b87d6e56cf..be19cafe498 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/llm_utility_service.compute_tokens.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/llm_utility_service.compute_tokens.js @@ -20,7 +20,7 @@ 'use strict'; -function main(endpoint, instances) { +function main(endpoint) { // [START aiplatform_v1_generated_LlmUtilityService_ComputeTokens_async] /** * This snippet has been automatically generated and should be regarded as a code template only. @@ -34,11 +34,21 @@ function main(endpoint, instances) { */ // const endpoint = 'abc123' /** - * Required. The instances that are the input to token computing API call. + * Optional. The instances that are the input to token computing API call. * Schema is identical to the prediction schema of the text model, even for * the non-text models, like chat models, or Codey models. */ // const instances = [1,2,3,4] + /** + * Optional. The name of the publisher model requested to serve the + * prediction. Format: + * projects/{project}/locations/{location}/publishers/* /models/* + */ + // const model = 'abc123' + /** + * Optional. Input content. + */ + // const contents = [1,2,3,4] // Imports the Aiplatform library const {LlmUtilityServiceClient} = require('@google-cloud/aiplatform').v1; @@ -50,7 +60,6 @@ function main(endpoint, instances) { // Construct request const request = { endpoint, - instances, }; // Run request diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata_google.cloud.aiplatform.v1.json b/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata_google.cloud.aiplatform.v1.json index 45e82e0c575..ed18bc17f32 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata_google.cloud.aiplatform.v1.json +++ b/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata_google.cloud.aiplatform.v1.json @@ -1091,6 +1091,50 @@ } } }, + { + "regionTag": "aiplatform_v1_generated_DeploymentResourcePoolService_UpdateDeploymentResourcePool_async", + "title": "DatasetService updateDeploymentResourcePool Sample", + "origin": "API_DEFINITION", + "description": " Update a DeploymentResourcePool.", + "canonical": true, + "file": "deployment_resource_pool_service.update_deployment_resource_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDeploymentResourcePool", + "fullName": "google.cloud.aiplatform.v1.DeploymentResourcePoolService.UpdateDeploymentResourcePool", + "async": true, + "parameters": [ + { + "name": "deployment_resource_pool", + "type": ".google.cloud.aiplatform.v1.DeploymentResourcePool" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DeploymentResourcePoolServiceClient", + "fullName": "google.cloud.aiplatform.v1.DeploymentResourcePoolServiceClient" + }, + "method": { + "shortName": "UpdateDeploymentResourcePool", + "fullName": "google.cloud.aiplatform.v1.DeploymentResourcePoolService.UpdateDeploymentResourcePool", + "service": { + "shortName": "DeploymentResourcePoolService", + "fullName": "google.cloud.aiplatform.v1.DeploymentResourcePoolService" + } + } + } + }, { "regionTag": "aiplatform_v1_generated_DeploymentResourcePoolService_DeleteDeploymentResourcePool_async", "title": "DatasetService deleteDeploymentResourcePool Sample", @@ -6390,7 +6434,7 @@ "segments": [ { "start": 25, - "end": 61, + "end": 70, "type": "FULL" } ], @@ -6406,6 +6450,14 @@ { "name": "instances", "type": "TYPE_MESSAGE[]" + }, + { + "name": "model", + "type": "TYPE_STRING" + }, + { + "name": "contents", + "type": "TYPE_MESSAGE[]" } ], "resultType": ".google.cloud.aiplatform.v1.ComputeTokensResponse", diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.update_deployment_resource_pool.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.update_deployment_resource_pool.js new file mode 100644 index 00000000000..22a0623ffcc --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.update_deployment_resource_pool.js @@ -0,0 +1,71 @@ +// 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(deploymentResourcePool, updateMask) { + // [START aiplatform_v1beta1_generated_DeploymentResourcePoolService_UpdateDeploymentResourcePool_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 DeploymentResourcePool to update. + * The DeploymentResourcePool's `name` field is used to identify the + * DeploymentResourcePool to update. + * Format: + * `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}` + */ + // const deploymentResourcePool = {} + /** + * Required. The list of fields to update. + */ + // const updateMask = {} + + // Imports the Aiplatform library + const {DeploymentResourcePoolServiceClient} = require('@google-cloud/aiplatform').v1beta1; + + // Instantiates a client + const aiplatformClient = new DeploymentResourcePoolServiceClient(); + + async function callUpdateDeploymentResourcePool() { + // Construct request + const request = { + deploymentResourcePool, + updateMask, + }; + + // Run request + const [operation] = await aiplatformClient.updateDeploymentResourcePool(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateDeploymentResourcePool(); + // [END aiplatform_v1beta1_generated_DeploymentResourcePoolService_UpdateDeploymentResourcePool_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/llm_utility_service.compute_tokens.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/llm_utility_service.compute_tokens.js index 0a87bc7f909..c7efd02269f 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/llm_utility_service.compute_tokens.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/llm_utility_service.compute_tokens.js @@ -20,7 +20,7 @@ 'use strict'; -function main(endpoint, instances) { +function main(endpoint) { // [START aiplatform_v1beta1_generated_LlmUtilityService_ComputeTokens_async] /** * This snippet has been automatically generated and should be regarded as a code template only. @@ -34,11 +34,21 @@ function main(endpoint, instances) { */ // const endpoint = 'abc123' /** - * Required. The instances that are the input to token computing API call. + * Optional. The instances that are the input to token computing API call. * Schema is identical to the prediction schema of the text model, even for * the non-text models, like chat models, or Codey models. */ // const instances = [1,2,3,4] + /** + * Optional. The name of the publisher model requested to serve the + * prediction. Format: + * projects/{project}/locations/{location}/publishers/* /models/* + */ + // const model = 'abc123' + /** + * Optional. Input content. + */ + // const contents = [1,2,3,4] // Imports the Aiplatform library const {LlmUtilityServiceClient} = require('@google-cloud/aiplatform').v1beta1; @@ -50,7 +60,6 @@ function main(endpoint, instances) { // Construct request const request = { endpoint, - instances, }; // Run request 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 02bac7c6b74..5f48ad890db 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 @@ -1091,6 +1091,50 @@ } } }, + { + "regionTag": "aiplatform_v1beta1_generated_DeploymentResourcePoolService_UpdateDeploymentResourcePool_async", + "title": "DatasetService updateDeploymentResourcePool Sample", + "origin": "API_DEFINITION", + "description": " Update a DeploymentResourcePool.", + "canonical": true, + "file": "deployment_resource_pool_service.update_deployment_resource_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDeploymentResourcePool", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService.UpdateDeploymentResourcePool", + "async": true, + "parameters": [ + { + "name": "deployment_resource_pool", + "type": ".google.cloud.aiplatform.v1beta1.DeploymentResourcePool" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DeploymentResourcePoolServiceClient", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolServiceClient" + }, + "method": { + "shortName": "UpdateDeploymentResourcePool", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService.UpdateDeploymentResourcePool", + "service": { + "shortName": "DeploymentResourcePoolService", + "fullName": "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService" + } + } + } + }, { "regionTag": "aiplatform_v1beta1_generated_DeploymentResourcePoolService_DeleteDeploymentResourcePool_async", "title": "DatasetService deleteDeploymentResourcePool Sample", @@ -7050,7 +7094,7 @@ "segments": [ { "start": 25, - "end": 61, + "end": 70, "type": "FULL" } ], @@ -7066,6 +7110,14 @@ { "name": "instances", "type": "TYPE_MESSAGE[]" + }, + { + "name": "model", + "type": "TYPE_STRING" + }, + { + "name": "contents", + "type": "TYPE_MESSAGE[]" } ], "resultType": ".google.cloud.aiplatform.v1beta1.ComputeTokensResponse", diff --git a/packages/google-cloud-aiplatform/src/v1/deployment_resource_pool_service_client.ts b/packages/google-cloud-aiplatform/src/v1/deployment_resource_pool_service_client.ts index 7762c4b5e65..b8b8cd0dd5a 100644 --- a/packages/google-cloud-aiplatform/src/v1/deployment_resource_pool_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/deployment_resource_pool_service_client.ts @@ -1904,6 +1904,12 @@ export class DeploymentResourcePoolServiceClient { const createDeploymentResourcePoolMetadata = protoFilesRoot.lookup( '.google.cloud.aiplatform.v1.CreateDeploymentResourcePoolOperationMetadata' ) as gax.protobuf.Type; + const updateDeploymentResourcePoolResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.DeploymentResourcePool' + ) as gax.protobuf.Type; + const updateDeploymentResourcePoolMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolOperationMetadata' + ) as gax.protobuf.Type; const deleteDeploymentResourcePoolResponse = protoFilesRoot.lookup( '.google.protobuf.Empty' ) as gax.protobuf.Type; @@ -1921,6 +1927,15 @@ export class DeploymentResourcePoolServiceClient { createDeploymentResourcePoolMetadata ) ), + updateDeploymentResourcePool: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateDeploymentResourcePoolResponse.decode.bind( + updateDeploymentResourcePoolResponse + ), + updateDeploymentResourcePoolMetadata.decode.bind( + updateDeploymentResourcePoolMetadata + ) + ), deleteDeploymentResourcePool: new this._gaxModule.LongrunningDescriptor( this.operationsClient, deleteDeploymentResourcePoolResponse.decode.bind( @@ -1986,6 +2001,7 @@ export class DeploymentResourcePoolServiceClient { 'createDeploymentResourcePool', 'getDeploymentResourcePool', 'listDeploymentResourcePools', + 'updateDeploymentResourcePool', 'deleteDeploymentResourcePool', 'queryDeployedModels', ]; @@ -2358,6 +2374,154 @@ export class DeploymentResourcePoolServiceClient { protos.google.cloud.aiplatform.v1.CreateDeploymentResourcePoolOperationMetadata >; } + /** + * Update a DeploymentResourcePool. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1.DeploymentResourcePool} request.deploymentResourcePool + * Required. The DeploymentResourcePool to update. + * + * The DeploymentResourcePool's `name` field is used to identify the + * DeploymentResourcePool to update. + * Format: + * `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}` + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to update. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/deployment_resource_pool_service.update_deployment_resource_pool.js + * region_tag:aiplatform_v1_generated_DeploymentResourcePoolService_UpdateDeploymentResourcePool_async + */ + updateDeploymentResourcePool( + request?: protos.google.cloud.aiplatform.v1.IUpdateDeploymentResourcePoolRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.aiplatform.v1.IDeploymentResourcePool, + protos.google.cloud.aiplatform.v1.IUpdateDeploymentResourcePoolOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateDeploymentResourcePool( + request: protos.google.cloud.aiplatform.v1.IUpdateDeploymentResourcePoolRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.aiplatform.v1.IDeploymentResourcePool, + protos.google.cloud.aiplatform.v1.IUpdateDeploymentResourcePoolOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateDeploymentResourcePool( + request: protos.google.cloud.aiplatform.v1.IUpdateDeploymentResourcePoolRequest, + callback: Callback< + LROperation< + protos.google.cloud.aiplatform.v1.IDeploymentResourcePool, + protos.google.cloud.aiplatform.v1.IUpdateDeploymentResourcePoolOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateDeploymentResourcePool( + request?: protos.google.cloud.aiplatform.v1.IUpdateDeploymentResourcePoolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.aiplatform.v1.IDeploymentResourcePool, + protos.google.cloud.aiplatform.v1.IUpdateDeploymentResourcePoolOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.aiplatform.v1.IDeploymentResourcePool, + protos.google.cloud.aiplatform.v1.IUpdateDeploymentResourcePoolOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.aiplatform.v1.IDeploymentResourcePool, + protos.google.cloud.aiplatform.v1.IUpdateDeploymentResourcePoolOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'deployment_resource_pool.name': + request.deploymentResourcePool!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateDeploymentResourcePool( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `updateDeploymentResourcePool()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/deployment_resource_pool_service.update_deployment_resource_pool.js + * region_tag:aiplatform_v1_generated_DeploymentResourcePoolService_UpdateDeploymentResourcePool_async + */ + async checkUpdateDeploymentResourcePoolProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.aiplatform.v1.DeploymentResourcePool, + protos.google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolOperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateDeploymentResourcePool, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.aiplatform.v1.DeploymentResourcePool, + protos.google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolOperationMetadata + >; + } /** * Delete a DeploymentResourcePool. * diff --git a/packages/google-cloud-aiplatform/src/v1/deployment_resource_pool_service_client_config.json b/packages/google-cloud-aiplatform/src/v1/deployment_resource_pool_service_client_config.json index 8fa92527056..b8ffaa0be67 100644 --- a/packages/google-cloud-aiplatform/src/v1/deployment_resource_pool_service_client_config.json +++ b/packages/google-cloud-aiplatform/src/v1/deployment_resource_pool_service_client_config.json @@ -32,6 +32,10 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "UpdateDeploymentResourcePool": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "DeleteDeploymentResourcePool": { "retry_codes_name": "non_idempotent", "retry_params_name": "default" diff --git a/packages/google-cloud-aiplatform/src/v1/gapic_metadata.json b/packages/google-cloud-aiplatform/src/v1/gapic_metadata.json index 50b14953122..56a176c5ed9 100644 --- a/packages/google-cloud-aiplatform/src/v1/gapic_metadata.json +++ b/packages/google-cloud-aiplatform/src/v1/gapic_metadata.json @@ -248,6 +248,11 @@ "createDeploymentResourcePool" ] }, + "UpdateDeploymentResourcePool": { + "methods": [ + "updateDeploymentResourcePool" + ] + }, "DeleteDeploymentResourcePool": { "methods": [ "deleteDeploymentResourcePool" @@ -282,6 +287,11 @@ "createDeploymentResourcePool" ] }, + "UpdateDeploymentResourcePool": { + "methods": [ + "updateDeploymentResourcePool" + ] + }, "DeleteDeploymentResourcePool": { "methods": [ "deleteDeploymentResourcePool" diff --git a/packages/google-cloud-aiplatform/src/v1/llm_utility_service_client.ts b/packages/google-cloud-aiplatform/src/v1/llm_utility_service_client.ts index f14c1f76b88..43a89091c95 100644 --- a/packages/google-cloud-aiplatform/src/v1/llm_utility_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/llm_utility_service_client.ts @@ -625,10 +625,16 @@ export class LlmUtilityServiceClient { * @param {string} request.endpoint * Required. The name of the Endpoint requested to get lists of tokens and * token ids. - * @param {number[]} request.instances - * Required. The instances that are the input to token computing API call. + * @param {number[]} [request.instances] + * Optional. The instances that are the input to token computing API call. * Schema is identical to the prediction schema of the text model, even for * the non-text models, like chat models, or Codey models. + * @param {string} [request.model] + * Optional. The name of the publisher model requested to serve the + * prediction. Format: + * projects/{project}/locations/{location}/publishers/* /models/* + * @param {number[]} [request.contents] + * Optional. Input content. * @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. 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 3dd23ab5b7a..563f46c6c04 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 @@ -2164,6 +2164,12 @@ export class DeploymentResourcePoolServiceClient { const createDeploymentResourcePoolMetadata = protoFilesRoot.lookup( '.google.cloud.aiplatform.v1beta1.CreateDeploymentResourcePoolOperationMetadata' ) as gax.protobuf.Type; + const updateDeploymentResourcePoolResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeploymentResourcePool' + ) as gax.protobuf.Type; + const updateDeploymentResourcePoolMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolOperationMetadata' + ) as gax.protobuf.Type; const deleteDeploymentResourcePoolResponse = protoFilesRoot.lookup( '.google.protobuf.Empty' ) as gax.protobuf.Type; @@ -2181,6 +2187,15 @@ export class DeploymentResourcePoolServiceClient { createDeploymentResourcePoolMetadata ) ), + updateDeploymentResourcePool: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateDeploymentResourcePoolResponse.decode.bind( + updateDeploymentResourcePoolResponse + ), + updateDeploymentResourcePoolMetadata.decode.bind( + updateDeploymentResourcePoolMetadata + ) + ), deleteDeploymentResourcePool: new this._gaxModule.LongrunningDescriptor( this.operationsClient, deleteDeploymentResourcePoolResponse.decode.bind( @@ -2246,6 +2261,7 @@ export class DeploymentResourcePoolServiceClient { 'createDeploymentResourcePool', 'getDeploymentResourcePool', 'listDeploymentResourcePools', + 'updateDeploymentResourcePool', 'deleteDeploymentResourcePool', 'queryDeployedModels', ]; @@ -2618,6 +2634,154 @@ export class DeploymentResourcePoolServiceClient { protos.google.cloud.aiplatform.v1beta1.CreateDeploymentResourcePoolOperationMetadata >; } + /** + * Update a DeploymentResourcePool. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1beta1.DeploymentResourcePool} request.deploymentResourcePool + * Required. The DeploymentResourcePool to update. + * + * The DeploymentResourcePool's `name` field is used to identify the + * DeploymentResourcePool to update. + * Format: + * `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}` + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to update. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/deployment_resource_pool_service.update_deployment_resource_pool.js + * region_tag:aiplatform_v1beta1_generated_DeploymentResourcePoolService_UpdateDeploymentResourcePool_async + */ + updateDeploymentResourcePool( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateDeploymentResourcePoolRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool, + protos.google.cloud.aiplatform.v1beta1.IUpdateDeploymentResourcePoolOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateDeploymentResourcePool( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateDeploymentResourcePoolRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool, + protos.google.cloud.aiplatform.v1beta1.IUpdateDeploymentResourcePoolOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateDeploymentResourcePool( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateDeploymentResourcePoolRequest, + callback: Callback< + LROperation< + protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool, + protos.google.cloud.aiplatform.v1beta1.IUpdateDeploymentResourcePoolOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateDeploymentResourcePool( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateDeploymentResourcePoolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool, + protos.google.cloud.aiplatform.v1beta1.IUpdateDeploymentResourcePoolOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool, + protos.google.cloud.aiplatform.v1beta1.IUpdateDeploymentResourcePoolOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool, + protos.google.cloud.aiplatform.v1beta1.IUpdateDeploymentResourcePoolOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'deployment_resource_pool.name': + request.deploymentResourcePool!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateDeploymentResourcePool( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `updateDeploymentResourcePool()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/deployment_resource_pool_service.update_deployment_resource_pool.js + * region_tag:aiplatform_v1beta1_generated_DeploymentResourcePoolService_UpdateDeploymentResourcePool_async + */ + async checkUpdateDeploymentResourcePoolProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool, + protos.google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolOperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateDeploymentResourcePool, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool, + protos.google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolOperationMetadata + >; + } /** * Delete a DeploymentResourcePool. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/deployment_resource_pool_service_client_config.json b/packages/google-cloud-aiplatform/src/v1beta1/deployment_resource_pool_service_client_config.json index 060fe05281c..2baf85ca01c 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/deployment_resource_pool_service_client_config.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/deployment_resource_pool_service_client_config.json @@ -32,6 +32,10 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "UpdateDeploymentResourcePool": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "DeleteDeploymentResourcePool": { "retry_codes_name": "non_idempotent", "retry_params_name": "default" diff --git a/packages/google-cloud-aiplatform/src/v1beta1/gapic_metadata.json b/packages/google-cloud-aiplatform/src/v1beta1/gapic_metadata.json index 697aa0a3c45..48fb0c5bf93 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/gapic_metadata.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/gapic_metadata.json @@ -248,6 +248,11 @@ "createDeploymentResourcePool" ] }, + "UpdateDeploymentResourcePool": { + "methods": [ + "updateDeploymentResourcePool" + ] + }, "DeleteDeploymentResourcePool": { "methods": [ "deleteDeploymentResourcePool" @@ -282,6 +287,11 @@ "createDeploymentResourcePool" ] }, + "UpdateDeploymentResourcePool": { + "methods": [ + "updateDeploymentResourcePool" + ] + }, "DeleteDeploymentResourcePool": { "methods": [ "deleteDeploymentResourcePool" 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 0da862483aa..c3088c1d30f 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 @@ -555,10 +555,16 @@ export class LlmUtilityServiceClient { * @param {string} request.endpoint * Required. The name of the Endpoint requested to get lists of tokens and * token ids. - * @param {number[]} request.instances - * Required. The instances that are the input to token computing API call. + * @param {number[]} [request.instances] + * Optional. The instances that are the input to token computing API call. * Schema is identical to the prediction schema of the text model, even for * the non-text models, like chat models, or Codey models. + * @param {string} [request.model] + * Optional. The name of the publisher model requested to serve the + * prediction. Format: + * projects/{project}/locations/{location}/publishers/* /models/* + * @param {number[]} [request.contents] + * Optional. Input content. * @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. diff --git a/packages/google-cloud-aiplatform/test/gapic_deployment_resource_pool_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_deployment_resource_pool_service_v1.ts index ec7948859d9..d98114bdd0e 100644 --- a/packages/google-cloud-aiplatform/test/gapic_deployment_resource_pool_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_deployment_resource_pool_service_v1.ts @@ -736,6 +736,226 @@ describe('v1.DeploymentResourcePoolServiceClient', () => { }); }); + describe('updateDeploymentResourcePool', () => { + it('invokes updateDeploymentResourcePool without error', async () => { + const client = + new deploymentresourcepoolserviceModule.v1.DeploymentResourcePoolServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest() + ); + request.deploymentResourcePool ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest', + ['deploymentResourcePool', 'name'] + ); + request.deploymentResourcePool.name = defaultValue1; + const expectedHeaderRequestParams = `deployment_resource_pool.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateDeploymentResourcePool = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateDeploymentResourcePool(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDeploymentResourcePool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDeploymentResourcePool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDeploymentResourcePool without error using callback', async () => { + const client = + new deploymentresourcepoolserviceModule.v1.DeploymentResourcePoolServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest() + ); + request.deploymentResourcePool ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest', + ['deploymentResourcePool', 'name'] + ); + request.deploymentResourcePool.name = defaultValue1; + const expectedHeaderRequestParams = `deployment_resource_pool.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateDeploymentResourcePool = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDeploymentResourcePool( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.aiplatform.v1.IDeploymentResourcePool, + protos.google.cloud.aiplatform.v1.IUpdateDeploymentResourcePoolOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.aiplatform.v1.IDeploymentResourcePool, + protos.google.cloud.aiplatform.v1.IUpdateDeploymentResourcePoolOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDeploymentResourcePool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDeploymentResourcePool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDeploymentResourcePool with call error', async () => { + const client = + new deploymentresourcepoolserviceModule.v1.DeploymentResourcePoolServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest() + ); + request.deploymentResourcePool ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest', + ['deploymentResourcePool', 'name'] + ); + request.deploymentResourcePool.name = defaultValue1; + const expectedHeaderRequestParams = `deployment_resource_pool.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDeploymentResourcePool = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateDeploymentResourcePool(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updateDeploymentResourcePool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDeploymentResourcePool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDeploymentResourcePool with LRO error', async () => { + const client = + new deploymentresourcepoolserviceModule.v1.DeploymentResourcePoolServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest() + ); + request.deploymentResourcePool ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.UpdateDeploymentResourcePoolRequest', + ['deploymentResourcePool', 'name'] + ); + request.deploymentResourcePool.name = defaultValue1; + const expectedHeaderRequestParams = `deployment_resource_pool.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDeploymentResourcePool = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateDeploymentResourcePool(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateDeploymentResourcePool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDeploymentResourcePool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateDeploymentResourcePoolProgress without error', async () => { + const client = + new deploymentresourcepoolserviceModule.v1.DeploymentResourcePoolServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkUpdateDeploymentResourcePoolProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateDeploymentResourcePoolProgress with error', async () => { + const client = + new deploymentresourcepoolserviceModule.v1.DeploymentResourcePoolServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUpdateDeploymentResourcePoolProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + describe('deleteDeploymentResourcePool', () => { it('invokes deleteDeploymentResourcePool without error', async () => { const client = 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 9fbfe9687a5..978006ae7f7 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 @@ -736,6 +736,226 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { }); }); + describe('updateDeploymentResourcePool', () => { + it('invokes updateDeploymentResourcePool without error', async () => { + const client = + new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolRequest() + ); + request.deploymentResourcePool ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolRequest', + ['deploymentResourcePool', 'name'] + ); + request.deploymentResourcePool.name = defaultValue1; + const expectedHeaderRequestParams = `deployment_resource_pool.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateDeploymentResourcePool = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateDeploymentResourcePool(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDeploymentResourcePool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDeploymentResourcePool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDeploymentResourcePool without error using callback', async () => { + const client = + new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolRequest() + ); + request.deploymentResourcePool ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolRequest', + ['deploymentResourcePool', 'name'] + ); + request.deploymentResourcePool.name = defaultValue1; + const expectedHeaderRequestParams = `deployment_resource_pool.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateDeploymentResourcePool = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDeploymentResourcePool( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool, + protos.google.cloud.aiplatform.v1beta1.IUpdateDeploymentResourcePoolOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool, + protos.google.cloud.aiplatform.v1beta1.IUpdateDeploymentResourcePoolOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDeploymentResourcePool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDeploymentResourcePool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDeploymentResourcePool with call error', async () => { + const client = + new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolRequest() + ); + request.deploymentResourcePool ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolRequest', + ['deploymentResourcePool', 'name'] + ); + request.deploymentResourcePool.name = defaultValue1; + const expectedHeaderRequestParams = `deployment_resource_pool.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDeploymentResourcePool = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateDeploymentResourcePool(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updateDeploymentResourcePool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDeploymentResourcePool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDeploymentResourcePool with LRO error', async () => { + const client = + new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolRequest() + ); + request.deploymentResourcePool ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolRequest', + ['deploymentResourcePool', 'name'] + ); + request.deploymentResourcePool.name = defaultValue1; + const expectedHeaderRequestParams = `deployment_resource_pool.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDeploymentResourcePool = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateDeploymentResourcePool(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateDeploymentResourcePool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDeploymentResourcePool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateDeploymentResourcePoolProgress without error', async () => { + const client = + new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkUpdateDeploymentResourcePoolProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateDeploymentResourcePoolProgress with error', async () => { + const client = + new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUpdateDeploymentResourcePoolProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + describe('deleteDeploymentResourcePool', () => { it('invokes deleteDeploymentResourcePool without error', async () => { const client =