From a528802ac56dc40135de35dee1076c02eb2f7fe0 Mon Sep 17 00:00:00 2001 From: hannah-tsai Date: Tue, 19 May 2020 13:57:16 -0700 Subject: [PATCH] Update filter field to mutable path --- securitycenter/src/update_notification.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/securitycenter/src/update_notification.php b/securitycenter/src/update_notification.php index 0711b0e4c5..f9c581e3ff 100644 --- a/securitycenter/src/update_notification.php +++ b/securitycenter/src/update_notification.php @@ -42,11 +42,12 @@ $notificationConfigName = $securityCenterClient::notificationConfigName($organizationId, $notificationConfigId); $streamingConfig = (new StreamingConfig())->setFilter("state = \"ACTIVE\""); -$fieldMask = (new FieldMask())->setPaths(['description', 'pubsub_topic']); +$fieldMask = (new FieldMask())->setPaths(['description', 'pubsub_topic', 'streaming_config.filter']); $notificationConfig = (new NotificationConfig()) ->setName($notificationConfigName) ->setDescription('Updated description.') - ->setPubsubTopic($pubsubTopic); + ->setPubsubTopic($pubsubTopic) + ->setStreamingConfig((new StreamingConfig)->setFilter('state = \"INACTIVE\"')); $response = $securityCenterClient->updateNotificationConfig($notificationConfig, [$fieldMask]); printf('Notification config was updated: %s' . PHP_EOL, $response->getName());