Repository: cloudflare/cloudflare-go
Pull request #1208 (2023-02-13 17:18:00)

Add new root_certificate_installation_enabled flag
Provide a general summary of your changes in the title above. You should
remove this overview, any sections and any section descriptions you
don't need below before submitting. There isn't a strict requirement to
use this template if you can structure your description and still cover
these points.

## Description

Describe your changes in detail through motivation and context. Why is
this change required? What problem does it solve? If it fixes an open
issue, link to the issue using GitHub's closing issues keywords[1].

## Has your change been tested?

Explain how the change has been tested and what you ran to confirm your
change affects other parts of the code. Automated tests are generally
expected and changes without tests should explain why they aren't
required.

## Screenshots (if appropriate):

## Types of changes

What sort of change does your code introduce/modify?

- [ ] 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.
- [ ] My change requires a change to the documentation.
- [ ] 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 (api.cloudflare.com or developers.cloudflare.com) and 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.

Patch:
diff --git a/.changelog/1208.txt b/.changelog/1208.txt
new file mode 100644
index 000000000..8075ecc79
--- /dev/null
+++ b/.changelog/1208.txt
@@ -0,0 +1,3 @@
+```release-note:enhancement
+teams_accounts: Add new root_certificate_installation_enabled field
+```
diff --git a/teams_accounts.go b/teams_accounts.go
index f90707147..7667a155b 100644
--- a/teams_accounts.go
+++ b/teams_accounts.go
@@ -97,8 +97,9 @@ type TeamsLoggingSettings struct {
 }
 
 type TeamsDeviceSettings struct {
-	GatewayProxyEnabled    bool `json:"gateway_proxy_enabled"`
-	GatewayProxyUDPEnabled bool `json:"gateway_udp_proxy_enabled"`
+	GatewayProxyEnabled                bool `json:"gateway_proxy_enabled"`
+	GatewayProxyUDPEnabled             bool `json:"gateway_udp_proxy_enabled"`
+	RootCertificateInstallationEnabled bool `json:"root_certificate_installation_enabled"`
 }
 
 type TeamsDeviceSettingsResponse struct {


Test patch:
diff --git a/teams_accounts_test.go b/teams_accounts_test.go
index a9535528b..174121735 100644
--- a/teams_accounts_test.go
+++ b/teams_accounts_test.go
@@ -239,7 +239,7 @@ func TestTeamsAccountGetDeviceConfiguration(t *testing.T) {
 			"success": true,
 			"errors": [],
 			"messages": [],
-			"result": {"gateway_proxy_enabled": true,"gateway_udp_proxy_enabled":false}
+			"result": {"gateway_proxy_enabled": true,"gateway_udp_proxy_enabled":false, "root_certificate_installation_enabled":true}
 		}`)
 	}
 
@@ -249,8 +249,9 @@ func TestTeamsAccountGetDeviceConfiguration(t *testing.T) {
 
 	if assert.NoError(t, err) {
 		assert.Equal(t, actual, TeamsDeviceSettings{
-			GatewayProxyEnabled:    true,
-			GatewayProxyUDPEnabled: false,
+			GatewayProxyEnabled:                true,
+			GatewayProxyUDPEnabled:             false,
+			RootCertificateInstallationEnabled: true,
 		})
 	}
 }
@@ -266,21 +267,23 @@ func TestTeamsAccountUpdateDeviceConfiguration(t *testing.T) {
 			"success": true,
 			"errors": [],
 			"messages": [],
-			"result": {"gateway_proxy_enabled": true,"gateway_udp_proxy_enabled":true}
+			"result": {"gateway_proxy_enabled": true,"gateway_udp_proxy_enabled":true, "root_certificate_installation_enabled":true}
 		}`)
 	}
 
 	mux.HandleFunc("/accounts/"+testAccountID+"/devices/settings", handler)
 
 	actual, err := client.TeamsAccountDeviceUpdateConfiguration(context.Background(), testAccountID, TeamsDeviceSettings{
-		GatewayProxyUDPEnabled: true,
-		GatewayProxyEnabled:    true,
+		GatewayProxyUDPEnabled:             true,
+		GatewayProxyEnabled:                true,
+		RootCertificateInstallationEnabled: true,
 	})
 
 	if assert.NoError(t, err) {
 		assert.Equal(t, actual, TeamsDeviceSettings{
-			GatewayProxyEnabled:    true,
-			GatewayProxyUDPEnabled: true,
+			GatewayProxyEnabled:                true,
+			GatewayProxyUDPEnabled:             true,
+			RootCertificateInstallationEnabled: true,
 		})
 	}
 }