Skip to content

Commit fb71400

Browse files
authored
docs: Update Security Command Center UpdateNotificationConfig sample, adding filter to mutable field (#39)
Fixes b/155346619 Add "filter" to mutable fields for UpdateNotificationConfig.
1 parent 288e035 commit fb71400

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

securitycenter/snippets/snippets_notification_configs.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,19 @@ def update_notification_config(organization_id, notification_config_id, pubsub_t
120120
)
121121

122122
updated_description = "New updated description"
123+
updated_filter = 'state = "INACTIVE"'
123124

124125
# Only description and pubsub_topic can be updated.
125-
field_mask = field_mask_pb2.FieldMask(paths=["description", "pubsub_topic"])
126+
field_mask = field_mask_pb2.FieldMask(
127+
paths=["description", "pubsub_topic", "streaming_config.fitler"]
128+
)
126129

127130
updated_notification_config = client.update_notification_config(
128131
{
129132
"name": notification_config_name,
130133
"description": updated_description,
131134
"pubsub_topic": pubsub_topic,
135+
"streaming_config": {"filter": updated_filter},
132136
},
133137
update_mask=field_mask,
134138
)

0 commit comments

Comments
 (0)