@google-cloud/aiplatform
Version:
Vertex AI client for Node.js
833 lines (773 loc) • 54.2 MB
JavaScript
// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
(function(global, factory) { /* global define, require, module */
/* AMD */ if (typeof define === 'function' && define.amd)
define(["protobufjs/minimal"], factory);
/* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports)
module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal);
})(this, function($protobuf) {
"use strict";
// Common aliases
var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
// Exported root namespace
var $root = $protobuf.roots._google_cloud_aiplatform_protos || ($protobuf.roots._google_cloud_aiplatform_protos = {});
$root.google = (function() {
/**
* Namespace google.
* @exports google
* @namespace
*/
var google = {};
google.cloud = (function() {
/**
* Namespace cloud.
* @memberof google
* @namespace
*/
var cloud = {};
cloud.aiplatform = (function() {
/**
* Namespace aiplatform.
* @memberof google.cloud
* @namespace
*/
var aiplatform = {};
aiplatform.v1 = (function() {
/**
* Namespace v1.
* @memberof google.cloud.aiplatform
* @namespace
*/
var v1 = {};
/**
* AcceleratorType enum.
* @name google.cloud.aiplatform.v1.AcceleratorType
* @enum {number}
* @property {number} ACCELERATOR_TYPE_UNSPECIFIED=0 ACCELERATOR_TYPE_UNSPECIFIED value
* @property {number} NVIDIA_TESLA_K80=1 NVIDIA_TESLA_K80 value
* @property {number} NVIDIA_TESLA_P100=2 NVIDIA_TESLA_P100 value
* @property {number} NVIDIA_TESLA_V100=3 NVIDIA_TESLA_V100 value
* @property {number} NVIDIA_TESLA_P4=4 NVIDIA_TESLA_P4 value
* @property {number} NVIDIA_TESLA_T4=5 NVIDIA_TESLA_T4 value
* @property {number} NVIDIA_TESLA_A100=8 NVIDIA_TESLA_A100 value
* @property {number} NVIDIA_A100_80GB=9 NVIDIA_A100_80GB value
* @property {number} NVIDIA_L4=11 NVIDIA_L4 value
* @property {number} NVIDIA_H100_80GB=13 NVIDIA_H100_80GB value
* @property {number} NVIDIA_H100_MEGA_80GB=14 NVIDIA_H100_MEGA_80GB value
* @property {number} NVIDIA_H200_141GB=15 NVIDIA_H200_141GB value
* @property {number} NVIDIA_B200=16 NVIDIA_B200 value
* @property {number} NVIDIA_GB200=17 NVIDIA_GB200 value
* @property {number} TPU_V2=6 TPU_V2 value
* @property {number} TPU_V3=7 TPU_V3 value
* @property {number} TPU_V4_POD=10 TPU_V4_POD value
* @property {number} TPU_V5_LITEPOD=12 TPU_V5_LITEPOD value
*/
v1.AcceleratorType = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[0] = "ACCELERATOR_TYPE_UNSPECIFIED"] = 0;
values[valuesById[1] = "NVIDIA_TESLA_K80"] = 1;
values[valuesById[2] = "NVIDIA_TESLA_P100"] = 2;
values[valuesById[3] = "NVIDIA_TESLA_V100"] = 3;
values[valuesById[4] = "NVIDIA_TESLA_P4"] = 4;
values[valuesById[5] = "NVIDIA_TESLA_T4"] = 5;
values[valuesById[8] = "NVIDIA_TESLA_A100"] = 8;
values[valuesById[9] = "NVIDIA_A100_80GB"] = 9;
values[valuesById[11] = "NVIDIA_L4"] = 11;
values[valuesById[13] = "NVIDIA_H100_80GB"] = 13;
values[valuesById[14] = "NVIDIA_H100_MEGA_80GB"] = 14;
values[valuesById[15] = "NVIDIA_H200_141GB"] = 15;
values[valuesById[16] = "NVIDIA_B200"] = 16;
values[valuesById[17] = "NVIDIA_GB200"] = 17;
values[valuesById[6] = "TPU_V2"] = 6;
values[valuesById[7] = "TPU_V3"] = 7;
values[valuesById[10] = "TPU_V4_POD"] = 10;
values[valuesById[12] = "TPU_V5_LITEPOD"] = 12;
return values;
})();
v1.Annotation = (function() {
/**
* Properties of an Annotation.
* @memberof google.cloud.aiplatform.v1
* @interface IAnnotation
* @property {string|null} [name] Annotation name
* @property {string|null} [payloadSchemaUri] Annotation payloadSchemaUri
* @property {google.protobuf.IValue|null} [payload] Annotation payload
* @property {google.protobuf.ITimestamp|null} [createTime] Annotation createTime
* @property {google.protobuf.ITimestamp|null} [updateTime] Annotation updateTime
* @property {string|null} [etag] Annotation etag
* @property {google.cloud.aiplatform.v1.IUserActionReference|null} [annotationSource] Annotation annotationSource
* @property {Object.<string,string>|null} [labels] Annotation labels
*/
/**
* Constructs a new Annotation.
* @memberof google.cloud.aiplatform.v1
* @classdesc Represents an Annotation.
* @implements IAnnotation
* @constructor
* @param {google.cloud.aiplatform.v1.IAnnotation=} [properties] Properties to set
*/
function Annotation(properties) {
this.labels = {};
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* Annotation name.
* @member {string} name
* @memberof google.cloud.aiplatform.v1.Annotation
* @instance
*/
Annotation.prototype.name = "";
/**
* Annotation payloadSchemaUri.
* @member {string} payloadSchemaUri
* @memberof google.cloud.aiplatform.v1.Annotation
* @instance
*/
Annotation.prototype.payloadSchemaUri = "";
/**
* Annotation payload.
* @member {google.protobuf.IValue|null|undefined} payload
* @memberof google.cloud.aiplatform.v1.Annotation
* @instance
*/
Annotation.prototype.payload = null;
/**
* Annotation createTime.
* @member {google.protobuf.ITimestamp|null|undefined} createTime
* @memberof google.cloud.aiplatform.v1.Annotation
* @instance
*/
Annotation.prototype.createTime = null;
/**
* Annotation updateTime.
* @member {google.protobuf.ITimestamp|null|undefined} updateTime
* @memberof google.cloud.aiplatform.v1.Annotation
* @instance
*/
Annotation.prototype.updateTime = null;
/**
* Annotation etag.
* @member {string} etag
* @memberof google.cloud.aiplatform.v1.Annotation
* @instance
*/
Annotation.prototype.etag = "";
/**
* Annotation annotationSource.
* @member {google.cloud.aiplatform.v1.IUserActionReference|null|undefined} annotationSource
* @memberof google.cloud.aiplatform.v1.Annotation
* @instance
*/
Annotation.prototype.annotationSource = null;
/**
* Annotation labels.
* @member {Object.<string,string>} labels
* @memberof google.cloud.aiplatform.v1.Annotation
* @instance
*/
Annotation.prototype.labels = $util.emptyObject;
/**
* Creates a new Annotation instance using the specified properties.
* @function create
* @memberof google.cloud.aiplatform.v1.Annotation
* @static
* @param {google.cloud.aiplatform.v1.IAnnotation=} [properties] Properties to set
* @returns {google.cloud.aiplatform.v1.Annotation} Annotation instance
*/
Annotation.create = function create(properties) {
return new Annotation(properties);
};
/**
* Encodes the specified Annotation message. Does not implicitly {@link google.cloud.aiplatform.v1.Annotation.verify|verify} messages.
* @function encode
* @memberof google.cloud.aiplatform.v1.Annotation
* @static
* @param {google.cloud.aiplatform.v1.IAnnotation} message Annotation message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
Annotation.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.payloadSchemaUri != null && Object.hasOwnProperty.call(message, "payloadSchemaUri"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.payloadSchemaUri);
if (message.payload != null && Object.hasOwnProperty.call(message, "payload"))
$root.google.protobuf.Value.encode(message.payload, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime"))
$root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
if (message.annotationSource != null && Object.hasOwnProperty.call(message, "annotationSource"))
$root.google.cloud.aiplatform.v1.UserActionReference.encode(message.annotationSource, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
if (message.labels != null && Object.hasOwnProperty.call(message, "labels"))
for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i)
writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim();
if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime"))
$root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
if (message.etag != null && Object.hasOwnProperty.call(message, "etag"))
writer.uint32(/* id 8, wireType 2 =*/66).string(message.etag);
return writer;
};
/**
* Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.Annotation.verify|verify} messages.
* @function encodeDelimited
* @memberof google.cloud.aiplatform.v1.Annotation
* @static
* @param {google.cloud.aiplatform.v1.IAnnotation} message Annotation message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
Annotation.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes an Annotation message from the specified reader or buffer.
* @function decode
* @memberof google.cloud.aiplatform.v1.Annotation
* @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.Annotation} Annotation
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
Annotation.decode = function decode(reader, length, error) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.Annotation(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.name = reader.string();
break;
}
case 2: {
message.payloadSchemaUri = reader.string();
break;
}
case 3: {
message.payload = $root.google.protobuf.Value.decode(reader, reader.uint32());
break;
}
case 4: {
message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
break;
}
case 7: {
message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
break;
}
case 8: {
message.etag = reader.string();
break;
}
case 5: {
message.annotationSource = $root.google.cloud.aiplatform.v1.UserActionReference.decode(reader, reader.uint32());
break;
}
case 6: {
if (message.labels === $util.emptyObject)
message.labels = {};
var end2 = reader.uint32() + reader.pos;
key = "";
value = "";
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.string();
break;
case 2:
value = reader.string();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.labels[key] = value;
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes an Annotation message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof google.cloud.aiplatform.v1.Annotation
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {google.cloud.aiplatform.v1.Annotation} Annotation
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
Annotation.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies an Annotation message.
* @function verify
* @memberof google.cloud.aiplatform.v1.Annotation
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
Annotation.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.payloadSchemaUri != null && message.hasOwnProperty("payloadSchemaUri"))
if (!$util.isString(message.payloadSchemaUri))
return "payloadSchemaUri: string expected";
if (message.payload != null && message.hasOwnProperty("payload")) {
var error = $root.google.protobuf.Value.verify(message.payload);
if (error)
return "payload." + error;
}
if (message.createTime != null && message.hasOwnProperty("createTime")) {
var error = $root.google.protobuf.Timestamp.verify(message.createTime);
if (error)
return "createTime." + error;
}
if (message.updateTime != null && message.hasOwnProperty("updateTime")) {
var error = $root.google.protobuf.Timestamp.verify(message.updateTime);
if (error)
return "updateTime." + error;
}
if (message.etag != null && message.hasOwnProperty("etag"))
if (!$util.isString(message.etag))
return "etag: string expected";
if (message.annotationSource != null && message.hasOwnProperty("annotationSource")) {
var error = $root.google.cloud.aiplatform.v1.UserActionReference.verify(message.annotationSource);
if (error)
return "annotationSource." + error;
}
if (message.labels != null && message.hasOwnProperty("labels")) {
if (!$util.isObject(message.labels))
return "labels: object expected";
var key = Object.keys(message.labels);
for (var i = 0; i < key.length; ++i)
if (!$util.isString(message.labels[key[i]]))
return "labels: string{k:string} expected";
}
return null;
};
/**
* Creates an Annotation message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof google.cloud.aiplatform.v1.Annotation
* @static
* @param {Object.<string,*>} object Plain object
* @returns {google.cloud.aiplatform.v1.Annotation} Annotation
*/
Annotation.fromObject = function fromObject(object) {
if (object instanceof $root.google.cloud.aiplatform.v1.Annotation)
return object;
var message = new $root.google.cloud.aiplatform.v1.Annotation();
if (object.name != null)
message.name = String(object.name);
if (object.payloadSchemaUri != null)
message.payloadSchemaUri = String(object.payloadSchemaUri);
if (object.payload != null) {
if (typeof object.payload !== "object")
throw TypeError(".google.cloud.aiplatform.v1.Annotation.payload: object expected");
message.payload = $root.google.protobuf.Value.fromObject(object.payload);
}
if (object.createTime != null) {
if (typeof object.createTime !== "object")
throw TypeError(".google.cloud.aiplatform.v1.Annotation.createTime: object expected");
message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime);
}
if (object.updateTime != null) {
if (typeof object.updateTime !== "object")
throw TypeError(".google.cloud.aiplatform.v1.Annotation.updateTime: object expected");
message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime);
}
if (object.etag != null)
message.etag = String(object.etag);
if (object.annotationSource != null) {
if (typeof object.annotationSource !== "object")
throw TypeError(".google.cloud.aiplatform.v1.Annotation.annotationSource: object expected");
message.annotationSource = $root.google.cloud.aiplatform.v1.UserActionReference.fromObject(object.annotationSource);
}
if (object.labels) {
if (typeof object.labels !== "object")
throw TypeError(".google.cloud.aiplatform.v1.Annotation.labels: object expected");
message.labels = {};
for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i)
message.labels[keys[i]] = String(object.labels[keys[i]]);
}
return message;
};
/**
* Creates a plain object from an Annotation message. Also converts values to other types if specified.
* @function toObject
* @memberof google.cloud.aiplatform.v1.Annotation
* @static
* @param {google.cloud.aiplatform.v1.Annotation} message Annotation
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
Annotation.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults)
object.labels = {};
if (options.defaults) {
object.name = "";
object.payloadSchemaUri = "";
object.payload = null;
object.createTime = null;
object.annotationSource = null;
object.updateTime = null;
object.etag = "";
}
if (message.name != null && message.hasOwnProperty("name"))
object.name = message.name;
if (message.payloadSchemaUri != null && message.hasOwnProperty("payloadSchemaUri"))
object.payloadSchemaUri = message.payloadSchemaUri;
if (message.payload != null && message.hasOwnProperty("payload"))
object.payload = $root.google.protobuf.Value.toObject(message.payload, options);
if (message.createTime != null && message.hasOwnProperty("createTime"))
object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options);
if (message.annotationSource != null && message.hasOwnProperty("annotationSource"))
object.annotationSource = $root.google.cloud.aiplatform.v1.UserActionReference.toObject(message.annotationSource, options);
var keys2;
if (message.labels && (keys2 = Object.keys(message.labels)).length) {
object.labels = {};
for (var j = 0; j < keys2.length; ++j)
object.labels[keys2[j]] = message.labels[keys2[j]];
}
if (message.updateTime != null && message.hasOwnProperty("updateTime"))
object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options);
if (message.etag != null && message.hasOwnProperty("etag"))
object.etag = message.etag;
return object;
};
/**
* Converts this Annotation to JSON.
* @function toJSON
* @memberof google.cloud.aiplatform.v1.Annotation
* @instance
* @returns {Object.<string,*>} JSON object
*/
Annotation.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for Annotation
* @function getTypeUrl
* @memberof google.cloud.aiplatform.v1.Annotation
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/google.cloud.aiplatform.v1.Annotation";
};
return Annotation;
})();
v1.UserActionReference = (function() {
/**
* Properties of a UserActionReference.
* @memberof google.cloud.aiplatform.v1
* @interface IUserActionReference
* @property {string|null} [operation] UserActionReference operation
* @property {string|null} [dataLabelingJob] UserActionReference dataLabelingJob
* @property {string|null} [method] UserActionReference method
*/
/**
* Constructs a new UserActionReference.
* @memberof google.cloud.aiplatform.v1
* @classdesc Represents a UserActionReference.
* @implements IUserActionReference
* @constructor
* @param {google.cloud.aiplatform.v1.IUserActionReference=} [properties] Properties to set
*/
function UserActionReference(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]];
}
/**
* UserActionReference operation.
* @member {string|null|undefined} operation
* @memberof google.cloud.aiplatform.v1.UserActionReference
* @instance
*/
UserActionReference.prototype.operation = null;
/**
* UserActionReference dataLabelingJob.
* @member {string|null|undefined} dataLabelingJob
* @memberof google.cloud.aiplatform.v1.UserActionReference
* @instance
*/
UserActionReference.prototype.dataLabelingJob = null;
/**
* UserActionReference method.
* @member {string} method
* @memberof google.cloud.aiplatform.v1.UserActionReference
* @instance
*/
UserActionReference.prototype.method = "";
// OneOf field names bound to virtual getters and setters
var $oneOfFields;
/**
* UserActionReference reference.
* @member {"operation"|"dataLabelingJob"|undefined} reference
* @memberof google.cloud.aiplatform.v1.UserActionReference
* @instance
*/
Object.defineProperty(UserActionReference.prototype, "reference", {
get: $util.oneOfGetter($oneOfFields = ["operation", "dataLabelingJob"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* Creates a new UserActionReference instance using the specified properties.
* @function create
* @memberof google.cloud.aiplatform.v1.UserActionReference
* @static
* @param {google.cloud.aiplatform.v1.IUserActionReference=} [properties] Properties to set
* @returns {google.cloud.aiplatform.v1.UserActionReference} UserActionReference instance
*/
UserActionReference.create = function create(properties) {
return new UserActionReference(properties);
};
/**
* Encodes the specified UserActionReference message. Does not implicitly {@link google.cloud.aiplatform.v1.UserActionReference.verify|verify} messages.
* @function encode
* @memberof google.cloud.aiplatform.v1.UserActionReference
* @static
* @param {google.cloud.aiplatform.v1.IUserActionReference} message UserActionReference message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
UserActionReference.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.operation != null && Object.hasOwnProperty.call(message, "operation"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.operation);
if (message.dataLabelingJob != null && Object.hasOwnProperty.call(message, "dataLabelingJob"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.dataLabelingJob);
if (message.method != null && Object.hasOwnProperty.call(message, "method"))
writer.uint32(/* id 3, wireType 2 =*/26).string(message.method);
return writer;
};
/**
* Encodes the specified UserActionReference message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UserActionReference.verify|verify} messages.
* @function encodeDelimited
* @memberof google.cloud.aiplatform.v1.UserActionReference
* @static
* @param {google.cloud.aiplatform.v1.IUserActionReference} message UserActionReference message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
UserActionReference.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a UserActionReference message from the specified reader or buffer.
* @function decode
* @memberof google.cloud.aiplatform.v1.UserActionReference
* @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.UserActionReference} UserActionReference
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
UserActionReference.decode = function decode(reader, length, error) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.UserActionReference();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.operation = reader.string();
break;
}
case 2: {
message.dataLabelingJob = reader.string();
break;
}
case 3: {
message.method = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a UserActionReference message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof google.cloud.aiplatform.v1.UserActionReference
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {google.cloud.aiplatform.v1.UserActionReference} UserActionReference
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
UserActionReference.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a UserActionReference message.
* @function verify
* @memberof google.cloud.aiplatform.v1.UserActionReference
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
UserActionReference.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
var properties = {};
if (message.operation != null && message.hasOwnProperty("operation")) {
properties.reference = 1;
if (!$util.isString(message.operation))
return "operation: string expected";
}
if (message.dataLabelingJob != null && message.hasOwnProperty("dataLabelingJob")) {
if (properties.reference === 1)
return "reference: multiple values";
properties.reference = 1;
if (!$util.isString(message.dataLabelingJob))
return "dataLabelingJob: string expected";
}
if (message.method != null && message.hasOwnProperty("method"))
if (!$util.isString(message.method))
return "method: string expected";
return null;
};
/**
* Creates a UserActionReference message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof google.cloud.aiplatform.v1.UserActionReference
* @static
* @param {Object.<string,*>} object Plain object
* @returns {google.cloud.aiplatform.v1.UserActionReference} UserActionReference
*/
UserActionReference.fromObject = function fromObject(object) {
if (object instanceof $root.google.cloud.aiplatform.v1.UserActionReference)
return object;
var message = new $root.google.cloud.aiplatform.v1.UserActionReference();
if (object.operation != null)
message.operation = String(object.operation);
if (object.dataLabelingJob != null)
message.dataLabelingJob = String(object.dataLabelingJob);
if (object.method != null)
message.method = String(object.method);
return message;
};
/**
* Creates a plain object from a UserActionReference message. Also converts values to other types if specified.
* @function toObject
* @memberof google.cloud.aiplatform.v1.UserActionReference
* @static
* @param {google.cloud.aiplatform.v1.UserActionReference} message UserActionReference
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
UserActionReference.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.method = "";
if (message.operation != null && message.hasOwnProperty("operation")) {
object.operation = message.operation;
if (options.oneofs)
object.reference = "operation";
}
if (message.dataLabelingJob != null && message.hasOwnProperty("dataLabelingJob")) {
object.dataLabelingJob = message.dataLabelingJob;
if (options.oneofs)
object.reference = "dataLabelingJob";
}
if (message.method != null && message.hasOwnProperty("method"))
object.method = message.method;
return object;
};
/**
* Converts this UserActionReference to JSON.
* @function toJSON
* @memberof google.cloud.aiplatform.v1.UserActionReference
* @instance
* @returns {Object.<string,*>} JSON object
*/
UserActionReference.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for UserActionReference
* @function getTypeUrl
* @memberof google.cloud.aiplatform.v1.UserActionReference
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
UserActionReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/google.cloud.aiplatform.v1.UserActionReference";
};
return UserActionReference;
})();
v1.AnnotationSpec = (function() {
/**
* Properties of an AnnotationSpec.
* @memberof google.cloud.aiplatform.v1
* @interface IAnnotationSpec
* @property {string|null} [name] AnnotationSpec name
* @property {string|null} [displayName] AnnotationSpec displayName
* @property {google.protobuf.ITimestamp|null} [createTime] AnnotationSpec createTime
* @property {google.protobuf.ITimestamp|null} [updateTime] AnnotationSpec updateTime
* @property {string|null} [etag] AnnotationSpec etag
*/
/**
* Constructs a new AnnotationSpec.
* @memberof google.cloud.aiplatform.v1
* @classdesc Represents an AnnotationSpec.
* @implements IAnnotationSpec
* @constructor