Repository: cloudflare/cloudflare-go
Pull request #1499 (2024-02-08 00:24:32)

feat: update teams antivirus settings to configure notification
Adding a setting update on antivirus settings to include notification
DOC: https://developers.cloudflare.com/api/operations/zero-trust-accounts-patch-zero-trust-account-configuration



- [ ] Bug fix (non-breaking change which fixes an issue)
- [ x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Checklist:

- [ x] My code follows the code style of this project.
- [ x] My change requires a change to the documentation. (Already added)
- [ x] I have updated the documentation accordingly.
- [x ] I have added tests to cover my changes.
- [ x] All new and existing tests passed.
- [x ] This change is using publicly documented in [cloudflare/api-schemas](https://github.com/cloudflare/api-schemas) 
      and relies on stable APIs.

[1]: https://help.github.com/articles/closing-issues-using-keywords/


github-actions[bot]: Oops! It looks like no changelog entry is attached to this PR. Please include a release note as described in https://github.com/cloudflare/cloudflare-go/blob/master/docs/changelog-process.md.

Example: 

~~~
```release-note:TYPE
Release note
```
~~~

If you do not require a release note to be included, please add the `workflow/skip-changelog-entry` label.
github-actions[bot]: Oops! It looks like no changelog entry is attached to this PR. Please include a release note as described in https://github.com/cloudflare/cloudflare-go/blob/master/docs/changelog-process.md.

Example: 

~~~
```release-note:TYPE
Release note
```
~~~

If you do not require a release note to be included, please add the `workflow/skip-changelog-entry` label.

Patch:
diff --git a/.changelog/1499.txt b/.changelog/1499.txt
new file mode 100644
index 000000000..8272eb845
--- /dev/null
+++ b/.changelog/1499.txt
@@ -0,0 +1,3 @@
+```release-note:enhancement
+teams_rules: `AntiVirus` settings includes notification settings
+```
diff --git a/teams_accounts.go b/teams_accounts.go
index 90ae7d347..fc8fbb984 100644
--- a/teams_accounts.go
+++ b/teams_accounts.go
@@ -54,9 +54,10 @@ type BrowserIsolation struct {
 }
 
 type TeamsAntivirus struct {
-	EnabledDownloadPhase bool `json:"enabled_download_phase"`
-	EnabledUploadPhase   bool `json:"enabled_upload_phase"`
-	FailClosed           bool `json:"fail_closed"`
+	EnabledDownloadPhase bool                       `json:"enabled_download_phase"`
+	EnabledUploadPhase   bool                       `json:"enabled_upload_phase"`
+	FailClosed           bool                       `json:"fail_closed"`
+	NotificationSettings *TeamsNotificationSettings `json:"notification_settings"`
 }
 
 type TeamsFIPS struct {


Test patch:
diff --git a/teams_accounts_test.go b/teams_accounts_test.go
index 010e0059e..a7d096d1c 100644
--- a/teams_accounts_test.go
+++ b/teams_accounts_test.go
@@ -54,8 +54,13 @@ func TestTeamsAccountConfiguration(t *testing.T) {
 			"result": {
 				"settings": {
 					"antivirus": {
-						"enabled_download_phase": true
-					},
+					"enabled_download_phase": true,
+						"notification_settings": {
+					  		"enabled":true,
+					   		"msg":"msg",
+					   		"support_url":"https://hi.com"
+						}
+				 	},
 					"tls_decrypt": {
 						"enabled": true
 					},
@@ -82,7 +87,7 @@ func TestTeamsAccountConfiguration(t *testing.T) {
 					"browser_isolation": {
 						"url_browser_isolation_enabled": true,
 						"non_identity_enabled": true
-          				},
+					},
 					"body_scanning": {
 						"inspection_mode": "deep"
 					},
@@ -101,7 +106,14 @@ func TestTeamsAccountConfiguration(t *testing.T) {
 
 	if assert.NoError(t, err) {
 		assert.Equal(t, actual.Settings, TeamsAccountSettings{
-			Antivirus:         &TeamsAntivirus{EnabledDownloadPhase: true},
+			Antivirus: &TeamsAntivirus{
+				EnabledDownloadPhase: true,
+				NotificationSettings: &TeamsNotificationSettings{
+					Enabled:    &trueValue,
+					Message:    "msg",
+					SupportURL: "https://hi.com",
+				},
+			},
 			ActivityLog:       &TeamsActivityLog{Enabled: true},
 			TLSDecrypt:        &TeamsTLSDecrypt{Enabled: true},
 			ProtocolDetection: &TeamsProtocolDetection{Enabled: true},