diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model.proto index 26c1d3b7f36..f34fad6ed28 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model.proto @@ -328,6 +328,10 @@ message Model { // Customer-managed encryption key spec for a Model. If set, this // Model and all sub-resources of this Model will be secured by this key. EncryptionSpec encryption_spec = 24; + + // Output only. Source of a model. It can either be automl training pipeline, custom + // training pipeline, BigQuery ML, or existing Vertex AI Model. + ModelSourceInfo model_source_info = 38 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Contains the schemata used in Model's predictions and explanations via @@ -590,3 +594,24 @@ message Port { // Must be a valid port number, between 1 and 65535 inclusive. int32 container_port = 3; } + +// Detail description of the source information of the model. +message ModelSourceInfo { + // Source of the model. + enum ModelSourceType { + // Should not be used. + MODEL_SOURCE_TYPE_UNSPECIFIED = 0; + + // The Model is uploaded by automl training pipeline. + AUTOML = 1; + + // The Model is uploaded by user or custom training pipeline. + CUSTOM = 2; + + // The Model is registered and sync'ed from BigQuery ML. + BQML = 3; + } + + // Type of the model source. + ModelSourceType source_type = 1; +} diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model.proto index ba9b2cd5a36..9e408aebda4 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model.proto @@ -328,6 +328,10 @@ message Model { // Customer-managed encryption key spec for a Model. If set, this // Model and all sub-resources of this Model will be secured by this key. EncryptionSpec encryption_spec = 24; + + // Output only. Source of a model. It can either be automl training pipeline, custom + // training pipeline, BigQuery ML, or existing Vertex AI Model. + ModelSourceInfo model_source_info = 38 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Contains the schemata used in Model's predictions and explanations via @@ -590,3 +594,24 @@ message Port { // Must be a valid port number, between 1 and 65535 inclusive. int32 container_port = 3; } + +// Detail description of the source information of the model. +message ModelSourceInfo { + // Source of the model. + enum ModelSourceType { + // Should not be used. + MODEL_SOURCE_TYPE_UNSPECIFIED = 0; + + // The Model is uploaded by automl training pipeline. + AUTOML = 1; + + // The Model is uploaded by user or custom training pipeline. + CUSTOM = 2; + + // The Model is registered and sync'ed from BigQuery ML. + BQML = 3; + } + + // Type of the model source. + ModelSourceType source_type = 1; +} diff --git a/packages/google-cloud-aiplatform/protos/protos.d.ts b/packages/google-cloud-aiplatform/protos/protos.d.ts index 0d5a2298b24..d853d143681 100644 --- a/packages/google-cloud-aiplatform/protos/protos.d.ts +++ b/packages/google-cloud-aiplatform/protos/protos.d.ts @@ -6012,6 +6012,9 @@ export namespace google { /** Model encryptionSpec */ encryptionSpec?: (google.cloud.aiplatform.v1.IEncryptionSpec|null); + + /** Model modelSourceInfo */ + modelSourceInfo?: (google.cloud.aiplatform.v1.IModelSourceInfo|null); } /** Represents a Model. */ @@ -6098,6 +6101,9 @@ export namespace google { /** Model encryptionSpec. */ public encryptionSpec?: (google.cloud.aiplatform.v1.IEncryptionSpec|null); + /** Model modelSourceInfo. */ + public modelSourceInfo?: (google.cloud.aiplatform.v1.IModelSourceInfo|null); + /** * Creates a new Model instance using the specified properties. * @param [properties] Properties to set @@ -6639,6 +6645,114 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a ModelSourceInfo. */ + interface IModelSourceInfo { + + /** ModelSourceInfo sourceType */ + sourceType?: (google.cloud.aiplatform.v1.ModelSourceInfo.ModelSourceType|keyof typeof google.cloud.aiplatform.v1.ModelSourceInfo.ModelSourceType|null); + } + + /** Represents a ModelSourceInfo. */ + class ModelSourceInfo implements IModelSourceInfo { + + /** + * Constructs a new ModelSourceInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IModelSourceInfo); + + /** ModelSourceInfo sourceType. */ + public sourceType: (google.cloud.aiplatform.v1.ModelSourceInfo.ModelSourceType|keyof typeof google.cloud.aiplatform.v1.ModelSourceInfo.ModelSourceType); + + /** + * Creates a new ModelSourceInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ModelSourceInfo instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IModelSourceInfo): google.cloud.aiplatform.v1.ModelSourceInfo; + + /** + * Encodes the specified ModelSourceInfo message. Does not implicitly {@link google.cloud.aiplatform.v1.ModelSourceInfo.verify|verify} messages. + * @param message ModelSourceInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IModelSourceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModelSourceInfo message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ModelSourceInfo.verify|verify} messages. + * @param message ModelSourceInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IModelSourceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModelSourceInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModelSourceInfo + * @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.ModelSourceInfo; + + /** + * Decodes a ModelSourceInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModelSourceInfo + * @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.ModelSourceInfo; + + /** + * Verifies a ModelSourceInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModelSourceInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModelSourceInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ModelSourceInfo; + + /** + * Creates a plain object from a ModelSourceInfo message. Also converts values to other types if specified. + * @param message ModelSourceInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.ModelSourceInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModelSourceInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModelSourceInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ModelSourceInfo { + + /** ModelSourceType enum. */ + enum ModelSourceType { + MODEL_SOURCE_TYPE_UNSPECIFIED = 0, + AUTOML = 1, + CUSTOM = 2, + BQML = 3 + } + } + /** Properties of a DeployedModelRef. */ interface IDeployedModelRef { @@ -77325,6 +77439,9 @@ export namespace google { /** Model encryptionSpec */ encryptionSpec?: (google.cloud.aiplatform.v1beta1.IEncryptionSpec|null); + + /** Model modelSourceInfo */ + modelSourceInfo?: (google.cloud.aiplatform.v1beta1.IModelSourceInfo|null); } /** Represents a Model. */ @@ -77411,6 +77528,9 @@ export namespace google { /** Model encryptionSpec. */ public encryptionSpec?: (google.cloud.aiplatform.v1beta1.IEncryptionSpec|null); + /** Model modelSourceInfo. */ + public modelSourceInfo?: (google.cloud.aiplatform.v1beta1.IModelSourceInfo|null); + /** * Creates a new Model instance using the specified properties. * @param [properties] Properties to set @@ -77952,6 +78072,114 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a ModelSourceInfo. */ + interface IModelSourceInfo { + + /** ModelSourceInfo sourceType */ + sourceType?: (google.cloud.aiplatform.v1beta1.ModelSourceInfo.ModelSourceType|keyof typeof google.cloud.aiplatform.v1beta1.ModelSourceInfo.ModelSourceType|null); + } + + /** Represents a ModelSourceInfo. */ + class ModelSourceInfo implements IModelSourceInfo { + + /** + * Constructs a new ModelSourceInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IModelSourceInfo); + + /** ModelSourceInfo sourceType. */ + public sourceType: (google.cloud.aiplatform.v1beta1.ModelSourceInfo.ModelSourceType|keyof typeof google.cloud.aiplatform.v1beta1.ModelSourceInfo.ModelSourceType); + + /** + * Creates a new ModelSourceInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ModelSourceInfo instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IModelSourceInfo): google.cloud.aiplatform.v1beta1.ModelSourceInfo; + + /** + * Encodes the specified ModelSourceInfo message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ModelSourceInfo.verify|verify} messages. + * @param message ModelSourceInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IModelSourceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModelSourceInfo message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ModelSourceInfo.verify|verify} messages. + * @param message ModelSourceInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IModelSourceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModelSourceInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModelSourceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1beta1.ModelSourceInfo; + + /** + * Decodes a ModelSourceInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModelSourceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1beta1.ModelSourceInfo; + + /** + * Verifies a ModelSourceInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModelSourceInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModelSourceInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.ModelSourceInfo; + + /** + * Creates a plain object from a ModelSourceInfo message. Also converts values to other types if specified. + * @param message ModelSourceInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.ModelSourceInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModelSourceInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModelSourceInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ModelSourceInfo { + + /** ModelSourceType enum. */ + enum ModelSourceType { + MODEL_SOURCE_TYPE_UNSPECIFIED = 0, + AUTOML = 1, + CUSTOM = 2, + BQML = 3 + } + } + /** Properties of a DeployedModelRef. */ interface IDeployedModelRef { diff --git a/packages/google-cloud-aiplatform/protos/protos.js b/packages/google-cloud-aiplatform/protos/protos.js index 9d61cd3a75d..348b31f25c5 100644 --- a/packages/google-cloud-aiplatform/protos/protos.js +++ b/packages/google-cloud-aiplatform/protos/protos.js @@ -15029,6 +15029,7 @@ * @property {string|null} [etag] Model etag * @property {Object.|null} [labels] Model labels * @property {google.cloud.aiplatform.v1.IEncryptionSpec|null} [encryptionSpec] Model encryptionSpec + * @property {google.cloud.aiplatform.v1.IModelSourceInfo|null} [modelSourceInfo] Model modelSourceInfo */ /** @@ -15253,6 +15254,14 @@ */ Model.prototype.encryptionSpec = null; + /** + * Model modelSourceInfo. + * @member {google.cloud.aiplatform.v1.IModelSourceInfo|null|undefined} modelSourceInfo + * @memberof google.cloud.aiplatform.v1.Model + * @instance + */ + Model.prototype.modelSourceInfo = null; + /** * Creates a new Model instance using the specified properties. * @function create @@ -15337,6 +15346,8 @@ $root.google.protobuf.Timestamp.encode(message.versionCreateTime, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); if (message.versionUpdateTime != null && Object.hasOwnProperty.call(message, "versionUpdateTime")) $root.google.protobuf.Timestamp.encode(message.versionUpdateTime, writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); + if (message.modelSourceInfo != null && Object.hasOwnProperty.call(message, "modelSourceInfo")) + $root.google.cloud.aiplatform.v1.ModelSourceInfo.encode(message.modelSourceInfo, writer.uint32(/* id 38, wireType 2 =*/306).fork()).ldelim(); return writer; }; @@ -15507,6 +15518,10 @@ message.encryptionSpec = $root.google.cloud.aiplatform.v1.EncryptionSpec.decode(reader, reader.uint32()); break; } + case 38: { + message.modelSourceInfo = $root.google.cloud.aiplatform.v1.ModelSourceInfo.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -15675,6 +15690,11 @@ if (error) return "encryptionSpec." + error; } + if (message.modelSourceInfo != null && message.hasOwnProperty("modelSourceInfo")) { + var error = $root.google.cloud.aiplatform.v1.ModelSourceInfo.verify(message.modelSourceInfo); + if (error) + return "modelSourceInfo." + error; + } return null; }; @@ -15826,6 +15846,11 @@ throw TypeError(".google.cloud.aiplatform.v1.Model.encryptionSpec: object expected"); message.encryptionSpec = $root.google.cloud.aiplatform.v1.EncryptionSpec.fromObject(object.encryptionSpec); } + if (object.modelSourceInfo != null) { + if (typeof object.modelSourceInfo !== "object") + throw TypeError(".google.cloud.aiplatform.v1.Model.modelSourceInfo: object expected"); + message.modelSourceInfo = $root.google.cloud.aiplatform.v1.ModelSourceInfo.fromObject(object.modelSourceInfo); + } return message; }; @@ -15871,6 +15896,7 @@ object.versionDescription = ""; object.versionCreateTime = null; object.versionUpdateTime = null; + object.modelSourceInfo = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -15944,6 +15970,8 @@ object.versionCreateTime = $root.google.protobuf.Timestamp.toObject(message.versionCreateTime, options); if (message.versionUpdateTime != null && message.hasOwnProperty("versionUpdateTime")) object.versionUpdateTime = $root.google.protobuf.Timestamp.toObject(message.versionUpdateTime, options); + if (message.modelSourceInfo != null && message.hasOwnProperty("modelSourceInfo")) + object.modelSourceInfo = $root.google.cloud.aiplatform.v1.ModelSourceInfo.toObject(message.modelSourceInfo, options); return object; }; @@ -17152,6 +17180,250 @@ return Port; })(); + v1.ModelSourceInfo = (function() { + + /** + * Properties of a ModelSourceInfo. + * @memberof google.cloud.aiplatform.v1 + * @interface IModelSourceInfo + * @property {google.cloud.aiplatform.v1.ModelSourceInfo.ModelSourceType|null} [sourceType] ModelSourceInfo sourceType + */ + + /** + * Constructs a new ModelSourceInfo. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a ModelSourceInfo. + * @implements IModelSourceInfo + * @constructor + * @param {google.cloud.aiplatform.v1.IModelSourceInfo=} [properties] Properties to set + */ + function ModelSourceInfo(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]]; + } + + /** + * ModelSourceInfo sourceType. + * @member {google.cloud.aiplatform.v1.ModelSourceInfo.ModelSourceType} sourceType + * @memberof google.cloud.aiplatform.v1.ModelSourceInfo + * @instance + */ + ModelSourceInfo.prototype.sourceType = 0; + + /** + * Creates a new ModelSourceInfo instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ModelSourceInfo + * @static + * @param {google.cloud.aiplatform.v1.IModelSourceInfo=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ModelSourceInfo} ModelSourceInfo instance + */ + ModelSourceInfo.create = function create(properties) { + return new ModelSourceInfo(properties); + }; + + /** + * Encodes the specified ModelSourceInfo message. Does not implicitly {@link google.cloud.aiplatform.v1.ModelSourceInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ModelSourceInfo + * @static + * @param {google.cloud.aiplatform.v1.IModelSourceInfo} message ModelSourceInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelSourceInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sourceType); + return writer; + }; + + /** + * Encodes the specified ModelSourceInfo message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ModelSourceInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ModelSourceInfo + * @static + * @param {google.cloud.aiplatform.v1.IModelSourceInfo} message ModelSourceInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelSourceInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModelSourceInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.ModelSourceInfo + * @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.ModelSourceInfo} ModelSourceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelSourceInfo.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.ModelSourceInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sourceType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModelSourceInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.ModelSourceInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.ModelSourceInfo} ModelSourceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelSourceInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModelSourceInfo message. + * @function verify + * @memberof google.cloud.aiplatform.v1.ModelSourceInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModelSourceInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + switch (message.sourceType) { + default: + return "sourceType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a ModelSourceInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ModelSourceInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ModelSourceInfo} ModelSourceInfo + */ + ModelSourceInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ModelSourceInfo) + return object; + var message = new $root.google.cloud.aiplatform.v1.ModelSourceInfo(); + switch (object.sourceType) { + case "MODEL_SOURCE_TYPE_UNSPECIFIED": + case 0: + message.sourceType = 0; + break; + case "AUTOML": + case 1: + message.sourceType = 1; + break; + case "CUSTOM": + case 2: + message.sourceType = 2; + break; + case "BQML": + case 3: + message.sourceType = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a ModelSourceInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ModelSourceInfo + * @static + * @param {google.cloud.aiplatform.v1.ModelSourceInfo} message ModelSourceInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModelSourceInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.sourceType = options.enums === String ? "MODEL_SOURCE_TYPE_UNSPECIFIED" : 0; + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + object.sourceType = options.enums === String ? $root.google.cloud.aiplatform.v1.ModelSourceInfo.ModelSourceType[message.sourceType] : message.sourceType; + return object; + }; + + /** + * Converts this ModelSourceInfo to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.ModelSourceInfo + * @instance + * @returns {Object.} JSON object + */ + ModelSourceInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModelSourceInfo + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.ModelSourceInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModelSourceInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ModelSourceInfo"; + }; + + /** + * ModelSourceType enum. + * @name google.cloud.aiplatform.v1.ModelSourceInfo.ModelSourceType + * @enum {number} + * @property {number} MODEL_SOURCE_TYPE_UNSPECIFIED=0 MODEL_SOURCE_TYPE_UNSPECIFIED value + * @property {number} AUTOML=1 AUTOML value + * @property {number} CUSTOM=2 CUSTOM value + * @property {number} BQML=3 BQML value + */ + ModelSourceInfo.ModelSourceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODEL_SOURCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUTOML"] = 1; + values[valuesById[2] = "CUSTOM"] = 2; + values[valuesById[3] = "BQML"] = 3; + return values; + })(); + + return ModelSourceInfo; + })(); + v1.DeployedModelRef = (function() { /** @@ -186667,6 +186939,7 @@ * @property {string|null} [etag] Model etag * @property {Object.|null} [labels] Model labels * @property {google.cloud.aiplatform.v1beta1.IEncryptionSpec|null} [encryptionSpec] Model encryptionSpec + * @property {google.cloud.aiplatform.v1beta1.IModelSourceInfo|null} [modelSourceInfo] Model modelSourceInfo */ /** @@ -186891,6 +187164,14 @@ */ Model.prototype.encryptionSpec = null; + /** + * Model modelSourceInfo. + * @member {google.cloud.aiplatform.v1beta1.IModelSourceInfo|null|undefined} modelSourceInfo + * @memberof google.cloud.aiplatform.v1beta1.Model + * @instance + */ + Model.prototype.modelSourceInfo = null; + /** * Creates a new Model instance using the specified properties. * @function create @@ -186975,6 +187256,8 @@ $root.google.protobuf.Timestamp.encode(message.versionCreateTime, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); if (message.versionUpdateTime != null && Object.hasOwnProperty.call(message, "versionUpdateTime")) $root.google.protobuf.Timestamp.encode(message.versionUpdateTime, writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); + if (message.modelSourceInfo != null && Object.hasOwnProperty.call(message, "modelSourceInfo")) + $root.google.cloud.aiplatform.v1beta1.ModelSourceInfo.encode(message.modelSourceInfo, writer.uint32(/* id 38, wireType 2 =*/306).fork()).ldelim(); return writer; }; @@ -187145,6 +187428,10 @@ message.encryptionSpec = $root.google.cloud.aiplatform.v1beta1.EncryptionSpec.decode(reader, reader.uint32()); break; } + case 38: { + message.modelSourceInfo = $root.google.cloud.aiplatform.v1beta1.ModelSourceInfo.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -187313,6 +187600,11 @@ if (error) return "encryptionSpec." + error; } + if (message.modelSourceInfo != null && message.hasOwnProperty("modelSourceInfo")) { + var error = $root.google.cloud.aiplatform.v1beta1.ModelSourceInfo.verify(message.modelSourceInfo); + if (error) + return "modelSourceInfo." + error; + } return null; }; @@ -187464,6 +187756,11 @@ throw TypeError(".google.cloud.aiplatform.v1beta1.Model.encryptionSpec: object expected"); message.encryptionSpec = $root.google.cloud.aiplatform.v1beta1.EncryptionSpec.fromObject(object.encryptionSpec); } + if (object.modelSourceInfo != null) { + if (typeof object.modelSourceInfo !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.Model.modelSourceInfo: object expected"); + message.modelSourceInfo = $root.google.cloud.aiplatform.v1beta1.ModelSourceInfo.fromObject(object.modelSourceInfo); + } return message; }; @@ -187509,6 +187806,7 @@ object.versionDescription = ""; object.versionCreateTime = null; object.versionUpdateTime = null; + object.modelSourceInfo = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -187582,6 +187880,8 @@ object.versionCreateTime = $root.google.protobuf.Timestamp.toObject(message.versionCreateTime, options); if (message.versionUpdateTime != null && message.hasOwnProperty("versionUpdateTime")) object.versionUpdateTime = $root.google.protobuf.Timestamp.toObject(message.versionUpdateTime, options); + if (message.modelSourceInfo != null && message.hasOwnProperty("modelSourceInfo")) + object.modelSourceInfo = $root.google.cloud.aiplatform.v1beta1.ModelSourceInfo.toObject(message.modelSourceInfo, options); return object; }; @@ -188790,6 +189090,250 @@ return Port; })(); + v1beta1.ModelSourceInfo = (function() { + + /** + * Properties of a ModelSourceInfo. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IModelSourceInfo + * @property {google.cloud.aiplatform.v1beta1.ModelSourceInfo.ModelSourceType|null} [sourceType] ModelSourceInfo sourceType + */ + + /** + * Constructs a new ModelSourceInfo. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a ModelSourceInfo. + * @implements IModelSourceInfo + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IModelSourceInfo=} [properties] Properties to set + */ + function ModelSourceInfo(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]]; + } + + /** + * ModelSourceInfo sourceType. + * @member {google.cloud.aiplatform.v1beta1.ModelSourceInfo.ModelSourceType} sourceType + * @memberof google.cloud.aiplatform.v1beta1.ModelSourceInfo + * @instance + */ + ModelSourceInfo.prototype.sourceType = 0; + + /** + * Creates a new ModelSourceInfo instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.ModelSourceInfo + * @static + * @param {google.cloud.aiplatform.v1beta1.IModelSourceInfo=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.ModelSourceInfo} ModelSourceInfo instance + */ + ModelSourceInfo.create = function create(properties) { + return new ModelSourceInfo(properties); + }; + + /** + * Encodes the specified ModelSourceInfo message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ModelSourceInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.ModelSourceInfo + * @static + * @param {google.cloud.aiplatform.v1beta1.IModelSourceInfo} message ModelSourceInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelSourceInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sourceType); + return writer; + }; + + /** + * Encodes the specified ModelSourceInfo message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ModelSourceInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.ModelSourceInfo + * @static + * @param {google.cloud.aiplatform.v1beta1.IModelSourceInfo} message ModelSourceInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelSourceInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModelSourceInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.ModelSourceInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1beta1.ModelSourceInfo} ModelSourceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelSourceInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1beta1.ModelSourceInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sourceType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModelSourceInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.ModelSourceInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.ModelSourceInfo} ModelSourceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelSourceInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModelSourceInfo message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.ModelSourceInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModelSourceInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + switch (message.sourceType) { + default: + return "sourceType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a ModelSourceInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.ModelSourceInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.ModelSourceInfo} ModelSourceInfo + */ + ModelSourceInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.ModelSourceInfo) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.ModelSourceInfo(); + switch (object.sourceType) { + case "MODEL_SOURCE_TYPE_UNSPECIFIED": + case 0: + message.sourceType = 0; + break; + case "AUTOML": + case 1: + message.sourceType = 1; + break; + case "CUSTOM": + case 2: + message.sourceType = 2; + break; + case "BQML": + case 3: + message.sourceType = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a ModelSourceInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.ModelSourceInfo + * @static + * @param {google.cloud.aiplatform.v1beta1.ModelSourceInfo} message ModelSourceInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModelSourceInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.sourceType = options.enums === String ? "MODEL_SOURCE_TYPE_UNSPECIFIED" : 0; + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + object.sourceType = options.enums === String ? $root.google.cloud.aiplatform.v1beta1.ModelSourceInfo.ModelSourceType[message.sourceType] : message.sourceType; + return object; + }; + + /** + * Converts this ModelSourceInfo to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.ModelSourceInfo + * @instance + * @returns {Object.} JSON object + */ + ModelSourceInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModelSourceInfo + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.ModelSourceInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModelSourceInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.ModelSourceInfo"; + }; + + /** + * ModelSourceType enum. + * @name google.cloud.aiplatform.v1beta1.ModelSourceInfo.ModelSourceType + * @enum {number} + * @property {number} MODEL_SOURCE_TYPE_UNSPECIFIED=0 MODEL_SOURCE_TYPE_UNSPECIFIED value + * @property {number} AUTOML=1 AUTOML value + * @property {number} CUSTOM=2 CUSTOM value + * @property {number} BQML=3 BQML value + */ + ModelSourceInfo.ModelSourceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODEL_SOURCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUTOML"] = 1; + values[valuesById[2] = "CUSTOM"] = 2; + values[valuesById[3] = "BQML"] = 3; + return values; + })(); + + return ModelSourceInfo; + })(); + v1beta1.DeployedModelRef = (function() { /** diff --git a/packages/google-cloud-aiplatform/protos/protos.json b/packages/google-cloud-aiplatform/protos/protos.json index 06d32b860ee..089aa119715 100644 --- a/packages/google-cloud-aiplatform/protos/protos.json +++ b/packages/google-cloud-aiplatform/protos/protos.json @@ -1552,6 +1552,13 @@ "encryptionSpec": { "type": "EncryptionSpec", "id": 24 + }, + "modelSourceInfo": { + "type": "ModelSourceInfo", + "id": 38, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { @@ -1683,6 +1690,24 @@ } } }, + "ModelSourceInfo": { + "fields": { + "sourceType": { + "type": "ModelSourceType", + "id": 1 + } + }, + "nested": { + "ModelSourceType": { + "values": { + "MODEL_SOURCE_TYPE_UNSPECIFIED": 0, + "AUTOML": 1, + "CUSTOM": 2, + "BQML": 3 + } + } + } + }, "DeployedModelRef": { "fields": { "endpoint": { @@ -19630,6 +19655,13 @@ "encryptionSpec": { "type": "EncryptionSpec", "id": 24 + }, + "modelSourceInfo": { + "type": "ModelSourceInfo", + "id": 38, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { @@ -19761,6 +19793,24 @@ } } }, + "ModelSourceInfo": { + "fields": { + "sourceType": { + "type": "ModelSourceType", + "id": 1 + } + }, + "nested": { + "ModelSourceType": { + "values": { + "MODEL_SOURCE_TYPE_UNSPECIFIED": 0, + "AUTOML": 1, + "CUSTOM": 2, + "BQML": 3 + } + } + } + }, "DeployedModelRef": { "fields": { "endpoint": {