Skip to content

Commit b2640e3

Browse files
committedDec 6, 2024·
feat(api): api update (#3707)
1 parent 693ee3a commit b2640e3

5 files changed

+57
-37
lines changed
 

‎.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1450
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0530d6510c5b139af850d24a4f932d5139c8d321a955ffa101b0debafbd75465.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4dc0e42c684fd5bb1470f8d6251d3d4a5194297e87606215b60d9a6ba5a5f7eb.yml

‎zero_trust/gatewaycertificate.go

+36-24
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ type GatewayCertificateNewResponse struct {
169169
// Certificate UUID tag.
170170
ID string `json:"id"`
171171
// The deployment status of the certificate on Cloudflare's edge. Certificates in
172-
// the 'active' state may be used for Gateway TLS interception.
172+
// the 'available' (previously called 'active') state may be used for Gateway TLS
173+
// interception.
173174
BindingStatus GatewayCertificateNewResponseBindingStatus `json:"binding_status"`
174175
// The CA certificate
175176
Certificate string `json:"certificate"`
@@ -218,19 +219,20 @@ func (r gatewayCertificateNewResponseJSON) RawJSON() string {
218219
}
219220

220221
// The deployment status of the certificate on Cloudflare's edge. Certificates in
221-
// the 'active' state may be used for Gateway TLS interception.
222+
// the 'available' (previously called 'active') state may be used for Gateway TLS
223+
// interception.
222224
type GatewayCertificateNewResponseBindingStatus string
223225

224226
const (
225227
GatewayCertificateNewResponseBindingStatusPendingDeployment GatewayCertificateNewResponseBindingStatus = "pending_deployment"
226-
GatewayCertificateNewResponseBindingStatusActive GatewayCertificateNewResponseBindingStatus = "active"
228+
GatewayCertificateNewResponseBindingStatusAvailable GatewayCertificateNewResponseBindingStatus = "available"
227229
GatewayCertificateNewResponseBindingStatusPendingDeletion GatewayCertificateNewResponseBindingStatus = "pending_deletion"
228230
GatewayCertificateNewResponseBindingStatusInactive GatewayCertificateNewResponseBindingStatus = "inactive"
229231
)
230232

231233
func (r GatewayCertificateNewResponseBindingStatus) IsKnown() bool {
232234
switch r {
233-
case GatewayCertificateNewResponseBindingStatusPendingDeployment, GatewayCertificateNewResponseBindingStatusActive, GatewayCertificateNewResponseBindingStatusPendingDeletion, GatewayCertificateNewResponseBindingStatusInactive:
235+
case GatewayCertificateNewResponseBindingStatusPendingDeployment, GatewayCertificateNewResponseBindingStatusAvailable, GatewayCertificateNewResponseBindingStatusPendingDeletion, GatewayCertificateNewResponseBindingStatusInactive:
234236
return true
235237
}
236238
return false
@@ -256,7 +258,8 @@ type GatewayCertificateListResponse struct {
256258
// Certificate UUID tag.
257259
ID string `json:"id"`
258260
// The deployment status of the certificate on Cloudflare's edge. Certificates in
259-
// the 'active' state may be used for Gateway TLS interception.
261+
// the 'available' (previously called 'active') state may be used for Gateway TLS
262+
// interception.
260263
BindingStatus GatewayCertificateListResponseBindingStatus `json:"binding_status"`
261264
// The CA certificate
262265
Certificate string `json:"certificate"`
@@ -305,19 +308,20 @@ func (r gatewayCertificateListResponseJSON) RawJSON() string {
305308
}
306309

307310
// The deployment status of the certificate on Cloudflare's edge. Certificates in
308-
// the 'active' state may be used for Gateway TLS interception.
311+
// the 'available' (previously called 'active') state may be used for Gateway TLS
312+
// interception.
309313
type GatewayCertificateListResponseBindingStatus string
310314

311315
const (
312316
GatewayCertificateListResponseBindingStatusPendingDeployment GatewayCertificateListResponseBindingStatus = "pending_deployment"
313-
GatewayCertificateListResponseBindingStatusActive GatewayCertificateListResponseBindingStatus = "active"
317+
GatewayCertificateListResponseBindingStatusAvailable GatewayCertificateListResponseBindingStatus = "available"
314318
GatewayCertificateListResponseBindingStatusPendingDeletion GatewayCertificateListResponseBindingStatus = "pending_deletion"
315319
GatewayCertificateListResponseBindingStatusInactive GatewayCertificateListResponseBindingStatus = "inactive"
316320
)
317321

318322
func (r GatewayCertificateListResponseBindingStatus) IsKnown() bool {
319323
switch r {
320-
case GatewayCertificateListResponseBindingStatusPendingDeployment, GatewayCertificateListResponseBindingStatusActive, GatewayCertificateListResponseBindingStatusPendingDeletion, GatewayCertificateListResponseBindingStatusInactive:
324+
case GatewayCertificateListResponseBindingStatusPendingDeployment, GatewayCertificateListResponseBindingStatusAvailable, GatewayCertificateListResponseBindingStatusPendingDeletion, GatewayCertificateListResponseBindingStatusInactive:
321325
return true
322326
}
323327
return false
@@ -343,7 +347,8 @@ type GatewayCertificateDeleteResponse struct {
343347
// Certificate UUID tag.
344348
ID string `json:"id"`
345349
// The deployment status of the certificate on Cloudflare's edge. Certificates in
346-
// the 'active' state may be used for Gateway TLS interception.
350+
// the 'available' (previously called 'active') state may be used for Gateway TLS
351+
// interception.
347352
BindingStatus GatewayCertificateDeleteResponseBindingStatus `json:"binding_status"`
348353
// The CA certificate
349354
Certificate string `json:"certificate"`
@@ -392,19 +397,20 @@ func (r gatewayCertificateDeleteResponseJSON) RawJSON() string {
392397
}
393398

394399
// The deployment status of the certificate on Cloudflare's edge. Certificates in
395-
// the 'active' state may be used for Gateway TLS interception.
400+
// the 'available' (previously called 'active') state may be used for Gateway TLS
401+
// interception.
396402
type GatewayCertificateDeleteResponseBindingStatus string
397403

398404
const (
399405
GatewayCertificateDeleteResponseBindingStatusPendingDeployment GatewayCertificateDeleteResponseBindingStatus = "pending_deployment"
400-
GatewayCertificateDeleteResponseBindingStatusActive GatewayCertificateDeleteResponseBindingStatus = "active"
406+
GatewayCertificateDeleteResponseBindingStatusAvailable GatewayCertificateDeleteResponseBindingStatus = "available"
401407
GatewayCertificateDeleteResponseBindingStatusPendingDeletion GatewayCertificateDeleteResponseBindingStatus = "pending_deletion"
402408
GatewayCertificateDeleteResponseBindingStatusInactive GatewayCertificateDeleteResponseBindingStatus = "inactive"
403409
)
404410

405411
func (r GatewayCertificateDeleteResponseBindingStatus) IsKnown() bool {
406412
switch r {
407-
case GatewayCertificateDeleteResponseBindingStatusPendingDeployment, GatewayCertificateDeleteResponseBindingStatusActive, GatewayCertificateDeleteResponseBindingStatusPendingDeletion, GatewayCertificateDeleteResponseBindingStatusInactive:
413+
case GatewayCertificateDeleteResponseBindingStatusPendingDeployment, GatewayCertificateDeleteResponseBindingStatusAvailable, GatewayCertificateDeleteResponseBindingStatusPendingDeletion, GatewayCertificateDeleteResponseBindingStatusInactive:
408414
return true
409415
}
410416
return false
@@ -430,7 +436,8 @@ type GatewayCertificateActivateResponse struct {
430436
// Certificate UUID tag.
431437
ID string `json:"id"`
432438
// The deployment status of the certificate on Cloudflare's edge. Certificates in
433-
// the 'active' state may be used for Gateway TLS interception.
439+
// the 'available' (previously called 'active') state may be used for Gateway TLS
440+
// interception.
434441
BindingStatus GatewayCertificateActivateResponseBindingStatus `json:"binding_status"`
435442
// The CA certificate
436443
Certificate string `json:"certificate"`
@@ -479,19 +486,20 @@ func (r gatewayCertificateActivateResponseJSON) RawJSON() string {
479486
}
480487

481488
// The deployment status of the certificate on Cloudflare's edge. Certificates in
482-
// the 'active' state may be used for Gateway TLS interception.
489+
// the 'available' (previously called 'active') state may be used for Gateway TLS
490+
// interception.
483491
type GatewayCertificateActivateResponseBindingStatus string
484492

485493
const (
486494
GatewayCertificateActivateResponseBindingStatusPendingDeployment GatewayCertificateActivateResponseBindingStatus = "pending_deployment"
487-
GatewayCertificateActivateResponseBindingStatusActive GatewayCertificateActivateResponseBindingStatus = "active"
495+
GatewayCertificateActivateResponseBindingStatusAvailable GatewayCertificateActivateResponseBindingStatus = "available"
488496
GatewayCertificateActivateResponseBindingStatusPendingDeletion GatewayCertificateActivateResponseBindingStatus = "pending_deletion"
489497
GatewayCertificateActivateResponseBindingStatusInactive GatewayCertificateActivateResponseBindingStatus = "inactive"
490498
)
491499

492500
func (r GatewayCertificateActivateResponseBindingStatus) IsKnown() bool {
493501
switch r {
494-
case GatewayCertificateActivateResponseBindingStatusPendingDeployment, GatewayCertificateActivateResponseBindingStatusActive, GatewayCertificateActivateResponseBindingStatusPendingDeletion, GatewayCertificateActivateResponseBindingStatusInactive:
502+
case GatewayCertificateActivateResponseBindingStatusPendingDeployment, GatewayCertificateActivateResponseBindingStatusAvailable, GatewayCertificateActivateResponseBindingStatusPendingDeletion, GatewayCertificateActivateResponseBindingStatusInactive:
495503
return true
496504
}
497505
return false
@@ -517,7 +525,8 @@ type GatewayCertificateDeactivateResponse struct {
517525
// Certificate UUID tag.
518526
ID string `json:"id"`
519527
// The deployment status of the certificate on Cloudflare's edge. Certificates in
520-
// the 'active' state may be used for Gateway TLS interception.
528+
// the 'available' (previously called 'active') state may be used for Gateway TLS
529+
// interception.
521530
BindingStatus GatewayCertificateDeactivateResponseBindingStatus `json:"binding_status"`
522531
// The CA certificate
523532
Certificate string `json:"certificate"`
@@ -566,19 +575,20 @@ func (r gatewayCertificateDeactivateResponseJSON) RawJSON() string {
566575
}
567576

568577
// The deployment status of the certificate on Cloudflare's edge. Certificates in
569-
// the 'active' state may be used for Gateway TLS interception.
578+
// the 'available' (previously called 'active') state may be used for Gateway TLS
579+
// interception.
570580
type GatewayCertificateDeactivateResponseBindingStatus string
571581

572582
const (
573583
GatewayCertificateDeactivateResponseBindingStatusPendingDeployment GatewayCertificateDeactivateResponseBindingStatus = "pending_deployment"
574-
GatewayCertificateDeactivateResponseBindingStatusActive GatewayCertificateDeactivateResponseBindingStatus = "active"
584+
GatewayCertificateDeactivateResponseBindingStatusAvailable GatewayCertificateDeactivateResponseBindingStatus = "available"
575585
GatewayCertificateDeactivateResponseBindingStatusPendingDeletion GatewayCertificateDeactivateResponseBindingStatus = "pending_deletion"
576586
GatewayCertificateDeactivateResponseBindingStatusInactive GatewayCertificateDeactivateResponseBindingStatus = "inactive"
577587
)
578588

579589
func (r GatewayCertificateDeactivateResponseBindingStatus) IsKnown() bool {
580590
switch r {
581-
case GatewayCertificateDeactivateResponseBindingStatusPendingDeployment, GatewayCertificateDeactivateResponseBindingStatusActive, GatewayCertificateDeactivateResponseBindingStatusPendingDeletion, GatewayCertificateDeactivateResponseBindingStatusInactive:
591+
case GatewayCertificateDeactivateResponseBindingStatusPendingDeployment, GatewayCertificateDeactivateResponseBindingStatusAvailable, GatewayCertificateDeactivateResponseBindingStatusPendingDeletion, GatewayCertificateDeactivateResponseBindingStatusInactive:
582592
return true
583593
}
584594
return false
@@ -604,7 +614,8 @@ type GatewayCertificateGetResponse struct {
604614
// Certificate UUID tag.
605615
ID string `json:"id"`
606616
// The deployment status of the certificate on Cloudflare's edge. Certificates in
607-
// the 'active' state may be used for Gateway TLS interception.
617+
// the 'available' (previously called 'active') state may be used for Gateway TLS
618+
// interception.
608619
BindingStatus GatewayCertificateGetResponseBindingStatus `json:"binding_status"`
609620
// The CA certificate
610621
Certificate string `json:"certificate"`
@@ -653,19 +664,20 @@ func (r gatewayCertificateGetResponseJSON) RawJSON() string {
653664
}
654665

655666
// The deployment status of the certificate on Cloudflare's edge. Certificates in
656-
// the 'active' state may be used for Gateway TLS interception.
667+
// the 'available' (previously called 'active') state may be used for Gateway TLS
668+
// interception.
657669
type GatewayCertificateGetResponseBindingStatus string
658670

659671
const (
660672
GatewayCertificateGetResponseBindingStatusPendingDeployment GatewayCertificateGetResponseBindingStatus = "pending_deployment"
661-
GatewayCertificateGetResponseBindingStatusActive GatewayCertificateGetResponseBindingStatus = "active"
673+
GatewayCertificateGetResponseBindingStatusAvailable GatewayCertificateGetResponseBindingStatus = "available"
662674
GatewayCertificateGetResponseBindingStatusPendingDeletion GatewayCertificateGetResponseBindingStatus = "pending_deletion"
663675
GatewayCertificateGetResponseBindingStatusInactive GatewayCertificateGetResponseBindingStatus = "inactive"
664676
)
665677

666678
func (r GatewayCertificateGetResponseBindingStatus) IsKnown() bool {
667679
switch r {
668-
case GatewayCertificateGetResponseBindingStatusPendingDeployment, GatewayCertificateGetResponseBindingStatusActive, GatewayCertificateGetResponseBindingStatusPendingDeletion, GatewayCertificateGetResponseBindingStatusInactive:
680+
case GatewayCertificateGetResponseBindingStatusPendingDeployment, GatewayCertificateGetResponseBindingStatusAvailable, GatewayCertificateGetResponseBindingStatusPendingDeletion, GatewayCertificateGetResponseBindingStatusInactive:
669681
return true
670682
}
671683
return false

‎zero_trust/gatewayconfiguration.go

+6-4
Original file line numberDiff line numberDiff line change
@@ -492,8 +492,9 @@ func (r gatewayConfigurationSettingsJSON) RawJSON() string {
492492
// Certificate settings for Gateway TLS interception. If not specified, the
493493
// Cloudflare Root CA will be used.
494494
type GatewayConfigurationSettingsCertificate struct {
495-
// UUID of certificate to be used for interception. Certificate must be active on
496-
// the edge. A nil UUID will indicate the Cloudflare Root CA should be used.
495+
// UUID of certificate to be used for interception. Certificate must be available
496+
// (previously called 'active') on the edge. A nil UUID will indicate the
497+
// Cloudflare Root CA should be used.
497498
ID string `json:"id,required"`
498499
JSON gatewayConfigurationSettingsCertificateJSON `json:"-"`
499500
}
@@ -593,8 +594,9 @@ func (r GatewayConfigurationSettingsParam) MarshalJSON() (data []byte, err error
593594
// Certificate settings for Gateway TLS interception. If not specified, the
594595
// Cloudflare Root CA will be used.
595596
type GatewayConfigurationSettingsCertificateParam struct {
596-
// UUID of certificate to be used for interception. Certificate must be active on
597-
// the edge. A nil UUID will indicate the Cloudflare Root CA should be used.
597+
// UUID of certificate to be used for interception. Certificate must be available
598+
// (previously called 'active') on the edge. A nil UUID will indicate the
599+
// Cloudflare Root CA should be used.
598600
ID param.Field[string] `json:"id,required"`
599601
}
600602

‎zero_trust/gatewayrule.go

+12-8
Original file line numberDiff line numberDiff line change
@@ -376,14 +376,13 @@ const (
376376
GatewayRuleActionOverride GatewayRuleAction = "override"
377377
GatewayRuleActionL4Override GatewayRuleAction = "l4_override"
378378
GatewayRuleActionEgress GatewayRuleAction = "egress"
379-
GatewayRuleActionAuditSSH GatewayRuleAction = "audit_ssh"
380379
GatewayRuleActionResolve GatewayRuleAction = "resolve"
381380
GatewayRuleActionQuarantine GatewayRuleAction = "quarantine"
382381
)
383382

384383
func (r GatewayRuleAction) IsKnown() bool {
385384
switch r {
386-
case GatewayRuleActionOn, GatewayRuleActionOff, GatewayRuleActionAllow, GatewayRuleActionBlock, GatewayRuleActionScan, GatewayRuleActionNoscan, GatewayRuleActionSafesearch, GatewayRuleActionYtrestricted, GatewayRuleActionIsolate, GatewayRuleActionNoisolate, GatewayRuleActionOverride, GatewayRuleActionL4Override, GatewayRuleActionEgress, GatewayRuleActionAuditSSH, GatewayRuleActionResolve, GatewayRuleActionQuarantine:
385+
case GatewayRuleActionOn, GatewayRuleActionOff, GatewayRuleActionAllow, GatewayRuleActionBlock, GatewayRuleActionScan, GatewayRuleActionNoscan, GatewayRuleActionSafesearch, GatewayRuleActionYtrestricted, GatewayRuleActionIsolate, GatewayRuleActionNoisolate, GatewayRuleActionOverride, GatewayRuleActionL4Override, GatewayRuleActionEgress, GatewayRuleActionResolve, GatewayRuleActionQuarantine:
387386
return true
388387
}
389388
return false
@@ -406,15 +405,18 @@ type GatewayRuleExpiration struct {
406405
ExpiresAt time.Time `json:"expires_at,required" format:"date-time"`
407406
// The default duration a policy will be active in minutes. Must be set in order to
408407
// use the `reset_expiration` endpoint on this rule.
409-
Duration int64 `json:"duration"`
410-
JSON gatewayRuleExpirationJSON `json:"-"`
408+
Duration int64 `json:"duration"`
409+
// Whether the policy has expired.
410+
Expired bool `json:"expired"`
411+
JSON gatewayRuleExpirationJSON `json:"-"`
411412
}
412413

413414
// gatewayRuleExpirationJSON contains the JSON metadata for the struct
414415
// [GatewayRuleExpiration]
415416
type gatewayRuleExpirationJSON struct {
416417
ExpiresAt apijson.Field
417418
Duration apijson.Field
419+
Expired apijson.Field
418420
raw string
419421
ExtraFields map[string]apijson.Field
420422
}
@@ -1206,14 +1208,13 @@ const (
12061208
GatewayRuleNewParamsActionOverride GatewayRuleNewParamsAction = "override"
12071209
GatewayRuleNewParamsActionL4Override GatewayRuleNewParamsAction = "l4_override"
12081210
GatewayRuleNewParamsActionEgress GatewayRuleNewParamsAction = "egress"
1209-
GatewayRuleNewParamsActionAuditSSH GatewayRuleNewParamsAction = "audit_ssh"
12101211
GatewayRuleNewParamsActionResolve GatewayRuleNewParamsAction = "resolve"
12111212
GatewayRuleNewParamsActionQuarantine GatewayRuleNewParamsAction = "quarantine"
12121213
)
12131214

12141215
func (r GatewayRuleNewParamsAction) IsKnown() bool {
12151216
switch r {
1216-
case GatewayRuleNewParamsActionOn, GatewayRuleNewParamsActionOff, GatewayRuleNewParamsActionAllow, GatewayRuleNewParamsActionBlock, GatewayRuleNewParamsActionScan, GatewayRuleNewParamsActionNoscan, GatewayRuleNewParamsActionSafesearch, GatewayRuleNewParamsActionYtrestricted, GatewayRuleNewParamsActionIsolate, GatewayRuleNewParamsActionNoisolate, GatewayRuleNewParamsActionOverride, GatewayRuleNewParamsActionL4Override, GatewayRuleNewParamsActionEgress, GatewayRuleNewParamsActionAuditSSH, GatewayRuleNewParamsActionResolve, GatewayRuleNewParamsActionQuarantine:
1217+
case GatewayRuleNewParamsActionOn, GatewayRuleNewParamsActionOff, GatewayRuleNewParamsActionAllow, GatewayRuleNewParamsActionBlock, GatewayRuleNewParamsActionScan, GatewayRuleNewParamsActionNoscan, GatewayRuleNewParamsActionSafesearch, GatewayRuleNewParamsActionYtrestricted, GatewayRuleNewParamsActionIsolate, GatewayRuleNewParamsActionNoisolate, GatewayRuleNewParamsActionOverride, GatewayRuleNewParamsActionL4Override, GatewayRuleNewParamsActionEgress, GatewayRuleNewParamsActionResolve, GatewayRuleNewParamsActionQuarantine:
12171218
return true
12181219
}
12191220
return false
@@ -1237,6 +1238,8 @@ type GatewayRuleNewParamsExpiration struct {
12371238
// The default duration a policy will be active in minutes. Must be set in order to
12381239
// use the `reset_expiration` endpoint on this rule.
12391240
Duration param.Field[int64] `json:"duration"`
1241+
// Whether the policy has expired.
1242+
Expired param.Field[bool] `json:"expired"`
12401243
}
12411244

12421245
func (r GatewayRuleNewParamsExpiration) MarshalJSON() (data []byte, err error) {
@@ -1344,14 +1347,13 @@ const (
13441347
GatewayRuleUpdateParamsActionOverride GatewayRuleUpdateParamsAction = "override"
13451348
GatewayRuleUpdateParamsActionL4Override GatewayRuleUpdateParamsAction = "l4_override"
13461349
GatewayRuleUpdateParamsActionEgress GatewayRuleUpdateParamsAction = "egress"
1347-
GatewayRuleUpdateParamsActionAuditSSH GatewayRuleUpdateParamsAction = "audit_ssh"
13481350
GatewayRuleUpdateParamsActionResolve GatewayRuleUpdateParamsAction = "resolve"
13491351
GatewayRuleUpdateParamsActionQuarantine GatewayRuleUpdateParamsAction = "quarantine"
13501352
)
13511353

13521354
func (r GatewayRuleUpdateParamsAction) IsKnown() bool {
13531355
switch r {
1354-
case GatewayRuleUpdateParamsActionOn, GatewayRuleUpdateParamsActionOff, GatewayRuleUpdateParamsActionAllow, GatewayRuleUpdateParamsActionBlock, GatewayRuleUpdateParamsActionScan, GatewayRuleUpdateParamsActionNoscan, GatewayRuleUpdateParamsActionSafesearch, GatewayRuleUpdateParamsActionYtrestricted, GatewayRuleUpdateParamsActionIsolate, GatewayRuleUpdateParamsActionNoisolate, GatewayRuleUpdateParamsActionOverride, GatewayRuleUpdateParamsActionL4Override, GatewayRuleUpdateParamsActionEgress, GatewayRuleUpdateParamsActionAuditSSH, GatewayRuleUpdateParamsActionResolve, GatewayRuleUpdateParamsActionQuarantine:
1356+
case GatewayRuleUpdateParamsActionOn, GatewayRuleUpdateParamsActionOff, GatewayRuleUpdateParamsActionAllow, GatewayRuleUpdateParamsActionBlock, GatewayRuleUpdateParamsActionScan, GatewayRuleUpdateParamsActionNoscan, GatewayRuleUpdateParamsActionSafesearch, GatewayRuleUpdateParamsActionYtrestricted, GatewayRuleUpdateParamsActionIsolate, GatewayRuleUpdateParamsActionNoisolate, GatewayRuleUpdateParamsActionOverride, GatewayRuleUpdateParamsActionL4Override, GatewayRuleUpdateParamsActionEgress, GatewayRuleUpdateParamsActionResolve, GatewayRuleUpdateParamsActionQuarantine:
13551357
return true
13561358
}
13571359
return false
@@ -1375,6 +1377,8 @@ type GatewayRuleUpdateParamsExpiration struct {
13751377
// The default duration a policy will be active in minutes. Must be set in order to
13761378
// use the `reset_expiration` endpoint on this rule.
13771379
Duration param.Field[int64] `json:"duration"`
1380+
// Whether the policy has expired.
1381+
Expired param.Field[bool] `json:"expired"`
13781382
}
13791383

13801384
func (r GatewayRuleUpdateParamsExpiration) MarshalJSON() (data []byte, err error) {

‎zero_trust/gatewayrule_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ func TestGatewayRuleNewWithOptionalParams(t *testing.T) {
3838
Expiration: cloudflare.F(zero_trust.GatewayRuleNewParamsExpiration{
3939
ExpiresAt: cloudflare.F(time.Now()),
4040
Duration: cloudflare.F(int64(10)),
41+
Expired: cloudflare.F(false),
4142
}),
4243
Filters: cloudflare.F([]zero_trust.GatewayFilter{zero_trust.GatewayFilterHTTP}),
4344
Identity: cloudflare.F("any(identity.groups.name[*] in {\"finance\"})"),
@@ -156,6 +157,7 @@ func TestGatewayRuleUpdateWithOptionalParams(t *testing.T) {
156157
Expiration: cloudflare.F(zero_trust.GatewayRuleUpdateParamsExpiration{
157158
ExpiresAt: cloudflare.F(time.Now()),
158159
Duration: cloudflare.F(int64(10)),
160+
Expired: cloudflare.F(false),
159161
}),
160162
Filters: cloudflare.F([]zero_trust.GatewayFilter{zero_trust.GatewayFilterHTTP}),
161163
Identity: cloudflare.F("any(identity.groups.name[*] in {\"finance\"})"),

0 commit comments

Comments
 (0)
Please sign in to comment.