Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ef222b7

Browse files
committedMar 14, 2025
feat(api): api update (#4029)
1 parent 3e29413 commit ef222b7

6 files changed

+101
-47
lines changed
 

‎.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1608
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-72040dc5513750699c8bd782b33c7aefe34cc7602580b4153f134522cbc9276d.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ea509c8ba855c07cbf99dd2dcb998d7326cbf5e83bcb79d5b1260b2dd28e817d.yml

‎zero_trust/devicepolicy.go

+7-5
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,15 @@ type SettingsPolicy struct {
102102
// option is set to `true`.
103103
DisableAutoFallback bool `json:"disable_auto_fallback"`
104104
// Whether the policy will be applied to matching devices.
105-
Enabled bool `json:"enabled"`
105+
Enabled bool `json:"enabled"`
106+
// List of routes excluded in the WARP client's tunnel.
106107
Exclude []SplitTunnelExclude `json:"exclude"`
107108
// Whether to add Microsoft IPs to Split Tunnel exclusions.
108-
ExcludeOfficeIPs bool `json:"exclude_office_ips"`
109-
FallbackDomains []FallbackDomain `json:"fallback_domains"`
110-
GatewayUniqueID string `json:"gateway_unique_id"`
111-
Include []SplitTunnelInclude `json:"include"`
109+
ExcludeOfficeIPs bool `json:"exclude_office_ips"`
110+
FallbackDomains []FallbackDomain `json:"fallback_domains"`
111+
GatewayUniqueID string `json:"gateway_unique_id"`
112+
// List of routes included in the WARP client's tunnel.
113+
Include []SplitTunnelInclude `json:"include"`
112114
// The amount of time in minutes a user is allowed access to their LAN. A value of
113115
// 0 will allow LAN access until the next WARP reconnection, such as a reboot or a
114116
// laptop waking from sleep. Note that this field is omitted from the response if

‎zero_trust/devicepolicycustom.go

+12
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,14 @@ type DevicePolicyCustomNewParams struct {
189189
DisableAutoFallback param.Field[bool] `json:"disable_auto_fallback"`
190190
// Whether the policy will be applied to matching devices.
191191
Enabled param.Field[bool] `json:"enabled"`
192+
// List of routes excluded in the WARP client's tunnel. Both 'exclude' and
193+
// 'include' cannot be set in the same request.
194+
Exclude param.Field[[]SplitTunnelExcludeParam] `json:"exclude"`
192195
// Whether to add Microsoft IPs to Split Tunnel exclusions.
193196
ExcludeOfficeIPs param.Field[bool] `json:"exclude_office_ips"`
197+
// List of routes included in the WARP client's tunnel. Both 'exclude' and
198+
// 'include' cannot be set in the same request.
199+
Include param.Field[[]SplitTunnelExcludeParam] `json:"include"`
194200
// The amount of time in minutes a user is allowed access to their LAN. A value of
195201
// 0 will allow LAN access until the next WARP reconnection, such as a reboot or a
196202
// laptop waking from sleep. Note that this field is omitted from the response if
@@ -298,8 +304,14 @@ type DevicePolicyCustomEditParams struct {
298304
DisableAutoFallback param.Field[bool] `json:"disable_auto_fallback"`
299305
// Whether the policy will be applied to matching devices.
300306
Enabled param.Field[bool] `json:"enabled"`
307+
// List of routes excluded in the WARP client's tunnel. Both 'exclude' and
308+
// 'include' cannot be set in the same request.
309+
Exclude param.Field[[]SplitTunnelExcludeParam] `json:"exclude"`
301310
// Whether to add Microsoft IPs to Split Tunnel exclusions.
302311
ExcludeOfficeIPs param.Field[bool] `json:"exclude_office_ips"`
312+
// List of routes included in the WARP client's tunnel. Both 'exclude' and
313+
// 'include' cannot be set in the same request.
314+
Include param.Field[[]SplitTunnelExcludeParam] `json:"include"`
303315
// The wirefilter expression to match devices.
304316
Match param.Field[string] `json:"match"`
305317
// The name of the device settings profile.

‎zero_trust/devicepolicycustom_test.go

+43-23
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,29 @@ func TestDevicePolicyCustomNewWithOptionalParams(t *testing.T) {
2929
option.WithAPIEmail("user@example.com"),
3030
)
3131
_, err := client.ZeroTrust.Devices.Policies.Custom.New(context.TODO(), zero_trust.DevicePolicyCustomNewParams{
32-
AccountID: cloudflare.F("699d98642c564d2e855e9661899b7252"),
33-
Match: cloudflare.F(`user.identity == "test@cloudflare.com"`),
34-
Name: cloudflare.F("Allow Developers"),
35-
Precedence: cloudflare.F(100.000000),
36-
AllowModeSwitch: cloudflare.F(true),
37-
AllowUpdates: cloudflare.F(true),
38-
AllowedToLeave: cloudflare.F(true),
39-
AutoConnect: cloudflare.F(0.000000),
40-
CaptivePortal: cloudflare.F(180.000000),
41-
Description: cloudflare.F("Policy for test teams."),
42-
DisableAutoFallback: cloudflare.F(true),
43-
Enabled: cloudflare.F(true),
44-
ExcludeOfficeIPs: cloudflare.F(true),
32+
AccountID: cloudflare.F("699d98642c564d2e855e9661899b7252"),
33+
Match: cloudflare.F(`user.identity == "test@cloudflare.com"`),
34+
Name: cloudflare.F("Allow Developers"),
35+
Precedence: cloudflare.F(100.000000),
36+
AllowModeSwitch: cloudflare.F(true),
37+
AllowUpdates: cloudflare.F(true),
38+
AllowedToLeave: cloudflare.F(true),
39+
AutoConnect: cloudflare.F(0.000000),
40+
CaptivePortal: cloudflare.F(180.000000),
41+
Description: cloudflare.F("Policy for test teams."),
42+
DisableAutoFallback: cloudflare.F(true),
43+
Enabled: cloudflare.F(true),
44+
Exclude: cloudflare.F([]zero_trust.SplitTunnelExcludeParam{{
45+
Address: cloudflare.F("192.0.2.0/24"),
46+
Description: cloudflare.F("Exclude testing domains from the tunnel"),
47+
Host: cloudflare.F("*.example.com"),
48+
}}),
49+
ExcludeOfficeIPs: cloudflare.F(true),
50+
Include: cloudflare.F([]zero_trust.SplitTunnelExcludeParam{{
51+
Address: cloudflare.F("192.0.2.0/24"),
52+
Description: cloudflare.F("Exclude testing domains from the tunnel"),
53+
Host: cloudflare.F("*.example.com"),
54+
}}),
4555
LANAllowMinutes: cloudflare.F(30.000000),
4656
LANAllowSubnetSize: cloudflare.F(24.000000),
4757
RegisterInterfaceIPWithDNS: cloudflare.F(true),
@@ -134,16 +144,26 @@ func TestDevicePolicyCustomEditWithOptionalParams(t *testing.T) {
134144
context.TODO(),
135145
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
136146
zero_trust.DevicePolicyCustomEditParams{
137-
AccountID: cloudflare.F("699d98642c564d2e855e9661899b7252"),
138-
AllowModeSwitch: cloudflare.F(true),
139-
AllowUpdates: cloudflare.F(true),
140-
AllowedToLeave: cloudflare.F(true),
141-
AutoConnect: cloudflare.F(0.000000),
142-
CaptivePortal: cloudflare.F(180.000000),
143-
Description: cloudflare.F("Policy for test teams."),
144-
DisableAutoFallback: cloudflare.F(true),
145-
Enabled: cloudflare.F(true),
146-
ExcludeOfficeIPs: cloudflare.F(true),
147+
AccountID: cloudflare.F("699d98642c564d2e855e9661899b7252"),
148+
AllowModeSwitch: cloudflare.F(true),
149+
AllowUpdates: cloudflare.F(true),
150+
AllowedToLeave: cloudflare.F(true),
151+
AutoConnect: cloudflare.F(0.000000),
152+
CaptivePortal: cloudflare.F(180.000000),
153+
Description: cloudflare.F("Policy for test teams."),
154+
DisableAutoFallback: cloudflare.F(true),
155+
Enabled: cloudflare.F(true),
156+
Exclude: cloudflare.F([]zero_trust.SplitTunnelExcludeParam{{
157+
Address: cloudflare.F("192.0.2.0/24"),
158+
Description: cloudflare.F("Exclude testing domains from the tunnel"),
159+
Host: cloudflare.F("*.example.com"),
160+
}}),
161+
ExcludeOfficeIPs: cloudflare.F(true),
162+
Include: cloudflare.F([]zero_trust.SplitTunnelExcludeParam{{
163+
Address: cloudflare.F("192.0.2.0/24"),
164+
Description: cloudflare.F("Exclude testing domains from the tunnel"),
165+
Host: cloudflare.F("*.example.com"),
166+
}}),
147167
Match: cloudflare.F(`user.identity == "test@cloudflare.com"`),
148168
Name: cloudflare.F("Allow Developers"),
149169
Precedence: cloudflare.F(100.000000),

‎zero_trust/devicepolicydefault.go

+20-10
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,15 @@ type DevicePolicyDefaultEditResponse struct {
9595
// option is set to `true`.
9696
DisableAutoFallback bool `json:"disable_auto_fallback"`
9797
// Whether the policy will be applied to matching devices.
98-
Enabled bool `json:"enabled"`
98+
Enabled bool `json:"enabled"`
99+
// List of routes excluded in the WARP client's tunnel.
99100
Exclude []SplitTunnelExclude `json:"exclude"`
100101
// Whether to add Microsoft IPs to Split Tunnel exclusions.
101-
ExcludeOfficeIPs bool `json:"exclude_office_ips"`
102-
FallbackDomains []FallbackDomain `json:"fallback_domains"`
103-
GatewayUniqueID string `json:"gateway_unique_id"`
104-
Include []SplitTunnelInclude `json:"include"`
102+
ExcludeOfficeIPs bool `json:"exclude_office_ips"`
103+
FallbackDomains []FallbackDomain `json:"fallback_domains"`
104+
GatewayUniqueID string `json:"gateway_unique_id"`
105+
// List of routes included in the WARP client's tunnel.
106+
Include []SplitTunnelInclude `json:"include"`
105107
// Determines if the operating system will register WARP's local interface IP with
106108
// your on-premises DNS server.
107109
RegisterInterfaceIPWithDNS bool `json:"register_interface_ip_with_dns"`
@@ -192,13 +194,15 @@ type DevicePolicyDefaultGetResponse struct {
192194
// option is set to `true`.
193195
DisableAutoFallback bool `json:"disable_auto_fallback"`
194196
// Whether the policy will be applied to matching devices.
195-
Enabled bool `json:"enabled"`
197+
Enabled bool `json:"enabled"`
198+
// List of routes excluded in the WARP client's tunnel.
196199
Exclude []SplitTunnelExclude `json:"exclude"`
197200
// Whether to add Microsoft IPs to Split Tunnel exclusions.
198-
ExcludeOfficeIPs bool `json:"exclude_office_ips"`
199-
FallbackDomains []FallbackDomain `json:"fallback_domains"`
200-
GatewayUniqueID string `json:"gateway_unique_id"`
201-
Include []SplitTunnelInclude `json:"include"`
201+
ExcludeOfficeIPs bool `json:"exclude_office_ips"`
202+
FallbackDomains []FallbackDomain `json:"fallback_domains"`
203+
GatewayUniqueID string `json:"gateway_unique_id"`
204+
// List of routes included in the WARP client's tunnel.
205+
Include []SplitTunnelInclude `json:"include"`
202206
// Determines if the operating system will register WARP's local interface IP with
203207
// your on-premises DNS server.
204208
RegisterInterfaceIPWithDNS bool `json:"register_interface_ip_with_dns"`
@@ -287,8 +291,14 @@ type DevicePolicyDefaultEditParams struct {
287291
// fall back to a best guess of the default/system DNS resolvers unless this policy
288292
// option is set to `true`.
289293
DisableAutoFallback param.Field[bool] `json:"disable_auto_fallback"`
294+
// List of routes excluded in the WARP client's tunnel. Both 'exclude' and
295+
// 'include' cannot be set in the same request.
296+
Exclude param.Field[[]SplitTunnelExcludeParam] `json:"exclude"`
290297
// Whether to add Microsoft IPs to Split Tunnel exclusions.
291298
ExcludeOfficeIPs param.Field[bool] `json:"exclude_office_ips"`
299+
// List of routes included in the WARP client's tunnel. Both 'exclude' and
300+
// 'include' cannot be set in the same request.
301+
Include param.Field[[]SplitTunnelExcludeParam] `json:"include"`
292302
// Determines if the operating system will register WARP's local interface IP with
293303
// your on-premises DNS server.
294304
RegisterInterfaceIPWithDNS param.Field[bool] `json:"register_interface_ip_with_dns"`

‎zero_trust/devicepolicydefault_test.go

+18-8
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,24 @@ func TestDevicePolicyDefaultEditWithOptionalParams(t *testing.T) {
2828
option.WithAPIEmail("user@example.com"),
2929
)
3030
_, err := client.ZeroTrust.Devices.Policies.Default.Edit(context.TODO(), zero_trust.DevicePolicyDefaultEditParams{
31-
AccountID: cloudflare.F("699d98642c564d2e855e9661899b7252"),
32-
AllowModeSwitch: cloudflare.F(true),
33-
AllowUpdates: cloudflare.F(true),
34-
AllowedToLeave: cloudflare.F(true),
35-
AutoConnect: cloudflare.F(0.000000),
36-
CaptivePortal: cloudflare.F(180.000000),
37-
DisableAutoFallback: cloudflare.F(true),
38-
ExcludeOfficeIPs: cloudflare.F(true),
31+
AccountID: cloudflare.F("699d98642c564d2e855e9661899b7252"),
32+
AllowModeSwitch: cloudflare.F(true),
33+
AllowUpdates: cloudflare.F(true),
34+
AllowedToLeave: cloudflare.F(true),
35+
AutoConnect: cloudflare.F(0.000000),
36+
CaptivePortal: cloudflare.F(180.000000),
37+
DisableAutoFallback: cloudflare.F(true),
38+
Exclude: cloudflare.F([]zero_trust.SplitTunnelExcludeParam{{
39+
Address: cloudflare.F("192.0.2.0/24"),
40+
Description: cloudflare.F("Exclude testing domains from the tunnel"),
41+
Host: cloudflare.F("*.example.com"),
42+
}}),
43+
ExcludeOfficeIPs: cloudflare.F(true),
44+
Include: cloudflare.F([]zero_trust.SplitTunnelExcludeParam{{
45+
Address: cloudflare.F("192.0.2.0/24"),
46+
Description: cloudflare.F("Exclude testing domains from the tunnel"),
47+
Host: cloudflare.F("*.example.com"),
48+
}}),
3949
RegisterInterfaceIPWithDNS: cloudflare.F(true),
4050
ServiceModeV2: cloudflare.F(zero_trust.DevicePolicyDefaultEditParamsServiceModeV2{
4151
Mode: cloudflare.F("proxy"),

0 commit comments

Comments
 (0)
Please sign in to comment.