diff --git a/devices_policy.go b/devices_policy.go index c662ecb42be..f1a820e2d7b 100644 --- a/devices_policy.go +++ b/devices_policy.go @@ -57,6 +57,8 @@ type DeviceSettingsPolicy struct { Default bool `json:"default"` ExcludeOfficeIps *bool `json:"exclude_office_ips"` Description *string `json:"description"` + LanAllowMinutes *uint `json:"lan_allow_minutes"` + LanAllowSubnetSize *uint `json:"lan_allow_subnet_size"` } type DeviceSettingsPolicyResponse struct { @@ -85,6 +87,8 @@ type CreateDeviceSettingsPolicyParams struct { Enabled *bool `json:"enabled,omitempty"` ExcludeOfficeIps *bool `json:"exclude_office_ips"` Description *string `json:"description,omitempty"` + LanAllowMinutes *uint `json:"lan_allow_minutes,omitempty"` + LanAllowSubnetSize *uint `json:"lan_allow_subnet_size,omitempty"` } type UpdateDefaultDeviceSettingsPolicyParams struct { @@ -103,6 +107,8 @@ type UpdateDefaultDeviceSettingsPolicyParams struct { Enabled *bool `json:"enabled,omitempty"` ExcludeOfficeIps *bool `json:"exclude_office_ips"` Description *string `json:"description,omitempty"` + LanAllowMinutes *uint `json:"lan_allow_minutes,omitempty"` + LanAllowSubnetSize *uint `json:"lan_allow_subnet_size,omitempty"` } type UpdateDeviceSettingsPolicyParams struct { @@ -122,6 +128,8 @@ type UpdateDeviceSettingsPolicyParams struct { Enabled *bool `json:"enabled,omitempty"` ExcludeOfficeIps *bool `json:"exclude_office_ips"` Description *string `json:"description,omitempty"` + LanAllowMinutes *uint `json:"lan_allow_minutes,omitempty"` + LanAllowSubnetSize *uint `json:"lan_allow_subnet_size,omitempty"` } type ListDeviceSettingsPoliciesResponse struct { diff --git a/devices_policy_test.go b/devices_policy_test.go index b08e4522610..1b6681007df 100644 --- a/devices_policy_test.go +++ b/devices_policy_test.go @@ -27,22 +27,24 @@ var ( {Address: "10.0.0.0/8"}, {Address: "100.64.0.0/10"}, }, - GatewayUniqueID: StringPtr("t1235"), - SupportURL: StringPtr(""), - CaptivePortal: IntPtr(180), - AllowModeSwitch: BoolPtr(false), - SwitchLocked: BoolPtr(false), - AllowUpdates: BoolPtr(false), - AutoConnect: IntPtr(0), - AllowedToLeave: BoolPtr(true), - Enabled: BoolPtr(true), - PolicyID: nil, - Name: nil, - Match: nil, - Precedence: nil, - Default: true, - ExcludeOfficeIps: BoolPtr(false), - Description: nil, + GatewayUniqueID: StringPtr("t1235"), + SupportURL: StringPtr(""), + CaptivePortal: IntPtr(180), + AllowModeSwitch: BoolPtr(false), + SwitchLocked: BoolPtr(false), + AllowUpdates: BoolPtr(false), + AutoConnect: IntPtr(0), + AllowedToLeave: BoolPtr(true), + Enabled: BoolPtr(true), + PolicyID: nil, + Name: nil, + Match: nil, + Precedence: nil, + Default: true, + ExcludeOfficeIps: BoolPtr(false), + Description: nil, + LanAllowMinutes: nil, + LanAllowSubnetSize: nil, } nonDefaultDeviceSettingsPolicy = DeviceSettingsPolicy{ @@ -58,22 +60,24 @@ var ( {Address: "10.0.0.0/8"}, {Address: "100.64.0.0/10"}, }, - GatewayUniqueID: StringPtr("t1235"), - SupportURL: StringPtr(""), - CaptivePortal: IntPtr(180), - AllowModeSwitch: BoolPtr(false), - SwitchLocked: BoolPtr(false), - AllowUpdates: BoolPtr(false), - AutoConnect: IntPtr(0), - AllowedToLeave: BoolPtr(true), - PolicyID: &deviceSettingsPolicyID, - Enabled: BoolPtr(true), - Name: StringPtr("test"), - Match: &deviceSettingsPolicyMatch, - Precedence: &deviceSettingsPolicyPrecedence, - Default: false, - ExcludeOfficeIps: BoolPtr(true), - Description: StringPtr("Test Description"), + GatewayUniqueID: StringPtr("t1235"), + SupportURL: StringPtr(""), + CaptivePortal: IntPtr(180), + AllowModeSwitch: BoolPtr(false), + SwitchLocked: BoolPtr(false), + AllowUpdates: BoolPtr(false), + AutoConnect: IntPtr(0), + AllowedToLeave: BoolPtr(true), + PolicyID: &deviceSettingsPolicyID, + Enabled: BoolPtr(true), + Name: StringPtr("test"), + Match: &deviceSettingsPolicyMatch, + Precedence: &deviceSettingsPolicyPrecedence, + Default: false, + ExcludeOfficeIps: BoolPtr(true), + Description: StringPtr("Test Description"), + LanAllowMinutes: UintPtr(120), + LanAllowSubnetSize: UintPtr(31), } defaultDeviceSettingsPolicyJson = `{ @@ -146,7 +150,9 @@ var ( "precedence": 10, "default": false, "exclude_office_ips":true, - "description":"Test Description" + "description":"Test Description", + "lan_allow_minutes": 120, + "lan_allow_subnet_size": 31 }`, deviceSettingsPolicyID, deviceSettingsPolicyMatch) ) @@ -234,10 +240,12 @@ func TestCreateDeviceSettingsPolicy(t *testing.T) { mux.HandleFunc("/accounts/"+testAccountID+"/devices/policy", handler) actual, err := client.CreateDeviceSettingsPolicy(context.Background(), AccountIdentifier(testAccountID), CreateDeviceSettingsPolicyParams{ - Precedence: IntPtr(10), - Match: &deviceSettingsPolicyMatch, - Name: StringPtr("test"), - Description: StringPtr("Test Description"), + Precedence: IntPtr(10), + Match: &deviceSettingsPolicyMatch, + Name: StringPtr("test"), + Description: StringPtr("Test Description"), + LanAllowMinutes: UintPtr(120), + LanAllowSubnetSize: UintPtr(31), }) if assert.NoError(t, err) {