diff --git a/.stats.yml b/.stats.yml index ee82d7a6ae8..3f333a1521b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1450 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0530d6510c5b139af850d24a4f932d5139c8d321a955ffa101b0debafbd75465.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4dc0e42c684fd5bb1470f8d6251d3d4a5194297e87606215b60d9a6ba5a5f7eb.yml diff --git a/zero_trust/gatewaycertificate.go b/zero_trust/gatewaycertificate.go index e2f40dad50b..f7f6e52efa0 100644 --- a/zero_trust/gatewaycertificate.go +++ b/zero_trust/gatewaycertificate.go @@ -169,7 +169,8 @@ type GatewayCertificateNewResponse struct { // Certificate UUID tag. ID string `json:"id"` // The deployment status of the certificate on Cloudflare's edge. Certificates in - // the 'active' state may be used for Gateway TLS interception. + // the 'available' (previously called 'active') state may be used for Gateway TLS + // interception. BindingStatus GatewayCertificateNewResponseBindingStatus `json:"binding_status"` // The CA certificate Certificate string `json:"certificate"` @@ -218,19 +219,20 @@ func (r gatewayCertificateNewResponseJSON) RawJSON() string { } // The deployment status of the certificate on Cloudflare's edge. Certificates in -// the 'active' state may be used for Gateway TLS interception. +// the 'available' (previously called 'active') state may be used for Gateway TLS +// interception. type GatewayCertificateNewResponseBindingStatus string const ( GatewayCertificateNewResponseBindingStatusPendingDeployment GatewayCertificateNewResponseBindingStatus = "pending_deployment" - GatewayCertificateNewResponseBindingStatusActive GatewayCertificateNewResponseBindingStatus = "active" + GatewayCertificateNewResponseBindingStatusAvailable GatewayCertificateNewResponseBindingStatus = "available" GatewayCertificateNewResponseBindingStatusPendingDeletion GatewayCertificateNewResponseBindingStatus = "pending_deletion" GatewayCertificateNewResponseBindingStatusInactive GatewayCertificateNewResponseBindingStatus = "inactive" ) func (r GatewayCertificateNewResponseBindingStatus) IsKnown() bool { switch r { - case GatewayCertificateNewResponseBindingStatusPendingDeployment, GatewayCertificateNewResponseBindingStatusActive, GatewayCertificateNewResponseBindingStatusPendingDeletion, GatewayCertificateNewResponseBindingStatusInactive: + case GatewayCertificateNewResponseBindingStatusPendingDeployment, GatewayCertificateNewResponseBindingStatusAvailable, GatewayCertificateNewResponseBindingStatusPendingDeletion, GatewayCertificateNewResponseBindingStatusInactive: return true } return false @@ -256,7 +258,8 @@ type GatewayCertificateListResponse struct { // Certificate UUID tag. ID string `json:"id"` // The deployment status of the certificate on Cloudflare's edge. Certificates in - // the 'active' state may be used for Gateway TLS interception. + // the 'available' (previously called 'active') state may be used for Gateway TLS + // interception. BindingStatus GatewayCertificateListResponseBindingStatus `json:"binding_status"` // The CA certificate Certificate string `json:"certificate"` @@ -305,19 +308,20 @@ func (r gatewayCertificateListResponseJSON) RawJSON() string { } // The deployment status of the certificate on Cloudflare's edge. Certificates in -// the 'active' state may be used for Gateway TLS interception. +// the 'available' (previously called 'active') state may be used for Gateway TLS +// interception. type GatewayCertificateListResponseBindingStatus string const ( GatewayCertificateListResponseBindingStatusPendingDeployment GatewayCertificateListResponseBindingStatus = "pending_deployment" - GatewayCertificateListResponseBindingStatusActive GatewayCertificateListResponseBindingStatus = "active" + GatewayCertificateListResponseBindingStatusAvailable GatewayCertificateListResponseBindingStatus = "available" GatewayCertificateListResponseBindingStatusPendingDeletion GatewayCertificateListResponseBindingStatus = "pending_deletion" GatewayCertificateListResponseBindingStatusInactive GatewayCertificateListResponseBindingStatus = "inactive" ) func (r GatewayCertificateListResponseBindingStatus) IsKnown() bool { switch r { - case GatewayCertificateListResponseBindingStatusPendingDeployment, GatewayCertificateListResponseBindingStatusActive, GatewayCertificateListResponseBindingStatusPendingDeletion, GatewayCertificateListResponseBindingStatusInactive: + case GatewayCertificateListResponseBindingStatusPendingDeployment, GatewayCertificateListResponseBindingStatusAvailable, GatewayCertificateListResponseBindingStatusPendingDeletion, GatewayCertificateListResponseBindingStatusInactive: return true } return false @@ -343,7 +347,8 @@ type GatewayCertificateDeleteResponse struct { // Certificate UUID tag. ID string `json:"id"` // The deployment status of the certificate on Cloudflare's edge. Certificates in - // the 'active' state may be used for Gateway TLS interception. + // the 'available' (previously called 'active') state may be used for Gateway TLS + // interception. BindingStatus GatewayCertificateDeleteResponseBindingStatus `json:"binding_status"` // The CA certificate Certificate string `json:"certificate"` @@ -392,19 +397,20 @@ func (r gatewayCertificateDeleteResponseJSON) RawJSON() string { } // The deployment status of the certificate on Cloudflare's edge. Certificates in -// the 'active' state may be used for Gateway TLS interception. +// the 'available' (previously called 'active') state may be used for Gateway TLS +// interception. type GatewayCertificateDeleteResponseBindingStatus string const ( GatewayCertificateDeleteResponseBindingStatusPendingDeployment GatewayCertificateDeleteResponseBindingStatus = "pending_deployment" - GatewayCertificateDeleteResponseBindingStatusActive GatewayCertificateDeleteResponseBindingStatus = "active" + GatewayCertificateDeleteResponseBindingStatusAvailable GatewayCertificateDeleteResponseBindingStatus = "available" GatewayCertificateDeleteResponseBindingStatusPendingDeletion GatewayCertificateDeleteResponseBindingStatus = "pending_deletion" GatewayCertificateDeleteResponseBindingStatusInactive GatewayCertificateDeleteResponseBindingStatus = "inactive" ) func (r GatewayCertificateDeleteResponseBindingStatus) IsKnown() bool { switch r { - case GatewayCertificateDeleteResponseBindingStatusPendingDeployment, GatewayCertificateDeleteResponseBindingStatusActive, GatewayCertificateDeleteResponseBindingStatusPendingDeletion, GatewayCertificateDeleteResponseBindingStatusInactive: + case GatewayCertificateDeleteResponseBindingStatusPendingDeployment, GatewayCertificateDeleteResponseBindingStatusAvailable, GatewayCertificateDeleteResponseBindingStatusPendingDeletion, GatewayCertificateDeleteResponseBindingStatusInactive: return true } return false @@ -430,7 +436,8 @@ type GatewayCertificateActivateResponse struct { // Certificate UUID tag. ID string `json:"id"` // The deployment status of the certificate on Cloudflare's edge. Certificates in - // the 'active' state may be used for Gateway TLS interception. + // the 'available' (previously called 'active') state may be used for Gateway TLS + // interception. BindingStatus GatewayCertificateActivateResponseBindingStatus `json:"binding_status"` // The CA certificate Certificate string `json:"certificate"` @@ -479,19 +486,20 @@ func (r gatewayCertificateActivateResponseJSON) RawJSON() string { } // The deployment status of the certificate on Cloudflare's edge. Certificates in -// the 'active' state may be used for Gateway TLS interception. +// the 'available' (previously called 'active') state may be used for Gateway TLS +// interception. type GatewayCertificateActivateResponseBindingStatus string const ( GatewayCertificateActivateResponseBindingStatusPendingDeployment GatewayCertificateActivateResponseBindingStatus = "pending_deployment" - GatewayCertificateActivateResponseBindingStatusActive GatewayCertificateActivateResponseBindingStatus = "active" + GatewayCertificateActivateResponseBindingStatusAvailable GatewayCertificateActivateResponseBindingStatus = "available" GatewayCertificateActivateResponseBindingStatusPendingDeletion GatewayCertificateActivateResponseBindingStatus = "pending_deletion" GatewayCertificateActivateResponseBindingStatusInactive GatewayCertificateActivateResponseBindingStatus = "inactive" ) func (r GatewayCertificateActivateResponseBindingStatus) IsKnown() bool { switch r { - case GatewayCertificateActivateResponseBindingStatusPendingDeployment, GatewayCertificateActivateResponseBindingStatusActive, GatewayCertificateActivateResponseBindingStatusPendingDeletion, GatewayCertificateActivateResponseBindingStatusInactive: + case GatewayCertificateActivateResponseBindingStatusPendingDeployment, GatewayCertificateActivateResponseBindingStatusAvailable, GatewayCertificateActivateResponseBindingStatusPendingDeletion, GatewayCertificateActivateResponseBindingStatusInactive: return true } return false @@ -517,7 +525,8 @@ type GatewayCertificateDeactivateResponse struct { // Certificate UUID tag. ID string `json:"id"` // The deployment status of the certificate on Cloudflare's edge. Certificates in - // the 'active' state may be used for Gateway TLS interception. + // the 'available' (previously called 'active') state may be used for Gateway TLS + // interception. BindingStatus GatewayCertificateDeactivateResponseBindingStatus `json:"binding_status"` // The CA certificate Certificate string `json:"certificate"` @@ -566,19 +575,20 @@ func (r gatewayCertificateDeactivateResponseJSON) RawJSON() string { } // The deployment status of the certificate on Cloudflare's edge. Certificates in -// the 'active' state may be used for Gateway TLS interception. +// the 'available' (previously called 'active') state may be used for Gateway TLS +// interception. type GatewayCertificateDeactivateResponseBindingStatus string const ( GatewayCertificateDeactivateResponseBindingStatusPendingDeployment GatewayCertificateDeactivateResponseBindingStatus = "pending_deployment" - GatewayCertificateDeactivateResponseBindingStatusActive GatewayCertificateDeactivateResponseBindingStatus = "active" + GatewayCertificateDeactivateResponseBindingStatusAvailable GatewayCertificateDeactivateResponseBindingStatus = "available" GatewayCertificateDeactivateResponseBindingStatusPendingDeletion GatewayCertificateDeactivateResponseBindingStatus = "pending_deletion" GatewayCertificateDeactivateResponseBindingStatusInactive GatewayCertificateDeactivateResponseBindingStatus = "inactive" ) func (r GatewayCertificateDeactivateResponseBindingStatus) IsKnown() bool { switch r { - case GatewayCertificateDeactivateResponseBindingStatusPendingDeployment, GatewayCertificateDeactivateResponseBindingStatusActive, GatewayCertificateDeactivateResponseBindingStatusPendingDeletion, GatewayCertificateDeactivateResponseBindingStatusInactive: + case GatewayCertificateDeactivateResponseBindingStatusPendingDeployment, GatewayCertificateDeactivateResponseBindingStatusAvailable, GatewayCertificateDeactivateResponseBindingStatusPendingDeletion, GatewayCertificateDeactivateResponseBindingStatusInactive: return true } return false @@ -604,7 +614,8 @@ type GatewayCertificateGetResponse struct { // Certificate UUID tag. ID string `json:"id"` // The deployment status of the certificate on Cloudflare's edge. Certificates in - // the 'active' state may be used for Gateway TLS interception. + // the 'available' (previously called 'active') state may be used for Gateway TLS + // interception. BindingStatus GatewayCertificateGetResponseBindingStatus `json:"binding_status"` // The CA certificate Certificate string `json:"certificate"` @@ -653,19 +664,20 @@ func (r gatewayCertificateGetResponseJSON) RawJSON() string { } // The deployment status of the certificate on Cloudflare's edge. Certificates in -// the 'active' state may be used for Gateway TLS interception. +// the 'available' (previously called 'active') state may be used for Gateway TLS +// interception. type GatewayCertificateGetResponseBindingStatus string const ( GatewayCertificateGetResponseBindingStatusPendingDeployment GatewayCertificateGetResponseBindingStatus = "pending_deployment" - GatewayCertificateGetResponseBindingStatusActive GatewayCertificateGetResponseBindingStatus = "active" + GatewayCertificateGetResponseBindingStatusAvailable GatewayCertificateGetResponseBindingStatus = "available" GatewayCertificateGetResponseBindingStatusPendingDeletion GatewayCertificateGetResponseBindingStatus = "pending_deletion" GatewayCertificateGetResponseBindingStatusInactive GatewayCertificateGetResponseBindingStatus = "inactive" ) func (r GatewayCertificateGetResponseBindingStatus) IsKnown() bool { switch r { - case GatewayCertificateGetResponseBindingStatusPendingDeployment, GatewayCertificateGetResponseBindingStatusActive, GatewayCertificateGetResponseBindingStatusPendingDeletion, GatewayCertificateGetResponseBindingStatusInactive: + case GatewayCertificateGetResponseBindingStatusPendingDeployment, GatewayCertificateGetResponseBindingStatusAvailable, GatewayCertificateGetResponseBindingStatusPendingDeletion, GatewayCertificateGetResponseBindingStatusInactive: return true } return false diff --git a/zero_trust/gatewayconfiguration.go b/zero_trust/gatewayconfiguration.go index 37433c5e776..66a94e2c357 100644 --- a/zero_trust/gatewayconfiguration.go +++ b/zero_trust/gatewayconfiguration.go @@ -492,8 +492,9 @@ func (r gatewayConfigurationSettingsJSON) RawJSON() string { // Certificate settings for Gateway TLS interception. If not specified, the // Cloudflare Root CA will be used. type GatewayConfigurationSettingsCertificate struct { - // UUID of certificate to be used for interception. Certificate must be active on - // the edge. A nil UUID will indicate the Cloudflare Root CA should be used. + // UUID of certificate to be used for interception. Certificate must be available + // (previously called 'active') on the edge. A nil UUID will indicate the + // Cloudflare Root CA should be used. ID string `json:"id,required"` JSON gatewayConfigurationSettingsCertificateJSON `json:"-"` } @@ -593,8 +594,9 @@ func (r GatewayConfigurationSettingsParam) MarshalJSON() (data []byte, err error // Certificate settings for Gateway TLS interception. If not specified, the // Cloudflare Root CA will be used. type GatewayConfigurationSettingsCertificateParam struct { - // UUID of certificate to be used for interception. Certificate must be active on - // the edge. A nil UUID will indicate the Cloudflare Root CA should be used. + // UUID of certificate to be used for interception. Certificate must be available + // (previously called 'active') on the edge. A nil UUID will indicate the + // Cloudflare Root CA should be used. ID param.Field[string] `json:"id,required"` } diff --git a/zero_trust/gatewayrule.go b/zero_trust/gatewayrule.go index c7f5c7e9dfb..e6fd64cd815 100644 --- a/zero_trust/gatewayrule.go +++ b/zero_trust/gatewayrule.go @@ -376,14 +376,13 @@ const ( GatewayRuleActionOverride GatewayRuleAction = "override" GatewayRuleActionL4Override GatewayRuleAction = "l4_override" GatewayRuleActionEgress GatewayRuleAction = "egress" - GatewayRuleActionAuditSSH GatewayRuleAction = "audit_ssh" GatewayRuleActionResolve GatewayRuleAction = "resolve" GatewayRuleActionQuarantine GatewayRuleAction = "quarantine" ) func (r GatewayRuleAction) IsKnown() bool { switch r { - case GatewayRuleActionOn, GatewayRuleActionOff, GatewayRuleActionAllow, GatewayRuleActionBlock, GatewayRuleActionScan, GatewayRuleActionNoscan, GatewayRuleActionSafesearch, GatewayRuleActionYtrestricted, GatewayRuleActionIsolate, GatewayRuleActionNoisolate, GatewayRuleActionOverride, GatewayRuleActionL4Override, GatewayRuleActionEgress, GatewayRuleActionAuditSSH, GatewayRuleActionResolve, GatewayRuleActionQuarantine: + case GatewayRuleActionOn, GatewayRuleActionOff, GatewayRuleActionAllow, GatewayRuleActionBlock, GatewayRuleActionScan, GatewayRuleActionNoscan, GatewayRuleActionSafesearch, GatewayRuleActionYtrestricted, GatewayRuleActionIsolate, GatewayRuleActionNoisolate, GatewayRuleActionOverride, GatewayRuleActionL4Override, GatewayRuleActionEgress, GatewayRuleActionResolve, GatewayRuleActionQuarantine: return true } return false @@ -406,8 +405,10 @@ type GatewayRuleExpiration struct { ExpiresAt time.Time `json:"expires_at,required" format:"date-time"` // The default duration a policy will be active in minutes. Must be set in order to // use the `reset_expiration` endpoint on this rule. - Duration int64 `json:"duration"` - JSON gatewayRuleExpirationJSON `json:"-"` + Duration int64 `json:"duration"` + // Whether the policy has expired. + Expired bool `json:"expired"` + JSON gatewayRuleExpirationJSON `json:"-"` } // gatewayRuleExpirationJSON contains the JSON metadata for the struct @@ -415,6 +416,7 @@ type GatewayRuleExpiration struct { type gatewayRuleExpirationJSON struct { ExpiresAt apijson.Field Duration apijson.Field + Expired apijson.Field raw string ExtraFields map[string]apijson.Field } @@ -1206,14 +1208,13 @@ const ( GatewayRuleNewParamsActionOverride GatewayRuleNewParamsAction = "override" GatewayRuleNewParamsActionL4Override GatewayRuleNewParamsAction = "l4_override" GatewayRuleNewParamsActionEgress GatewayRuleNewParamsAction = "egress" - GatewayRuleNewParamsActionAuditSSH GatewayRuleNewParamsAction = "audit_ssh" GatewayRuleNewParamsActionResolve GatewayRuleNewParamsAction = "resolve" GatewayRuleNewParamsActionQuarantine GatewayRuleNewParamsAction = "quarantine" ) func (r GatewayRuleNewParamsAction) IsKnown() bool { switch r { - case GatewayRuleNewParamsActionOn, GatewayRuleNewParamsActionOff, GatewayRuleNewParamsActionAllow, GatewayRuleNewParamsActionBlock, GatewayRuleNewParamsActionScan, GatewayRuleNewParamsActionNoscan, GatewayRuleNewParamsActionSafesearch, GatewayRuleNewParamsActionYtrestricted, GatewayRuleNewParamsActionIsolate, GatewayRuleNewParamsActionNoisolate, GatewayRuleNewParamsActionOverride, GatewayRuleNewParamsActionL4Override, GatewayRuleNewParamsActionEgress, GatewayRuleNewParamsActionAuditSSH, GatewayRuleNewParamsActionResolve, GatewayRuleNewParamsActionQuarantine: + case GatewayRuleNewParamsActionOn, GatewayRuleNewParamsActionOff, GatewayRuleNewParamsActionAllow, GatewayRuleNewParamsActionBlock, GatewayRuleNewParamsActionScan, GatewayRuleNewParamsActionNoscan, GatewayRuleNewParamsActionSafesearch, GatewayRuleNewParamsActionYtrestricted, GatewayRuleNewParamsActionIsolate, GatewayRuleNewParamsActionNoisolate, GatewayRuleNewParamsActionOverride, GatewayRuleNewParamsActionL4Override, GatewayRuleNewParamsActionEgress, GatewayRuleNewParamsActionResolve, GatewayRuleNewParamsActionQuarantine: return true } return false @@ -1237,6 +1238,8 @@ type GatewayRuleNewParamsExpiration struct { // The default duration a policy will be active in minutes. Must be set in order to // use the `reset_expiration` endpoint on this rule. Duration param.Field[int64] `json:"duration"` + // Whether the policy has expired. + Expired param.Field[bool] `json:"expired"` } func (r GatewayRuleNewParamsExpiration) MarshalJSON() (data []byte, err error) { @@ -1344,14 +1347,13 @@ const ( GatewayRuleUpdateParamsActionOverride GatewayRuleUpdateParamsAction = "override" GatewayRuleUpdateParamsActionL4Override GatewayRuleUpdateParamsAction = "l4_override" GatewayRuleUpdateParamsActionEgress GatewayRuleUpdateParamsAction = "egress" - GatewayRuleUpdateParamsActionAuditSSH GatewayRuleUpdateParamsAction = "audit_ssh" GatewayRuleUpdateParamsActionResolve GatewayRuleUpdateParamsAction = "resolve" GatewayRuleUpdateParamsActionQuarantine GatewayRuleUpdateParamsAction = "quarantine" ) func (r GatewayRuleUpdateParamsAction) IsKnown() bool { switch r { - case GatewayRuleUpdateParamsActionOn, GatewayRuleUpdateParamsActionOff, GatewayRuleUpdateParamsActionAllow, GatewayRuleUpdateParamsActionBlock, GatewayRuleUpdateParamsActionScan, GatewayRuleUpdateParamsActionNoscan, GatewayRuleUpdateParamsActionSafesearch, GatewayRuleUpdateParamsActionYtrestricted, GatewayRuleUpdateParamsActionIsolate, GatewayRuleUpdateParamsActionNoisolate, GatewayRuleUpdateParamsActionOverride, GatewayRuleUpdateParamsActionL4Override, GatewayRuleUpdateParamsActionEgress, GatewayRuleUpdateParamsActionAuditSSH, GatewayRuleUpdateParamsActionResolve, GatewayRuleUpdateParamsActionQuarantine: + case GatewayRuleUpdateParamsActionOn, GatewayRuleUpdateParamsActionOff, GatewayRuleUpdateParamsActionAllow, GatewayRuleUpdateParamsActionBlock, GatewayRuleUpdateParamsActionScan, GatewayRuleUpdateParamsActionNoscan, GatewayRuleUpdateParamsActionSafesearch, GatewayRuleUpdateParamsActionYtrestricted, GatewayRuleUpdateParamsActionIsolate, GatewayRuleUpdateParamsActionNoisolate, GatewayRuleUpdateParamsActionOverride, GatewayRuleUpdateParamsActionL4Override, GatewayRuleUpdateParamsActionEgress, GatewayRuleUpdateParamsActionResolve, GatewayRuleUpdateParamsActionQuarantine: return true } return false @@ -1375,6 +1377,8 @@ type GatewayRuleUpdateParamsExpiration struct { // The default duration a policy will be active in minutes. Must be set in order to // use the `reset_expiration` endpoint on this rule. Duration param.Field[int64] `json:"duration"` + // Whether the policy has expired. + Expired param.Field[bool] `json:"expired"` } func (r GatewayRuleUpdateParamsExpiration) MarshalJSON() (data []byte, err error) { diff --git a/zero_trust/gatewayrule_test.go b/zero_trust/gatewayrule_test.go index 9a480a679da..af5b4cb006a 100644 --- a/zero_trust/gatewayrule_test.go +++ b/zero_trust/gatewayrule_test.go @@ -38,6 +38,7 @@ func TestGatewayRuleNewWithOptionalParams(t *testing.T) { Expiration: cloudflare.F(zero_trust.GatewayRuleNewParamsExpiration{ ExpiresAt: cloudflare.F(time.Now()), Duration: cloudflare.F(int64(10)), + Expired: cloudflare.F(false), }), Filters: cloudflare.F([]zero_trust.GatewayFilter{zero_trust.GatewayFilterHTTP}), Identity: cloudflare.F("any(identity.groups.name[*] in {\"finance\"})"), @@ -156,6 +157,7 @@ func TestGatewayRuleUpdateWithOptionalParams(t *testing.T) { Expiration: cloudflare.F(zero_trust.GatewayRuleUpdateParamsExpiration{ ExpiresAt: cloudflare.F(time.Now()), Duration: cloudflare.F(int64(10)), + Expired: cloudflare.F(false), }), Filters: cloudflare.F([]zero_trust.GatewayFilter{zero_trust.GatewayFilterHTTP}), Identity: cloudflare.F("any(identity.groups.name[*] in {\"finance\"})"),