From c0a3d8a1df6b319e555955dfef8a56ceef54a6e2 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 20 Jun 2023 20:26:12 +0000 Subject: [PATCH] feat: add UpdateExplanationDataset to aiplatform (#4359) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 541213716 Source-Link: https://togithub.com/googleapis/googleapis/commit/4a858c4e033098aaecd29dc9302f406d9eb39684 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/e4c3eab1fda49c5d9619bb82872a0a7e81f83528 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFpcGxhdGZvcm0vLk93bEJvdC55YW1sIiwiaCI6ImU0YzNlYWIxZmRhNDljNWQ5NjE5YmI4Mjg3MmEwYTdlODFmODM1MjgifQ== --- packages/google-cloud-aiplatform/README.md | 1 + .../cloud/aiplatform/v1/model_service.proto | 43 + .../protos/protos.d.ts | 312 ++++++ .../google-cloud-aiplatform/protos/protos.js | 900 +++++++++++++++--- .../protos/protos.json | 55 ++ .../google-cloud-aiplatform/samples/README.md | 18 + ...odel_service.update_explanation_dataset.js | 67 ++ ...t_metadata.google.cloud.aiplatform.v1.json | 44 + .../src/v1/gapic_metadata.json | 10 + .../src/v1/model_service_client.ts | 161 ++++ .../src/v1/model_service_client_config.json | 4 + .../test/gapic_model_service_v1.ts | 198 ++++ 12 files changed, 1687 insertions(+), 126 deletions(-) create mode 100644 packages/google-cloud-aiplatform/samples/generated/v1/model_service.update_explanation_dataset.js diff --git a/packages/google-cloud-aiplatform/README.md b/packages/google-cloud-aiplatform/README.md index c7d91d374e9..ead9658d603 100644 --- a/packages/google-cloud-aiplatform/README.md +++ b/packages/google-cloud-aiplatform/README.md @@ -248,6 +248,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Model_service.list_model_versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/model_service.list_model_versions.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/model_service.list_model_versions.js,packages/google-cloud-aiplatform/samples/README.md) | | Model_service.list_models | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/model_service.list_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/model_service.list_models.js,packages/google-cloud-aiplatform/samples/README.md) | | Model_service.merge_version_aliases | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/model_service.merge_version_aliases.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/model_service.merge_version_aliases.js,packages/google-cloud-aiplatform/samples/README.md) | +| Model_service.update_explanation_dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/model_service.update_explanation_dataset.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/model_service.update_explanation_dataset.js,packages/google-cloud-aiplatform/samples/README.md) | | Model_service.update_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/model_service.update_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/model_service.update_model.js,packages/google-cloud-aiplatform/samples/README.md) | | Model_service.upload_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/model_service.upload_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/model_service.upload_model.js,packages/google-cloud-aiplatform/samples/README.md) | | Pipeline_service.cancel_pipeline_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.cancel_pipeline_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.cancel_pipeline_job.js,packages/google-cloud-aiplatform/samples/README.md) | diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model_service.proto index 3ab66e345c0..b3b3dd7c9ab 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model_service.proto @@ -22,6 +22,7 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/aiplatform/v1/encryption_spec.proto"; import "google/cloud/aiplatform/v1/evaluated_annotation.proto"; +import "google/cloud/aiplatform/v1/explanation.proto"; import "google/cloud/aiplatform/v1/io.proto"; import "google/cloud/aiplatform/v1/model.proto"; import "google/cloud/aiplatform/v1/model_evaluation.proto"; @@ -92,6 +93,20 @@ service ModelService { option (google.api.method_signature) = "model,update_mask"; } + // Incrementally update the dataset used for an examples model. + rpc UpdateExplanationDataset(UpdateExplanationDatasetRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{model=projects/*/locations/*/models/*}:updateExplanationDataset" + body: "*" + }; + option (google.api.method_signature) = "model"; + option (google.longrunning.operation_info) = { + response_type: "UpdateExplanationDatasetResponse" + metadata_type: "UpdateExplanationDatasetOperationMetadata" + }; + } + // Deletes a Model. // // A model cannot be deleted if any @@ -484,6 +499,29 @@ message UpdateModelRequest { [(google.api.field_behavior) = REQUIRED]; } +// Request message for +// [ModelService.UpdateExplanationDataset][google.cloud.aiplatform.v1.ModelService.UpdateExplanationDataset]. +message UpdateExplanationDatasetRequest { + // Required. The resource name of the Model to update. + // Format: `projects/{project}/locations/{location}/models/{model}` + string model = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + } + ]; + + // The example config containing the location of the dataset. + Examples examples = 2; +} + +// Runtime operation information for +// [ModelService.UpdateExplanationDataset][google.cloud.aiplatform.v1.ModelService.UpdateExplanationDataset]. +message UpdateExplanationDatasetOperationMetadata { + // The common part of the operation metadata. + GenericOperationMetadata generic_metadata = 1; +} + // Request message for // [ModelService.DeleteModel][google.cloud.aiplatform.v1.ModelService.DeleteModel]. message DeleteModelRequest { @@ -584,6 +622,11 @@ message ExportModelRequest { OutputConfig output_config = 2 [(google.api.field_behavior) = REQUIRED]; } +// Response message of +// [ModelService.UpdateExplanationDataset][google.cloud.aiplatform.v1.ModelService.UpdateExplanationDataset] +// operation. +message UpdateExplanationDatasetResponse {} + // Details of // [ModelService.ExportModel][google.cloud.aiplatform.v1.ModelService.ExportModel] // operation. diff --git a/packages/google-cloud-aiplatform/protos/protos.d.ts b/packages/google-cloud-aiplatform/protos/protos.d.ts index 1c2a340ad06..ec2c5093418 100644 --- a/packages/google-cloud-aiplatform/protos/protos.d.ts +++ b/packages/google-cloud-aiplatform/protos/protos.d.ts @@ -53070,6 +53070,20 @@ export namespace google { */ public updateModel(request: google.cloud.aiplatform.v1.IUpdateModelRequest): Promise; + /** + * Calls UpdateExplanationDataset. + * @param request UpdateExplanationDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateExplanationDataset(request: google.cloud.aiplatform.v1.IUpdateExplanationDatasetRequest, callback: google.cloud.aiplatform.v1.ModelService.UpdateExplanationDatasetCallback): void; + + /** + * Calls UpdateExplanationDataset. + * @param request UpdateExplanationDatasetRequest message or plain object + * @returns Promise + */ + public updateExplanationDataset(request: google.cloud.aiplatform.v1.IUpdateExplanationDatasetRequest): Promise; + /** * Calls DeleteModel. * @param request DeleteModelRequest message or plain object @@ -53276,6 +53290,13 @@ export namespace google { */ type UpdateModelCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.Model) => void; + /** + * Callback as used by {@link google.cloud.aiplatform.v1.ModelService|updateExplanationDataset}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateExplanationDatasetCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** * Callback as used by {@link google.cloud.aiplatform.v1.ModelService|deleteModel}. * @param error Error, if any @@ -54342,6 +54363,206 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of an UpdateExplanationDatasetRequest. */ + interface IUpdateExplanationDatasetRequest { + + /** UpdateExplanationDatasetRequest model */ + model?: (string|null); + + /** UpdateExplanationDatasetRequest examples */ + examples?: (google.cloud.aiplatform.v1.IExamples|null); + } + + /** Represents an UpdateExplanationDatasetRequest. */ + class UpdateExplanationDatasetRequest implements IUpdateExplanationDatasetRequest { + + /** + * Constructs a new UpdateExplanationDatasetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IUpdateExplanationDatasetRequest); + + /** UpdateExplanationDatasetRequest model. */ + public model: string; + + /** UpdateExplanationDatasetRequest examples. */ + public examples?: (google.cloud.aiplatform.v1.IExamples|null); + + /** + * Creates a new UpdateExplanationDatasetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateExplanationDatasetRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IUpdateExplanationDatasetRequest): google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest; + + /** + * Encodes the specified UpdateExplanationDatasetRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest.verify|verify} messages. + * @param message UpdateExplanationDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IUpdateExplanationDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateExplanationDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest.verify|verify} messages. + * @param message UpdateExplanationDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IUpdateExplanationDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateExplanationDatasetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateExplanationDatasetRequest + * @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.UpdateExplanationDatasetRequest; + + /** + * Decodes an UpdateExplanationDatasetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateExplanationDatasetRequest + * @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.UpdateExplanationDatasetRequest; + + /** + * Verifies an UpdateExplanationDatasetRequest 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 UpdateExplanationDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateExplanationDatasetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest; + + /** + * Creates a plain object from an UpdateExplanationDatasetRequest message. Also converts values to other types if specified. + * @param message UpdateExplanationDatasetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateExplanationDatasetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateExplanationDatasetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateExplanationDatasetOperationMetadata. */ + interface IUpdateExplanationDatasetOperationMetadata { + + /** UpdateExplanationDatasetOperationMetadata genericMetadata */ + genericMetadata?: (google.cloud.aiplatform.v1.IGenericOperationMetadata|null); + } + + /** Represents an UpdateExplanationDatasetOperationMetadata. */ + class UpdateExplanationDatasetOperationMetadata implements IUpdateExplanationDatasetOperationMetadata { + + /** + * Constructs a new UpdateExplanationDatasetOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IUpdateExplanationDatasetOperationMetadata); + + /** UpdateExplanationDatasetOperationMetadata genericMetadata. */ + public genericMetadata?: (google.cloud.aiplatform.v1.IGenericOperationMetadata|null); + + /** + * Creates a new UpdateExplanationDatasetOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateExplanationDatasetOperationMetadata instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IUpdateExplanationDatasetOperationMetadata): google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata; + + /** + * Encodes the specified UpdateExplanationDatasetOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata.verify|verify} messages. + * @param message UpdateExplanationDatasetOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IUpdateExplanationDatasetOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateExplanationDatasetOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata.verify|verify} messages. + * @param message UpdateExplanationDatasetOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IUpdateExplanationDatasetOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateExplanationDatasetOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateExplanationDatasetOperationMetadata + * @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.UpdateExplanationDatasetOperationMetadata; + + /** + * Decodes an UpdateExplanationDatasetOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateExplanationDatasetOperationMetadata + * @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.UpdateExplanationDatasetOperationMetadata; + + /** + * Verifies an UpdateExplanationDatasetOperationMetadata 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 UpdateExplanationDatasetOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateExplanationDatasetOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata; + + /** + * Creates a plain object from an UpdateExplanationDatasetOperationMetadata message. Also converts values to other types if specified. + * @param message UpdateExplanationDatasetOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateExplanationDatasetOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateExplanationDatasetOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a DeleteModelRequest. */ interface IDeleteModelRequest { @@ -54854,6 +55075,97 @@ export namespace google { } } + /** Properties of an UpdateExplanationDatasetResponse. */ + interface IUpdateExplanationDatasetResponse { + } + + /** Represents an UpdateExplanationDatasetResponse. */ + class UpdateExplanationDatasetResponse implements IUpdateExplanationDatasetResponse { + + /** + * Constructs a new UpdateExplanationDatasetResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IUpdateExplanationDatasetResponse); + + /** + * Creates a new UpdateExplanationDatasetResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateExplanationDatasetResponse instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IUpdateExplanationDatasetResponse): google.cloud.aiplatform.v1.UpdateExplanationDatasetResponse; + + /** + * Encodes the specified UpdateExplanationDatasetResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateExplanationDatasetResponse.verify|verify} messages. + * @param message UpdateExplanationDatasetResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IUpdateExplanationDatasetResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateExplanationDatasetResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateExplanationDatasetResponse.verify|verify} messages. + * @param message UpdateExplanationDatasetResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IUpdateExplanationDatasetResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateExplanationDatasetResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateExplanationDatasetResponse + * @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.UpdateExplanationDatasetResponse; + + /** + * Decodes an UpdateExplanationDatasetResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateExplanationDatasetResponse + * @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.UpdateExplanationDatasetResponse; + + /** + * Verifies an UpdateExplanationDatasetResponse 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 UpdateExplanationDatasetResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateExplanationDatasetResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.UpdateExplanationDatasetResponse; + + /** + * Creates a plain object from an UpdateExplanationDatasetResponse message. Also converts values to other types if specified. + * @param message UpdateExplanationDatasetResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.UpdateExplanationDatasetResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateExplanationDatasetResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateExplanationDatasetResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of an ExportModelOperationMetadata. */ interface IExportModelOperationMetadata { diff --git a/packages/google-cloud-aiplatform/protos/protos.js b/packages/google-cloud-aiplatform/protos/protos.js index ce55d9be656..4228fab8651 100644 --- a/packages/google-cloud-aiplatform/protos/protos.js +++ b/packages/google-cloud-aiplatform/protos/protos.js @@ -129399,6 +129399,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.aiplatform.v1.ModelService|updateExplanationDataset}. + * @memberof google.cloud.aiplatform.v1.ModelService + * @typedef UpdateExplanationDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateExplanationDataset. + * @function updateExplanationDataset + * @memberof google.cloud.aiplatform.v1.ModelService + * @instance + * @param {google.cloud.aiplatform.v1.IUpdateExplanationDatasetRequest} request UpdateExplanationDatasetRequest message or plain object + * @param {google.cloud.aiplatform.v1.ModelService.UpdateExplanationDatasetCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ModelService.prototype.updateExplanationDataset = function updateExplanationDataset(request, callback) { + return this.rpcCall(updateExplanationDataset, $root.google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateExplanationDataset" }); + + /** + * Calls UpdateExplanationDataset. + * @function updateExplanationDataset + * @memberof google.cloud.aiplatform.v1.ModelService + * @instance + * @param {google.cloud.aiplatform.v1.IUpdateExplanationDatasetRequest} request UpdateExplanationDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.aiplatform.v1.ModelService|deleteModel}. * @memberof google.cloud.aiplatform.v1.ModelService @@ -132118,24 +132151,25 @@ return UpdateModelRequest; })(); - v1.DeleteModelRequest = (function() { + v1.UpdateExplanationDatasetRequest = (function() { /** - * Properties of a DeleteModelRequest. + * Properties of an UpdateExplanationDatasetRequest. * @memberof google.cloud.aiplatform.v1 - * @interface IDeleteModelRequest - * @property {string|null} [name] DeleteModelRequest name + * @interface IUpdateExplanationDatasetRequest + * @property {string|null} [model] UpdateExplanationDatasetRequest model + * @property {google.cloud.aiplatform.v1.IExamples|null} [examples] UpdateExplanationDatasetRequest examples */ /** - * Constructs a new DeleteModelRequest. + * Constructs a new UpdateExplanationDatasetRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a DeleteModelRequest. - * @implements IDeleteModelRequest + * @classdesc Represents an UpdateExplanationDatasetRequest. + * @implements IUpdateExplanationDatasetRequest * @constructor - * @param {google.cloud.aiplatform.v1.IDeleteModelRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IUpdateExplanationDatasetRequest=} [properties] Properties to set */ - function DeleteModelRequest(properties) { + function UpdateExplanationDatasetRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -132143,75 +132177,89 @@ } /** - * DeleteModelRequest name. - * @member {string} name - * @memberof google.cloud.aiplatform.v1.DeleteModelRequest + * UpdateExplanationDatasetRequest model. + * @member {string} model + * @memberof google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest * @instance */ - DeleteModelRequest.prototype.name = ""; + UpdateExplanationDatasetRequest.prototype.model = ""; /** - * Creates a new DeleteModelRequest instance using the specified properties. + * UpdateExplanationDatasetRequest examples. + * @member {google.cloud.aiplatform.v1.IExamples|null|undefined} examples + * @memberof google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest + * @instance + */ + UpdateExplanationDatasetRequest.prototype.examples = null; + + /** + * Creates a new UpdateExplanationDatasetRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.DeleteModelRequest + * @memberof google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest * @static - * @param {google.cloud.aiplatform.v1.IDeleteModelRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.DeleteModelRequest} DeleteModelRequest instance + * @param {google.cloud.aiplatform.v1.IUpdateExplanationDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest} UpdateExplanationDatasetRequest instance */ - DeleteModelRequest.create = function create(properties) { - return new DeleteModelRequest(properties); + UpdateExplanationDatasetRequest.create = function create(properties) { + return new UpdateExplanationDatasetRequest(properties); }; /** - * Encodes the specified DeleteModelRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteModelRequest.verify|verify} messages. + * Encodes the specified UpdateExplanationDatasetRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.DeleteModelRequest + * @memberof google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest * @static - * @param {google.cloud.aiplatform.v1.IDeleteModelRequest} message DeleteModelRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IUpdateExplanationDatasetRequest} message UpdateExplanationDatasetRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteModelRequest.encode = function encode(message, writer) { + UpdateExplanationDatasetRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + if (message.examples != null && Object.hasOwnProperty.call(message, "examples")) + $root.google.cloud.aiplatform.v1.Examples.encode(message.examples, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified DeleteModelRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteModelRequest.verify|verify} messages. + * Encodes the specified UpdateExplanationDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.DeleteModelRequest + * @memberof google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest * @static - * @param {google.cloud.aiplatform.v1.IDeleteModelRequest} message DeleteModelRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IUpdateExplanationDatasetRequest} message UpdateExplanationDatasetRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateExplanationDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteModelRequest message from the specified reader or buffer. + * Decodes an UpdateExplanationDatasetRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.DeleteModelRequest + * @memberof google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest * @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.DeleteModelRequest} DeleteModelRequest + * @returns {google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest} UpdateExplanationDatasetRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteModelRequest.decode = function decode(reader, length) { + UpdateExplanationDatasetRequest.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.DeleteModelRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.model = reader.string(); + break; + } + case 2: { + message.examples = $root.google.cloud.aiplatform.v1.Examples.decode(reader, reader.uint32()); break; } default: @@ -132223,122 +132271,136 @@ }; /** - * Decodes a DeleteModelRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateExplanationDatasetRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.DeleteModelRequest + * @memberof google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.DeleteModelRequest} DeleteModelRequest + * @returns {google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest} UpdateExplanationDatasetRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteModelRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateExplanationDatasetRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteModelRequest message. + * Verifies an UpdateExplanationDatasetRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.DeleteModelRequest + * @memberof google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteModelRequest.verify = function verify(message) { + UpdateExplanationDatasetRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.examples != null && message.hasOwnProperty("examples")) { + var error = $root.google.cloud.aiplatform.v1.Examples.verify(message.examples); + if (error) + return "examples." + error; + } return null; }; /** - * Creates a DeleteModelRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateExplanationDatasetRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.DeleteModelRequest + * @memberof google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.DeleteModelRequest} DeleteModelRequest + * @returns {google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest} UpdateExplanationDatasetRequest */ - DeleteModelRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.DeleteModelRequest) + UpdateExplanationDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.DeleteModelRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest(); + if (object.model != null) + message.model = String(object.model); + if (object.examples != null) { + if (typeof object.examples !== "object") + throw TypeError(".google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest.examples: object expected"); + message.examples = $root.google.cloud.aiplatform.v1.Examples.fromObject(object.examples); + } return message; }; /** - * Creates a plain object from a DeleteModelRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateExplanationDatasetRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.DeleteModelRequest + * @memberof google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest * @static - * @param {google.cloud.aiplatform.v1.DeleteModelRequest} message DeleteModelRequest + * @param {google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest} message UpdateExplanationDatasetRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteModelRequest.toObject = function toObject(message, options) { + UpdateExplanationDatasetRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (options.defaults) { + object.model = ""; + object.examples = null; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.examples != null && message.hasOwnProperty("examples")) + object.examples = $root.google.cloud.aiplatform.v1.Examples.toObject(message.examples, options); return object; }; /** - * Converts this DeleteModelRequest to JSON. + * Converts this UpdateExplanationDatasetRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.DeleteModelRequest + * @memberof google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest * @instance * @returns {Object.} JSON object */ - DeleteModelRequest.prototype.toJSON = function toJSON() { + UpdateExplanationDatasetRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteModelRequest + * Gets the default type url for UpdateExplanationDatasetRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.DeleteModelRequest + * @memberof google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateExplanationDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.DeleteModelRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest"; }; - return DeleteModelRequest; + return UpdateExplanationDatasetRequest; })(); - v1.DeleteModelVersionRequest = (function() { + v1.UpdateExplanationDatasetOperationMetadata = (function() { /** - * Properties of a DeleteModelVersionRequest. + * Properties of an UpdateExplanationDatasetOperationMetadata. * @memberof google.cloud.aiplatform.v1 - * @interface IDeleteModelVersionRequest - * @property {string|null} [name] DeleteModelVersionRequest name + * @interface IUpdateExplanationDatasetOperationMetadata + * @property {google.cloud.aiplatform.v1.IGenericOperationMetadata|null} [genericMetadata] UpdateExplanationDatasetOperationMetadata genericMetadata */ /** - * Constructs a new DeleteModelVersionRequest. + * Constructs a new UpdateExplanationDatasetOperationMetadata. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a DeleteModelVersionRequest. - * @implements IDeleteModelVersionRequest + * @classdesc Represents an UpdateExplanationDatasetOperationMetadata. + * @implements IUpdateExplanationDatasetOperationMetadata * @constructor - * @param {google.cloud.aiplatform.v1.IDeleteModelVersionRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IUpdateExplanationDatasetOperationMetadata=} [properties] Properties to set */ - function DeleteModelVersionRequest(properties) { + function UpdateExplanationDatasetOperationMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -132346,75 +132408,75 @@ } /** - * DeleteModelVersionRequest name. - * @member {string} name - * @memberof google.cloud.aiplatform.v1.DeleteModelVersionRequest + * UpdateExplanationDatasetOperationMetadata genericMetadata. + * @member {google.cloud.aiplatform.v1.IGenericOperationMetadata|null|undefined} genericMetadata + * @memberof google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata * @instance */ - DeleteModelVersionRequest.prototype.name = ""; + UpdateExplanationDatasetOperationMetadata.prototype.genericMetadata = null; /** - * Creates a new DeleteModelVersionRequest instance using the specified properties. + * Creates a new UpdateExplanationDatasetOperationMetadata instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.DeleteModelVersionRequest + * @memberof google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata * @static - * @param {google.cloud.aiplatform.v1.IDeleteModelVersionRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.DeleteModelVersionRequest} DeleteModelVersionRequest instance + * @param {google.cloud.aiplatform.v1.IUpdateExplanationDatasetOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata} UpdateExplanationDatasetOperationMetadata instance */ - DeleteModelVersionRequest.create = function create(properties) { - return new DeleteModelVersionRequest(properties); + UpdateExplanationDatasetOperationMetadata.create = function create(properties) { + return new UpdateExplanationDatasetOperationMetadata(properties); }; /** - * Encodes the specified DeleteModelVersionRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteModelVersionRequest.verify|verify} messages. + * Encodes the specified UpdateExplanationDatasetOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.DeleteModelVersionRequest + * @memberof google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata * @static - * @param {google.cloud.aiplatform.v1.IDeleteModelVersionRequest} message DeleteModelVersionRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IUpdateExplanationDatasetOperationMetadata} message UpdateExplanationDatasetOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteModelVersionRequest.encode = function encode(message, writer) { + UpdateExplanationDatasetOperationMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.genericMetadata != null && Object.hasOwnProperty.call(message, "genericMetadata")) + $root.google.cloud.aiplatform.v1.GenericOperationMetadata.encode(message.genericMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified DeleteModelVersionRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteModelVersionRequest.verify|verify} messages. + * Encodes the specified UpdateExplanationDatasetOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.DeleteModelVersionRequest + * @memberof google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata * @static - * @param {google.cloud.aiplatform.v1.IDeleteModelVersionRequest} message DeleteModelVersionRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IUpdateExplanationDatasetOperationMetadata} message UpdateExplanationDatasetOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteModelVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateExplanationDatasetOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteModelVersionRequest message from the specified reader or buffer. + * Decodes an UpdateExplanationDatasetOperationMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.DeleteModelVersionRequest + * @memberof google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata * @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.DeleteModelVersionRequest} DeleteModelVersionRequest + * @returns {google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata} UpdateExplanationDatasetOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteModelVersionRequest.decode = function decode(reader, length) { + UpdateExplanationDatasetOperationMetadata.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.DeleteModelVersionRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.decode(reader, reader.uint32()); break; } default: @@ -132426,65 +132488,476 @@ }; /** - * Decodes a DeleteModelVersionRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateExplanationDatasetOperationMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.DeleteModelVersionRequest + * @memberof google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.DeleteModelVersionRequest} DeleteModelVersionRequest + * @returns {google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata} UpdateExplanationDatasetOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteModelVersionRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateExplanationDatasetOperationMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteModelVersionRequest message. + * Verifies an UpdateExplanationDatasetOperationMetadata message. * @function verify - * @memberof google.cloud.aiplatform.v1.DeleteModelVersionRequest + * @memberof google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteModelVersionRequest.verify = function verify(message) { + UpdateExplanationDatasetOperationMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) { + var error = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.verify(message.genericMetadata); + if (error) + return "genericMetadata." + error; + } return null; }; /** - * Creates a DeleteModelVersionRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateExplanationDatasetOperationMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.DeleteModelVersionRequest + * @memberof google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.DeleteModelVersionRequest} DeleteModelVersionRequest + * @returns {google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata} UpdateExplanationDatasetOperationMetadata */ - DeleteModelVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.DeleteModelVersionRequest) + UpdateExplanationDatasetOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata) return object; - var message = new $root.google.cloud.aiplatform.v1.DeleteModelVersionRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata(); + if (object.genericMetadata != null) { + if (typeof object.genericMetadata !== "object") + throw TypeError(".google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata.genericMetadata: object expected"); + message.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.fromObject(object.genericMetadata); + } return message; }; /** - * Creates a plain object from a DeleteModelVersionRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateExplanationDatasetOperationMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.DeleteModelVersionRequest + * @memberof google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata * @static - * @param {google.cloud.aiplatform.v1.DeleteModelVersionRequest} message DeleteModelVersionRequest + * @param {google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata} message UpdateExplanationDatasetOperationMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteModelVersionRequest.toObject = function toObject(message, options) { + UpdateExplanationDatasetOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.genericMetadata = null; + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) + object.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.toObject(message.genericMetadata, options); + return object; + }; + + /** + * Converts this UpdateExplanationDatasetOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateExplanationDatasetOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateExplanationDatasetOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateExplanationDatasetOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata"; + }; + + return UpdateExplanationDatasetOperationMetadata; + })(); + + v1.DeleteModelRequest = (function() { + + /** + * Properties of a DeleteModelRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface IDeleteModelRequest + * @property {string|null} [name] DeleteModelRequest name + */ + + /** + * Constructs a new DeleteModelRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a DeleteModelRequest. + * @implements IDeleteModelRequest + * @constructor + * @param {google.cloud.aiplatform.v1.IDeleteModelRequest=} [properties] Properties to set + */ + function DeleteModelRequest(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]]; + } + + /** + * DeleteModelRequest name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.DeleteModelRequest + * @instance + */ + DeleteModelRequest.prototype.name = ""; + + /** + * Creates a new DeleteModelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.DeleteModelRequest + * @static + * @param {google.cloud.aiplatform.v1.IDeleteModelRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.DeleteModelRequest} DeleteModelRequest instance + */ + DeleteModelRequest.create = function create(properties) { + return new DeleteModelRequest(properties); + }; + + /** + * Encodes the specified DeleteModelRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteModelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.DeleteModelRequest + * @static + * @param {google.cloud.aiplatform.v1.IDeleteModelRequest} message DeleteModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteModelRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteModelRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.DeleteModelRequest + * @static + * @param {google.cloud.aiplatform.v1.IDeleteModelRequest} message DeleteModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.DeleteModelRequest + * @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.DeleteModelRequest} DeleteModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteModelRequest.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.DeleteModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.DeleteModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.DeleteModelRequest} DeleteModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteModelRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.DeleteModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteModelRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.DeleteModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.DeleteModelRequest} DeleteModelRequest + */ + DeleteModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.DeleteModelRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.DeleteModelRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.DeleteModelRequest + * @static + * @param {google.cloud.aiplatform.v1.DeleteModelRequest} message DeleteModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteModelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.DeleteModelRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteModelRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.DeleteModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.DeleteModelRequest"; + }; + + return DeleteModelRequest; + })(); + + v1.DeleteModelVersionRequest = (function() { + + /** + * Properties of a DeleteModelVersionRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface IDeleteModelVersionRequest + * @property {string|null} [name] DeleteModelVersionRequest name + */ + + /** + * Constructs a new DeleteModelVersionRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a DeleteModelVersionRequest. + * @implements IDeleteModelVersionRequest + * @constructor + * @param {google.cloud.aiplatform.v1.IDeleteModelVersionRequest=} [properties] Properties to set + */ + function DeleteModelVersionRequest(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]]; + } + + /** + * DeleteModelVersionRequest name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.DeleteModelVersionRequest + * @instance + */ + DeleteModelVersionRequest.prototype.name = ""; + + /** + * Creates a new DeleteModelVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.DeleteModelVersionRequest + * @static + * @param {google.cloud.aiplatform.v1.IDeleteModelVersionRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.DeleteModelVersionRequest} DeleteModelVersionRequest instance + */ + DeleteModelVersionRequest.create = function create(properties) { + return new DeleteModelVersionRequest(properties); + }; + + /** + * Encodes the specified DeleteModelVersionRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteModelVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.DeleteModelVersionRequest + * @static + * @param {google.cloud.aiplatform.v1.IDeleteModelVersionRequest} message DeleteModelVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteModelVersionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteModelVersionRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteModelVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.DeleteModelVersionRequest + * @static + * @param {google.cloud.aiplatform.v1.IDeleteModelVersionRequest} message DeleteModelVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteModelVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteModelVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.DeleteModelVersionRequest + * @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.DeleteModelVersionRequest} DeleteModelVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteModelVersionRequest.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.DeleteModelVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteModelVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.DeleteModelVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.DeleteModelVersionRequest} DeleteModelVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteModelVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteModelVersionRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.DeleteModelVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteModelVersionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteModelVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.DeleteModelVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.DeleteModelVersionRequest} DeleteModelVersionRequest + */ + DeleteModelVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.DeleteModelVersionRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.DeleteModelVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteModelVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.DeleteModelVersionRequest + * @static + * @param {google.cloud.aiplatform.v1.DeleteModelVersionRequest} message DeleteModelVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteModelVersionRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -133259,6 +133732,181 @@ return ExportModelRequest; })(); + v1.UpdateExplanationDatasetResponse = (function() { + + /** + * Properties of an UpdateExplanationDatasetResponse. + * @memberof google.cloud.aiplatform.v1 + * @interface IUpdateExplanationDatasetResponse + */ + + /** + * Constructs a new UpdateExplanationDatasetResponse. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents an UpdateExplanationDatasetResponse. + * @implements IUpdateExplanationDatasetResponse + * @constructor + * @param {google.cloud.aiplatform.v1.IUpdateExplanationDatasetResponse=} [properties] Properties to set + */ + function UpdateExplanationDatasetResponse(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]]; + } + + /** + * Creates a new UpdateExplanationDatasetResponse instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.UpdateExplanationDatasetResponse + * @static + * @param {google.cloud.aiplatform.v1.IUpdateExplanationDatasetResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.UpdateExplanationDatasetResponse} UpdateExplanationDatasetResponse instance + */ + UpdateExplanationDatasetResponse.create = function create(properties) { + return new UpdateExplanationDatasetResponse(properties); + }; + + /** + * Encodes the specified UpdateExplanationDatasetResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateExplanationDatasetResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.UpdateExplanationDatasetResponse + * @static + * @param {google.cloud.aiplatform.v1.IUpdateExplanationDatasetResponse} message UpdateExplanationDatasetResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateExplanationDatasetResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified UpdateExplanationDatasetResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateExplanationDatasetResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.UpdateExplanationDatasetResponse + * @static + * @param {google.cloud.aiplatform.v1.IUpdateExplanationDatasetResponse} message UpdateExplanationDatasetResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateExplanationDatasetResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateExplanationDatasetResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.UpdateExplanationDatasetResponse + * @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.UpdateExplanationDatasetResponse} UpdateExplanationDatasetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateExplanationDatasetResponse.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.UpdateExplanationDatasetResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateExplanationDatasetResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.UpdateExplanationDatasetResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.UpdateExplanationDatasetResponse} UpdateExplanationDatasetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateExplanationDatasetResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateExplanationDatasetResponse message. + * @function verify + * @memberof google.cloud.aiplatform.v1.UpdateExplanationDatasetResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateExplanationDatasetResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an UpdateExplanationDatasetResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.UpdateExplanationDatasetResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.UpdateExplanationDatasetResponse} UpdateExplanationDatasetResponse + */ + UpdateExplanationDatasetResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.UpdateExplanationDatasetResponse) + return object; + return new $root.google.cloud.aiplatform.v1.UpdateExplanationDatasetResponse(); + }; + + /** + * Creates a plain object from an UpdateExplanationDatasetResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.UpdateExplanationDatasetResponse + * @static + * @param {google.cloud.aiplatform.v1.UpdateExplanationDatasetResponse} message UpdateExplanationDatasetResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateExplanationDatasetResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this UpdateExplanationDatasetResponse to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.UpdateExplanationDatasetResponse + * @instance + * @returns {Object.} JSON object + */ + UpdateExplanationDatasetResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateExplanationDatasetResponse + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.UpdateExplanationDatasetResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateExplanationDatasetResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.UpdateExplanationDatasetResponse"; + }; + + return UpdateExplanationDatasetResponse; + })(); + v1.ExportModelOperationMetadata = (function() { /** diff --git a/packages/google-cloud-aiplatform/protos/protos.json b/packages/google-cloud-aiplatform/protos/protos.json index 3a51bd434ce..314cf2a6db0 100644 --- a/packages/google-cloud-aiplatform/protos/protos.json +++ b/packages/google-cloud-aiplatform/protos/protos.json @@ -13961,6 +13961,34 @@ } ] }, + "UpdateExplanationDataset": { + "requestType": "UpdateExplanationDatasetRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{model=projects/*/locations/*/models/*}:updateExplanationDataset", + "(google.api.http).body": "*", + "(google.api.method_signature)": "model", + "(google.longrunning.operation_info).response_type": "UpdateExplanationDatasetResponse", + "(google.longrunning.operation_info).metadata_type": "UpdateExplanationDatasetOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{model=projects/*/locations/*/models/*}:updateExplanationDataset", + "body": "*" + } + }, + { + "(google.api.method_signature)": "model" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "UpdateExplanationDatasetResponse", + "metadata_type": "UpdateExplanationDatasetOperationMetadata" + } + } + ] + }, "DeleteModel": { "requestType": "DeleteModelRequest", "responseType": "google.longrunning.Operation", @@ -14409,6 +14437,30 @@ } } }, + "UpdateExplanationDatasetRequest": { + "fields": { + "model": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/Model" + } + }, + "examples": { + "type": "Examples", + "id": 2 + } + } + }, + "UpdateExplanationDatasetOperationMetadata": { + "fields": { + "genericMetadata": { + "type": "GenericOperationMetadata", + "id": 1 + } + } + }, "DeleteModelRequest": { "fields": { "name": { @@ -14490,6 +14542,9 @@ } } }, + "UpdateExplanationDatasetResponse": { + "fields": {} + }, "ExportModelOperationMetadata": { "fields": { "genericMetadata": { diff --git a/packages/google-cloud-aiplatform/samples/README.md b/packages/google-cloud-aiplatform/samples/README.md index 3820254c2b6..cb201739e77 100644 --- a/packages/google-cloud-aiplatform/samples/README.md +++ b/packages/google-cloud-aiplatform/samples/README.md @@ -158,6 +158,7 @@ * [Model_service.list_model_versions](#model_service.list_model_versions) * [Model_service.list_models](#model_service.list_models) * [Model_service.merge_version_aliases](#model_service.merge_version_aliases) + * [Model_service.update_explanation_dataset](#model_service.update_explanation_dataset) * [Model_service.update_model](#model_service.update_model) * [Model_service.upload_model](#model_service.upload_model) * [Pipeline_service.cancel_pipeline_job](#pipeline_service.cancel_pipeline_job) @@ -2944,6 +2945,23 @@ __Usage:__ +### Model_service.update_explanation_dataset + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/model_service.update_explanation_dataset.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/model_service.update_explanation_dataset.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1/model_service.update_explanation_dataset.js` + + +----- + + + + ### Model_service.update_model View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/model_service.update_model.js). diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.update_explanation_dataset.js b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.update_explanation_dataset.js new file mode 100644 index 00000000000..ba7b6417369 --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.update_explanation_dataset.js @@ -0,0 +1,67 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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(model) { + // [START aiplatform_v1_generated_ModelService_UpdateExplanationDataset_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the Model to update. + * Format: `projects/{project}/locations/{location}/models/{model}` + */ + // const model = 'abc123' + /** + * The example config containing the location of the dataset. + */ + // const examples = {} + + // Imports the Aiplatform library + const {ModelServiceClient} = require('@google-cloud/aiplatform').v1; + + // Instantiates a client + const aiplatformClient = new ModelServiceClient(); + + async function callUpdateExplanationDataset() { + // Construct request + const request = { + model, + }; + + // Run request + const [operation] = await aiplatformClient.updateExplanationDataset(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateExplanationDataset(); + // [END aiplatform_v1_generated_ModelService_UpdateExplanationDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata.google.cloud.aiplatform.v1.json b/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata.google.cloud.aiplatform.v1.json index bab650854e3..815fcb1f15c 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 @@ -6435,6 +6435,50 @@ } } }, + { + "regionTag": "aiplatform_v1_generated_ModelService_UpdateExplanationDataset_async", + "title": "DatasetService updateExplanationDataset Sample", + "origin": "API_DEFINITION", + "description": " Incrementally update the dataset used for an examples model.", + "canonical": true, + "file": "model_service.update_explanation_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateExplanationDataset", + "fullName": "google.cloud.aiplatform.v1.ModelService.UpdateExplanationDataset", + "async": true, + "parameters": [ + { + "name": "model", + "type": "TYPE_STRING" + }, + { + "name": "examples", + "type": ".google.cloud.aiplatform.v1.Examples" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ModelServiceClient", + "fullName": "google.cloud.aiplatform.v1.ModelServiceClient" + }, + "method": { + "shortName": "UpdateExplanationDataset", + "fullName": "google.cloud.aiplatform.v1.ModelService.UpdateExplanationDataset", + "service": { + "shortName": "ModelService", + "fullName": "google.cloud.aiplatform.v1.ModelService" + } + } + } + }, { "regionTag": "aiplatform_v1_generated_ModelService_DeleteModel_async", "title": "DatasetService deleteModel Sample", diff --git a/packages/google-cloud-aiplatform/src/v1/gapic_metadata.json b/packages/google-cloud-aiplatform/src/v1/gapic_metadata.json index 10d41e70480..a3935f3cf87 100644 --- a/packages/google-cloud-aiplatform/src/v1/gapic_metadata.json +++ b/packages/google-cloud-aiplatform/src/v1/gapic_metadata.json @@ -1618,6 +1618,11 @@ "uploadModel" ] }, + "UpdateExplanationDataset": { + "methods": [ + "updateExplanationDataset" + ] + }, "DeleteModel": { "methods": [ "deleteModel" @@ -1716,6 +1721,11 @@ "uploadModel" ] }, + "UpdateExplanationDataset": { + "methods": [ + "updateExplanationDataset" + ] + }, "DeleteModel": { "methods": [ "deleteModel" diff --git a/packages/google-cloud-aiplatform/src/v1/model_service_client.ts b/packages/google-cloud-aiplatform/src/v1/model_service_client.ts index 97de9b780c2..1a9851cfe83 100644 --- a/packages/google-cloud-aiplatform/src/v1/model_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/model_service_client.ts @@ -1371,6 +1371,12 @@ export class ModelServiceClient { const uploadModelMetadata = protoFilesRoot.lookup( '.google.cloud.aiplatform.v1.UploadModelOperationMetadata' ) as gax.protobuf.Type; + const updateExplanationDatasetResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.UpdateExplanationDatasetResponse' + ) as gax.protobuf.Type; + const updateExplanationDatasetMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata' + ) as gax.protobuf.Type; const deleteModelResponse = protoFilesRoot.lookup( '.google.protobuf.Empty' ) as gax.protobuf.Type; @@ -1402,6 +1408,15 @@ export class ModelServiceClient { uploadModelResponse.decode.bind(uploadModelResponse), uploadModelMetadata.decode.bind(uploadModelMetadata) ), + updateExplanationDataset: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateExplanationDatasetResponse.decode.bind( + updateExplanationDatasetResponse + ), + updateExplanationDatasetMetadata.decode.bind( + updateExplanationDatasetMetadata + ) + ), deleteModel: new this._gaxModule.LongrunningDescriptor( this.operationsClient, deleteModelResponse.decode.bind(deleteModelResponse), @@ -1479,6 +1494,7 @@ export class ModelServiceClient { 'listModels', 'listModelVersions', 'updateModel', + 'updateExplanationDataset', 'deleteModel', 'deleteModelVersion', 'mergeVersionAliases', @@ -2549,6 +2565,151 @@ export class ModelServiceClient { protos.google.cloud.aiplatform.v1.UploadModelOperationMetadata >; } + /** + * Incrementally update the dataset used for an examples model. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.model + * Required. The resource name of the Model to update. + * Format: `projects/{project}/locations/{location}/models/{model}` + * @param {google.cloud.aiplatform.v1.Examples} request.examples + * The example config containing the location of the dataset. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/model_service.update_explanation_dataset.js + * region_tag:aiplatform_v1_generated_ModelService_UpdateExplanationDataset_async + */ + updateExplanationDataset( + request?: protos.google.cloud.aiplatform.v1.IUpdateExplanationDatasetRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.aiplatform.v1.IUpdateExplanationDatasetResponse, + protos.google.cloud.aiplatform.v1.IUpdateExplanationDatasetOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateExplanationDataset( + request: protos.google.cloud.aiplatform.v1.IUpdateExplanationDatasetRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.aiplatform.v1.IUpdateExplanationDatasetResponse, + protos.google.cloud.aiplatform.v1.IUpdateExplanationDatasetOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateExplanationDataset( + request: protos.google.cloud.aiplatform.v1.IUpdateExplanationDatasetRequest, + callback: Callback< + LROperation< + protos.google.cloud.aiplatform.v1.IUpdateExplanationDatasetResponse, + protos.google.cloud.aiplatform.v1.IUpdateExplanationDatasetOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateExplanationDataset( + request?: protos.google.cloud.aiplatform.v1.IUpdateExplanationDatasetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.aiplatform.v1.IUpdateExplanationDatasetResponse, + protos.google.cloud.aiplatform.v1.IUpdateExplanationDatasetOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.aiplatform.v1.IUpdateExplanationDatasetResponse, + protos.google.cloud.aiplatform.v1.IUpdateExplanationDatasetOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.aiplatform.v1.IUpdateExplanationDatasetResponse, + protos.google.cloud.aiplatform.v1.IUpdateExplanationDatasetOperationMetadata + >, + 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({ + model: request.model ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateExplanationDataset( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `updateExplanationDataset()`. + * @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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/model_service.update_explanation_dataset.js + * region_tag:aiplatform_v1_generated_ModelService_UpdateExplanationDataset_async + */ + async checkUpdateExplanationDatasetProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.aiplatform.v1.UpdateExplanationDatasetResponse, + protos.google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata + > + > { + 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.updateExplanationDataset, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.aiplatform.v1.UpdateExplanationDatasetResponse, + protos.google.cloud.aiplatform.v1.UpdateExplanationDatasetOperationMetadata + >; + } /** * Deletes a Model. * diff --git a/packages/google-cloud-aiplatform/src/v1/model_service_client_config.json b/packages/google-cloud-aiplatform/src/v1/model_service_client_config.json index 705668228c5..ff3a5791cbb 100644 --- a/packages/google-cloud-aiplatform/src/v1/model_service_client_config.json +++ b/packages/google-cloud-aiplatform/src/v1/model_service_client_config.json @@ -40,6 +40,10 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "UpdateExplanationDataset": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "DeleteModel": { "retry_codes_name": "non_idempotent", "retry_params_name": "default" diff --git a/packages/google-cloud-aiplatform/test/gapic_model_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_model_service_v1.ts index f6b1f2c518c..3859802e971 100644 --- a/packages/google-cloud-aiplatform/test/gapic_model_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_model_service_v1.ts @@ -1524,6 +1524,204 @@ describe('v1.ModelServiceClient', () => { }); }); + describe('updateExplanationDataset', () => { + it('invokes updateExplanationDataset without error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateExplanationDataset = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateExplanationDataset(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateExplanationDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExplanationDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExplanationDataset without error using callback', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateExplanationDataset = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateExplanationDataset( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.aiplatform.v1.IUpdateExplanationDatasetResponse, + protos.google.cloud.aiplatform.v1.IUpdateExplanationDatasetOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.aiplatform.v1.IUpdateExplanationDatasetResponse, + protos.google.cloud.aiplatform.v1.IUpdateExplanationDatasetOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateExplanationDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExplanationDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExplanationDataset with call error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateExplanationDataset = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateExplanationDataset(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updateExplanationDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExplanationDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExplanationDataset with LRO error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.UpdateExplanationDatasetRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateExplanationDataset = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateExplanationDataset(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateExplanationDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExplanationDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateExplanationDatasetProgress without error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + 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.checkUpdateExplanationDatasetProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateExplanationDatasetProgress with error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + 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.checkUpdateExplanationDatasetProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + describe('deleteModel', () => { it('invokes deleteModel without error', async () => { const client = new modelserviceModule.v1.ModelServiceClient({