Skip to content

Commit 47ca841

Browse files
committedJan 30, 2025
feat(api): api update (#3833)
1 parent f932efc commit 47ca841

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed
 

‎.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1493
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-292d86018649794a0921751cee7162cb618358a55576fe9e18995601ad7484cc.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-817b1412335b2bc367169247bf8a10b29dbadb82b77df71df5ef5f3470fc974b.yml

‎magic_transit/siteacl.go

+18-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,11 @@ type ACL struct {
203203
// The name of the ACL.
204204
Name string `json:"name"`
205205
Protocols []AllowedProtocol `json:"protocols"`
206-
JSON aclJSON `json:"-"`
206+
// The desired traffic direction for this ACL policy. If set to "false", the policy
207+
// will allow bidirectional traffic. If set to "true", the policy will only allow
208+
// traffic in one direction. If not included in request, will default to false.
209+
Unidirectional bool `json:"unidirectional"`
210+
JSON aclJSON `json:"-"`
207211
}
208212

209213
// aclJSON contains the JSON metadata for the struct [ACL]
@@ -215,6 +219,7 @@ type aclJSON struct {
215219
LAN2 apijson.Field
216220
Name apijson.Field
217221
Protocols apijson.Field
222+
Unidirectional apijson.Field
218223
raw string
219224
ExtraFields map[string]apijson.Field
220225
}
@@ -314,6 +319,10 @@ type SiteACLNewParams struct {
314319
// to false.
315320
ForwardLocally param.Field[bool] `json:"forward_locally"`
316321
Protocols param.Field[[]AllowedProtocol] `json:"protocols"`
322+
// The desired traffic direction for this ACL policy. If set to "false", the policy
323+
// will allow bidirectional traffic. If set to "true", the policy will only allow
324+
// traffic in one direction. If not included in request, will default to false.
325+
Unidirectional param.Field[bool] `json:"unidirectional"`
317326
}
318327

319328
func (r SiteACLNewParams) MarshalJSON() (data []byte, err error) {
@@ -379,6 +388,10 @@ type SiteACLUpdateParams struct {
379388
// The name of the ACL.
380389
Name param.Field[string] `json:"name"`
381390
Protocols param.Field[[]AllowedProtocol] `json:"protocols"`
391+
// The desired traffic direction for this ACL policy. If set to "false", the policy
392+
// will allow bidirectional traffic. If set to "true", the policy will only allow
393+
// traffic in one direction. If not included in request, will default to false.
394+
Unidirectional param.Field[bool] `json:"unidirectional"`
382395
}
383396

384397
func (r SiteACLUpdateParams) MarshalJSON() (data []byte, err error) {
@@ -498,6 +511,10 @@ type SiteACLEditParams struct {
498511
// The name of the ACL.
499512
Name param.Field[string] `json:"name"`
500513
Protocols param.Field[[]AllowedProtocol] `json:"protocols"`
514+
// The desired traffic direction for this ACL policy. If set to "false", the policy
515+
// will allow bidirectional traffic. If set to "true", the policy will only allow
516+
// traffic in one direction. If not included in request, will default to false.
517+
Unidirectional param.Field[bool] `json:"unidirectional"`
501518
}
502519

503520
func (r SiteACLEditParams) MarshalJSON() (data []byte, err error) {

‎magic_transit/siteacl_test.go

+7-4
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ func TestSiteACLNewWithOptionalParams(t *testing.T) {
4848
Description: cloudflare.F("Allows local traffic between PIN pads and cash register."),
4949
ForwardLocally: cloudflare.F(true),
5050
Protocols: cloudflare.F([]magic_transit.AllowedProtocol{magic_transit.AllowedProtocolTCP}),
51+
Unidirectional: cloudflare.F(true),
5152
},
5253
)
5354
if err != nil {
@@ -92,8 +93,9 @@ func TestSiteACLUpdateWithOptionalParams(t *testing.T) {
9293
Ports: cloudflare.F([]int64{int64(1)}),
9394
Subnets: cloudflare.F([]magic_transit.SubnetParam{"192.0.2.1"}),
9495
}),
95-
Name: cloudflare.F("PIN Pad - Cash Register"),
96-
Protocols: cloudflare.F([]magic_transit.AllowedProtocol{magic_transit.AllowedProtocolTCP}),
96+
Name: cloudflare.F("PIN Pad - Cash Register"),
97+
Protocols: cloudflare.F([]magic_transit.AllowedProtocol{magic_transit.AllowedProtocolTCP}),
98+
Unidirectional: cloudflare.F(true),
9799
},
98100
)
99101
if err != nil {
@@ -197,8 +199,9 @@ func TestSiteACLEditWithOptionalParams(t *testing.T) {
197199
Ports: cloudflare.F([]int64{int64(1)}),
198200
Subnets: cloudflare.F([]magic_transit.SubnetParam{"192.0.2.1"}),
199201
}),
200-
Name: cloudflare.F("PIN Pad - Cash Register"),
201-
Protocols: cloudflare.F([]magic_transit.AllowedProtocol{magic_transit.AllowedProtocolTCP}),
202+
Name: cloudflare.F("PIN Pad - Cash Register"),
203+
Protocols: cloudflare.F([]magic_transit.AllowedProtocol{magic_transit.AllowedProtocolTCP}),
204+
Unidirectional: cloudflare.F(true),
202205
},
203206
)
204207
if err != nil {

0 commit comments

Comments
 (0)
Please sign in to comment.