From 75b5cdcc20181be7b51865d909b02b41fd65cded Mon Sep 17 00:00:00 2001 From: Dawson Hensel Date: Tue, 30 Jul 2024 14:36:16 -0700 Subject: [PATCH] support admin code override --- .changelog/2797.txt | 3 +++ teams_accounts.go | 1 + teams_accounts_test.go | 7 +++++-- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .changelog/2797.txt diff --git a/.changelog/2797.txt b/.changelog/2797.txt new file mode 100644 index 00000000000..f3457d9a097 --- /dev/null +++ b/.changelog/2797.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +teams_accounts: Add `disable_for_time` attribute +``` \ No newline at end of file diff --git a/teams_accounts.go b/teams_accounts.go index dbded095329..91e1e6a6c9b 100644 --- a/teams_accounts.go +++ b/teams_accounts.go @@ -140,6 +140,7 @@ type TeamsDeviceSettings struct { GatewayProxyUDPEnabled bool `json:"gateway_udp_proxy_enabled"` RootCertificateInstallationEnabled bool `json:"root_certificate_installation_enabled"` UseZTVirtualIP *bool `json:"use_zt_virtual_ip"` + DisableForTime int32 `json:"disable_for_time"` } type TeamsDeviceSettingsResponse struct { diff --git a/teams_accounts_test.go b/teams_accounts_test.go index 569d352546d..c681e9fefca 100644 --- a/teams_accounts_test.go +++ b/teams_accounts_test.go @@ -295,7 +295,7 @@ func TestTeamsAccountGetDeviceConfiguration(t *testing.T) { "success": true, "errors": [], "messages": [], - "result": {"gateway_proxy_enabled": true,"gateway_udp_proxy_enabled":false, "root_certificate_installation_enabled":true, "use_zt_virtual_ip":false} + "result": {"gateway_proxy_enabled": true,"gateway_udp_proxy_enabled":false, "root_certificate_installation_enabled":true, "use_zt_virtual_ip":false, "disable_for_time":3600} }`) } @@ -309,6 +309,7 @@ func TestTeamsAccountGetDeviceConfiguration(t *testing.T) { GatewayProxyUDPEnabled: false, RootCertificateInstallationEnabled: true, UseZTVirtualIP: BoolPtr(false), + DisableForTime: 3600, }) } } @@ -324,7 +325,7 @@ func TestTeamsAccountUpdateDeviceConfiguration(t *testing.T) { "success": true, "errors": [], "messages": [], - "result": {"gateway_proxy_enabled": true,"gateway_udp_proxy_enabled":true, "root_certificate_installation_enabled":true, "use_zt_virtual_ip":true} + "result": {"gateway_proxy_enabled": true,"gateway_udp_proxy_enabled":true, "root_certificate_installation_enabled":true, "use_zt_virtual_ip":true, "disable_for_time":3600} }`) } @@ -335,6 +336,7 @@ func TestTeamsAccountUpdateDeviceConfiguration(t *testing.T) { GatewayProxyEnabled: true, RootCertificateInstallationEnabled: true, UseZTVirtualIP: BoolPtr(true), + DisableForTime: 3600, }) if assert.NoError(t, err) { @@ -343,6 +345,7 @@ func TestTeamsAccountUpdateDeviceConfiguration(t *testing.T) { GatewayProxyUDPEnabled: true, RootCertificateInstallationEnabled: true, UseZTVirtualIP: BoolPtr(true), + DisableForTime: 3600, }) } }