Skip to content

Commit

Permalink
Support root_certificate_installation_enabled flag
Browse files Browse the repository at this point in the history
  • Loading branch information
suhrit-cf committed Feb 13, 2023
1 parent 1385fe5 commit 0a96951
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .changelog/1208.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
teams_accounts: Add new root_certificate_installation_enabled field
```
5 changes: 3 additions & 2 deletions teams_accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
19 changes: 11 additions & 8 deletions teams_accounts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}`)
}

Expand All @@ -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,
})
}
}
Expand All @@ -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,
})
}
}

0 comments on commit 0a96951

Please sign in to comment.