Skip to content

Commit 106c449

Browse files
committedJan 30, 2025
feat(api): api update (#3859)
1 parent b5ea5a4 commit 106c449

File tree

3 files changed

+42
-27
lines changed

3 files changed

+42
-27
lines changed
 

‎.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1508
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-db443ead2321c518913c39aebcf830d4ad1d7d8fd95d81971fa73c87efc17df9.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-82a521194000c6d0b051c53d886330d610a9966c8f1f00c1ae82a7889328ff40.yml

‎magic_transit/siteacl.go

+11-2
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,12 @@ type ACLConfiguration struct {
237237
LANID string `json:"lan_id,required"`
238238
// The name of the LAN based on the provided lan_id.
239239
LANName string `json:"lan_name"`
240+
// Array of port ranges on the provided LAN that will be included in the ACL. If no
241+
// ports or port rangess are provided, communication on any port on this LAN is
242+
// allowed.
243+
PortRanges []string `json:"port_ranges"`
240244
// Array of ports on the provided LAN that will be included in the ACL. If no ports
241-
// are provided, communication on any port on this LAN is allowed.
245+
// or port ranges are provided, communication on any port on this LAN is allowed.
242246
Ports []int64 `json:"ports"`
243247
// Array of subnet IPs within the LAN that will be included in the ACL. If no
244248
// subnets are provided, communication on any subnets on this LAN are allowed.
@@ -251,6 +255,7 @@ type ACLConfiguration struct {
251255
type aclConfigurationJSON struct {
252256
LANID apijson.Field
253257
LANName apijson.Field
258+
PortRanges apijson.Field
254259
Ports apijson.Field
255260
Subnets apijson.Field
256261
raw string
@@ -270,8 +275,12 @@ type ACLConfigurationParam struct {
270275
LANID param.Field[string] `json:"lan_id,required"`
271276
// The name of the LAN based on the provided lan_id.
272277
LANName param.Field[string] `json:"lan_name"`
278+
// Array of port ranges on the provided LAN that will be included in the ACL. If no
279+
// ports or port rangess are provided, communication on any port on this LAN is
280+
// allowed.
281+
PortRanges param.Field[[]string] `json:"port_ranges"`
273282
// Array of ports on the provided LAN that will be included in the ACL. If no ports
274-
// are provided, communication on any port on this LAN is allowed.
283+
// or port ranges are provided, communication on any port on this LAN is allowed.
275284
Ports param.Field[[]int64] `json:"ports"`
276285
// Array of subnet IPs within the LAN that will be included in the ACL. If no
277286
// subnets are provided, communication on any subnets on this LAN are allowed.

‎magic_transit/siteacl_test.go

+30-24
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,18 @@ func TestSiteACLNewWithOptionalParams(t *testing.T) {
3333
magic_transit.SiteACLNewParams{
3434
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
3535
LAN1: cloudflare.F(magic_transit.ACLConfigurationParam{
36-
LANID: cloudflare.F("lan_id"),
37-
LANName: cloudflare.F("lan_name"),
38-
Ports: cloudflare.F([]int64{int64(1)}),
39-
Subnets: cloudflare.F([]magic_transit.SubnetParam{"192.0.2.1"}),
36+
LANID: cloudflare.F("lan_id"),
37+
LANName: cloudflare.F("lan_name"),
38+
PortRanges: cloudflare.F([]string{"8080-9000"}),
39+
Ports: cloudflare.F([]int64{int64(1)}),
40+
Subnets: cloudflare.F([]magic_transit.SubnetParam{"192.0.2.1"}),
4041
}),
4142
LAN2: cloudflare.F(magic_transit.ACLConfigurationParam{
42-
LANID: cloudflare.F("lan_id"),
43-
LANName: cloudflare.F("lan_name"),
44-
Ports: cloudflare.F([]int64{int64(1)}),
45-
Subnets: cloudflare.F([]magic_transit.SubnetParam{"192.0.2.1"}),
43+
LANID: cloudflare.F("lan_id"),
44+
LANName: cloudflare.F("lan_name"),
45+
PortRanges: cloudflare.F([]string{"8080-9000"}),
46+
Ports: cloudflare.F([]int64{int64(1)}),
47+
Subnets: cloudflare.F([]magic_transit.SubnetParam{"192.0.2.1"}),
4648
}),
4749
Name: cloudflare.F("PIN Pad - Cash Register"),
4850
Description: cloudflare.F("Allows local traffic between PIN pads and cash register."),
@@ -82,16 +84,18 @@ func TestSiteACLUpdateWithOptionalParams(t *testing.T) {
8284
Description: cloudflare.F("Allows local traffic between PIN pads and cash register."),
8385
ForwardLocally: cloudflare.F(true),
8486
LAN1: cloudflare.F(magic_transit.ACLConfigurationParam{
85-
LANID: cloudflare.F("lan_id"),
86-
LANName: cloudflare.F("lan_name"),
87-
Ports: cloudflare.F([]int64{int64(1)}),
88-
Subnets: cloudflare.F([]magic_transit.SubnetParam{"192.0.2.1"}),
87+
LANID: cloudflare.F("lan_id"),
88+
LANName: cloudflare.F("lan_name"),
89+
PortRanges: cloudflare.F([]string{"8080-9000"}),
90+
Ports: cloudflare.F([]int64{int64(1)}),
91+
Subnets: cloudflare.F([]magic_transit.SubnetParam{"192.0.2.1"}),
8992
}),
9093
LAN2: cloudflare.F(magic_transit.ACLConfigurationParam{
91-
LANID: cloudflare.F("lan_id"),
92-
LANName: cloudflare.F("lan_name"),
93-
Ports: cloudflare.F([]int64{int64(1)}),
94-
Subnets: cloudflare.F([]magic_transit.SubnetParam{"192.0.2.1"}),
94+
LANID: cloudflare.F("lan_id"),
95+
LANName: cloudflare.F("lan_name"),
96+
PortRanges: cloudflare.F([]string{"8080-9000"}),
97+
Ports: cloudflare.F([]int64{int64(1)}),
98+
Subnets: cloudflare.F([]magic_transit.SubnetParam{"192.0.2.1"}),
9599
}),
96100
Name: cloudflare.F("PIN Pad - Cash Register"),
97101
Protocols: cloudflare.F([]magic_transit.AllowedProtocol{magic_transit.AllowedProtocolTCP}),
@@ -188,16 +192,18 @@ func TestSiteACLEditWithOptionalParams(t *testing.T) {
188192
Description: cloudflare.F("Allows local traffic between PIN pads and cash register."),
189193
ForwardLocally: cloudflare.F(true),
190194
LAN1: cloudflare.F(magic_transit.ACLConfigurationParam{
191-
LANID: cloudflare.F("lan_id"),
192-
LANName: cloudflare.F("lan_name"),
193-
Ports: cloudflare.F([]int64{int64(1)}),
194-
Subnets: cloudflare.F([]magic_transit.SubnetParam{"192.0.2.1"}),
195+
LANID: cloudflare.F("lan_id"),
196+
LANName: cloudflare.F("lan_name"),
197+
PortRanges: cloudflare.F([]string{"8080-9000"}),
198+
Ports: cloudflare.F([]int64{int64(1)}),
199+
Subnets: cloudflare.F([]magic_transit.SubnetParam{"192.0.2.1"}),
195200
}),
196201
LAN2: cloudflare.F(magic_transit.ACLConfigurationParam{
197-
LANID: cloudflare.F("lan_id"),
198-
LANName: cloudflare.F("lan_name"),
199-
Ports: cloudflare.F([]int64{int64(1)}),
200-
Subnets: cloudflare.F([]magic_transit.SubnetParam{"192.0.2.1"}),
202+
LANID: cloudflare.F("lan_id"),
203+
LANName: cloudflare.F("lan_name"),
204+
PortRanges: cloudflare.F([]string{"8080-9000"}),
205+
Ports: cloudflare.F([]int64{int64(1)}),
206+
Subnets: cloudflare.F([]magic_transit.SubnetParam{"192.0.2.1"}),
201207
}),
202208
Name: cloudflare.F("PIN Pad - Cash Register"),
203209
Protocols: cloudflare.F([]magic_transit.AllowedProtocol{magic_transit.AllowedProtocolTCP}),

0 commit comments

Comments
 (0)
Please sign in to comment.