From c56a74d070a826e35b3582060c7ff5aa51a72f17 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 11 Apr 2023 10:38:14 -0400 Subject: [PATCH] feat: add notification_channels in aiplatform v1beta1 model_monitoring.proto (#4160) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add notification_channels in aiplatform v1beta1 model_monitoring.proto PiperOrigin-RevId: 523180073 Source-Link: https://github.com/googleapis/googleapis/commit/a793ce31e6a71027fbad8a8157b22a4b488ea77c Source-Link: https://github.com/googleapis/googleapis-gen/commit/c904f381ad20d373cb91bf687b932f6f48a8f0b9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFpcGxhdGZvcm0vLk93bEJvdC55YW1sIiwiaCI6ImM5MDRmMzgxYWQyMGQzNzNjYjkxYmY2ODdiOTMyZjZmNDhhOGYwYjkifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot Co-authored-by: danieljbruce --- .../aiplatform/v1beta1/model_monitoring.proto | 11 +++++ .../protos/protos.d.ts | 6 +++ .../google-cloud-aiplatform/protos/protos.js | 40 +++++++++++++++++++ .../protos/protos.json | 8 ++++ 4 files changed, 65 insertions(+) diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto index 0eb605eee9a..372c27ffa8e 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto @@ -26,6 +26,10 @@ option java_outer_classname = "ModelMonitoringProto"; option java_package = "com.google.cloud.aiplatform.v1beta1"; option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; +option (google.api.resource_definition) = { + type: "monitoring.googleapis.com/NotificationChannel" + pattern: "projects/{project}/notificationChannels/{notification_channel}" +}; // The model monitoring configuration used for Batch Prediction Job. message ModelMonitoringConfig { @@ -208,6 +212,13 @@ message ModelMonitoringAlertConfig { // This can be further sinked to Pub/Sub or any other services supported // by Cloud Logging. bool enable_logging = 2; + + // Resource names of the NotificationChannels to send alert. + // Must be of the format + // `projects//notificationChannels/` + repeated string notification_channels = 3 [(google.api.resource_reference) = { + type: "monitoring.googleapis.com/NotificationChannel" + }]; } // The config for feature monitoring threshold. diff --git a/packages/google-cloud-aiplatform/protos/protos.d.ts b/packages/google-cloud-aiplatform/protos/protos.d.ts index 7d97c2acc5a..40a7a123457 100644 --- a/packages/google-cloud-aiplatform/protos/protos.d.ts +++ b/packages/google-cloud-aiplatform/protos/protos.d.ts @@ -83444,6 +83444,9 @@ export namespace google { /** ModelMonitoringAlertConfig enableLogging */ enableLogging?: (boolean|null); + + /** ModelMonitoringAlertConfig notificationChannels */ + notificationChannels?: (string[]|null); } /** Represents a ModelMonitoringAlertConfig. */ @@ -83461,6 +83464,9 @@ export namespace google { /** ModelMonitoringAlertConfig enableLogging. */ public enableLogging: boolean; + /** ModelMonitoringAlertConfig notificationChannels. */ + public notificationChannels: string[]; + /** ModelMonitoringAlertConfig alert. */ public alert?: "emailAlertConfig"; diff --git a/packages/google-cloud-aiplatform/protos/protos.js b/packages/google-cloud-aiplatform/protos/protos.js index b36b5b646c0..2e86686a7a6 100644 --- a/packages/google-cloud-aiplatform/protos/protos.js +++ b/packages/google-cloud-aiplatform/protos/protos.js @@ -202588,6 +202588,7 @@ * @interface IModelMonitoringAlertConfig * @property {google.cloud.aiplatform.v1beta1.ModelMonitoringAlertConfig.IEmailAlertConfig|null} [emailAlertConfig] ModelMonitoringAlertConfig emailAlertConfig * @property {boolean|null} [enableLogging] ModelMonitoringAlertConfig enableLogging + * @property {Array.|null} [notificationChannels] ModelMonitoringAlertConfig notificationChannels */ /** @@ -202599,6 +202600,7 @@ * @param {google.cloud.aiplatform.v1beta1.IModelMonitoringAlertConfig=} [properties] Properties to set */ function ModelMonitoringAlertConfig(properties) { + this.notificationChannels = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -202621,6 +202623,14 @@ */ ModelMonitoringAlertConfig.prototype.enableLogging = false; + /** + * ModelMonitoringAlertConfig notificationChannels. + * @member {Array.} notificationChannels + * @memberof google.cloud.aiplatform.v1beta1.ModelMonitoringAlertConfig + * @instance + */ + ModelMonitoringAlertConfig.prototype.notificationChannels = $util.emptyArray; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -202663,6 +202673,9 @@ $root.google.cloud.aiplatform.v1beta1.ModelMonitoringAlertConfig.EmailAlertConfig.encode(message.emailAlertConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.enableLogging != null && Object.hasOwnProperty.call(message, "enableLogging")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableLogging); + if (message.notificationChannels != null && message.notificationChannels.length) + for (var i = 0; i < message.notificationChannels.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.notificationChannels[i]); return writer; }; @@ -202705,6 +202718,12 @@ message.enableLogging = reader.bool(); break; } + case 3: { + if (!(message.notificationChannels && message.notificationChannels.length)) + message.notificationChannels = []; + message.notificationChannels.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -202752,6 +202771,13 @@ if (message.enableLogging != null && message.hasOwnProperty("enableLogging")) if (typeof message.enableLogging !== "boolean") return "enableLogging: boolean expected"; + if (message.notificationChannels != null && message.hasOwnProperty("notificationChannels")) { + if (!Array.isArray(message.notificationChannels)) + return "notificationChannels: array expected"; + for (var i = 0; i < message.notificationChannels.length; ++i) + if (!$util.isString(message.notificationChannels[i])) + return "notificationChannels: string[] expected"; + } return null; }; @@ -202774,6 +202800,13 @@ } if (object.enableLogging != null) message.enableLogging = Boolean(object.enableLogging); + if (object.notificationChannels) { + if (!Array.isArray(object.notificationChannels)) + throw TypeError(".google.cloud.aiplatform.v1beta1.ModelMonitoringAlertConfig.notificationChannels: array expected"); + message.notificationChannels = []; + for (var i = 0; i < object.notificationChannels.length; ++i) + message.notificationChannels[i] = String(object.notificationChannels[i]); + } return message; }; @@ -202790,6 +202823,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.notificationChannels = []; if (options.defaults) object.enableLogging = false; if (message.emailAlertConfig != null && message.hasOwnProperty("emailAlertConfig")) { @@ -202799,6 +202834,11 @@ } if (message.enableLogging != null && message.hasOwnProperty("enableLogging")) object.enableLogging = message.enableLogging; + if (message.notificationChannels && message.notificationChannels.length) { + object.notificationChannels = []; + for (var j = 0; j < message.notificationChannels.length; ++j) + object.notificationChannels[j] = message.notificationChannels[j]; + } return object; }; diff --git a/packages/google-cloud-aiplatform/protos/protos.json b/packages/google-cloud-aiplatform/protos/protos.json index df4caa7a722..8ac3d1d8c9e 100644 --- a/packages/google-cloud-aiplatform/protos/protos.json +++ b/packages/google-cloud-aiplatform/protos/protos.json @@ -21128,6 +21128,14 @@ "enableLogging": { "type": "bool", "id": 2 + }, + "notificationChannels": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).type": "monitoring.googleapis.com/NotificationChannel" + } } }, "nested": {