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 9147659

Browse files
committedMar 13, 2025
feat(api): api update (#4009)
1 parent 2057d40 commit 9147659

20 files changed

+612
-466
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-37ecafb773b4caa17905d8a19b6c08a3b0b360da07b4dc61a0a3a171f295ef6b.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-813efabef72bc705386072e4c622a71b923275a7f992dfc6efd0aac9731e18e6.yml

‎radar/attacklayer7.go

-22
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,6 @@ type AttackLayer7TimeseriesParams struct {
217217
// exclude ASNs from results. For example, `-174, 3356` excludes results from
218218
// AS174, but includes results from AS3356.
219219
ASN param.Field[[]string] `query:"asn"`
220-
// This field is deprecated, please use the new `mitigationProduct`.
221-
Attack param.Field[[]AttackLayer7TimeseriesParamsAttack] `query:"attack"`
222220
// Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to
223221
// exclude continents from results. For example, `-EU,NA` excludes results from EU,
224222
// but includes results from NA.
@@ -281,26 +279,6 @@ func (r AttackLayer7TimeseriesParamsAggInterval) IsKnown() bool {
281279
return false
282280
}
283281

284-
type AttackLayer7TimeseriesParamsAttack string
285-
286-
const (
287-
AttackLayer7TimeseriesParamsAttackDDoS AttackLayer7TimeseriesParamsAttack = "DDOS"
288-
AttackLayer7TimeseriesParamsAttackWAF AttackLayer7TimeseriesParamsAttack = "WAF"
289-
AttackLayer7TimeseriesParamsAttackBotManagement AttackLayer7TimeseriesParamsAttack = "BOT_MANAGEMENT"
290-
AttackLayer7TimeseriesParamsAttackAccessRules AttackLayer7TimeseriesParamsAttack = "ACCESS_RULES"
291-
AttackLayer7TimeseriesParamsAttackIPReputation AttackLayer7TimeseriesParamsAttack = "IP_REPUTATION"
292-
AttackLayer7TimeseriesParamsAttackAPIShield AttackLayer7TimeseriesParamsAttack = "API_SHIELD"
293-
AttackLayer7TimeseriesParamsAttackDataLossPrevention AttackLayer7TimeseriesParamsAttack = "DATA_LOSS_PREVENTION"
294-
)
295-
296-
func (r AttackLayer7TimeseriesParamsAttack) IsKnown() bool {
297-
switch r {
298-
case AttackLayer7TimeseriesParamsAttackDDoS, AttackLayer7TimeseriesParamsAttackWAF, AttackLayer7TimeseriesParamsAttackBotManagement, AttackLayer7TimeseriesParamsAttackAccessRules, AttackLayer7TimeseriesParamsAttackIPReputation, AttackLayer7TimeseriesParamsAttackAPIShield, AttackLayer7TimeseriesParamsAttackDataLossPrevention:
299-
return true
300-
}
301-
return false
302-
}
303-
304282
// Format in which results will be returned.
305283
type AttackLayer7TimeseriesParamsFormat string
306284

‎radar/attacklayer7_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ func TestAttackLayer7TimeseriesWithOptionalParams(t *testing.T) {
3131
_, err := client.Radar.Attacks.Layer7.Timeseries(context.TODO(), radar.AttackLayer7TimeseriesParams{
3232
AggInterval: cloudflare.F(radar.AttackLayer7TimeseriesParamsAggInterval15m),
3333
ASN: cloudflare.F([]string{"string"}),
34-
Attack: cloudflare.F([]radar.AttackLayer7TimeseriesParamsAttack{radar.AttackLayer7TimeseriesParamsAttackDDoS}),
3534
Continent: cloudflare.F([]string{"string"}),
3635
DateEnd: cloudflare.F([]time.Time{time.Now()}),
3736
DateRange: cloudflare.F([]string{"7d"}),

‎radar/attacklayer7top.go

+6-100
Original file line numberDiff line numberDiff line change
@@ -565,12 +565,6 @@ type AttackLayer7TopAttacksParams struct {
565565
DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
566566
// Format in which results will be returned.
567567
Format param.Field[AttackLayer7TopAttacksParamsFormat] `query:"format"`
568-
// Filters results by HTTP method.
569-
HTTPMethod param.Field[[]AttackLayer7TopAttacksParamsHTTPMethod] `query:"httpMethod"`
570-
// Filters results by HTTP version.
571-
HTTPVersion param.Field[[]AttackLayer7TopAttacksParamsHTTPVersion] `query:"httpVersion"`
572-
// Filters results by IP version (Ipv4 vs. IPv6).
573-
IPVersion param.Field[[]AttackLayer7TopAttacksParamsIPVersion] `query:"ipVersion"`
574568
// Limits the number of objects returned in the response.
575569
Limit param.Field[int64] `query:"limit"`
576570
// Array of attack origin/target location attack limits. Together with
@@ -584,8 +578,9 @@ type AttackLayer7TopAttacksParams struct {
584578
// locations from results. For example, `-US,PT` excludes results from the US, but
585579
// includes results from PT.
586580
Location param.Field[[]string] `query:"location"`
587-
// Attack magnitude can be defined by total requests mitigated or by total zones
588-
// attacked.
581+
// This parameter is deprecated. In the future, we will only support attack
582+
// magnitude defined by the total number of mitigated requests
583+
// (MITIGATED_REQUESTS).
589584
Magnitude param.Field[AttackLayer7TopAttacksParamsMagnitude] `query:"magnitude"`
590585
// Array of L7 mitigation products.
591586
MitigationProduct param.Field[[]AttackLayer7TopAttacksParamsMitigationProduct] `query:"mitigationProduct"`
@@ -621,96 +616,6 @@ func (r AttackLayer7TopAttacksParamsFormat) IsKnown() bool {
621616
return false
622617
}
623618

624-
type AttackLayer7TopAttacksParamsHTTPMethod string
625-
626-
const (
627-
AttackLayer7TopAttacksParamsHTTPMethodGet AttackLayer7TopAttacksParamsHTTPMethod = "GET"
628-
AttackLayer7TopAttacksParamsHTTPMethodPost AttackLayer7TopAttacksParamsHTTPMethod = "POST"
629-
AttackLayer7TopAttacksParamsHTTPMethodDelete AttackLayer7TopAttacksParamsHTTPMethod = "DELETE"
630-
AttackLayer7TopAttacksParamsHTTPMethodPut AttackLayer7TopAttacksParamsHTTPMethod = "PUT"
631-
AttackLayer7TopAttacksParamsHTTPMethodHead AttackLayer7TopAttacksParamsHTTPMethod = "HEAD"
632-
AttackLayer7TopAttacksParamsHTTPMethodPurge AttackLayer7TopAttacksParamsHTTPMethod = "PURGE"
633-
AttackLayer7TopAttacksParamsHTTPMethodOptions AttackLayer7TopAttacksParamsHTTPMethod = "OPTIONS"
634-
AttackLayer7TopAttacksParamsHTTPMethodPropfind AttackLayer7TopAttacksParamsHTTPMethod = "PROPFIND"
635-
AttackLayer7TopAttacksParamsHTTPMethodMkcol AttackLayer7TopAttacksParamsHTTPMethod = "MKCOL"
636-
AttackLayer7TopAttacksParamsHTTPMethodPatch AttackLayer7TopAttacksParamsHTTPMethod = "PATCH"
637-
AttackLayer7TopAttacksParamsHTTPMethodACL AttackLayer7TopAttacksParamsHTTPMethod = "ACL"
638-
AttackLayer7TopAttacksParamsHTTPMethodBcopy AttackLayer7TopAttacksParamsHTTPMethod = "BCOPY"
639-
AttackLayer7TopAttacksParamsHTTPMethodBdelete AttackLayer7TopAttacksParamsHTTPMethod = "BDELETE"
640-
AttackLayer7TopAttacksParamsHTTPMethodBmove AttackLayer7TopAttacksParamsHTTPMethod = "BMOVE"
641-
AttackLayer7TopAttacksParamsHTTPMethodBpropfind AttackLayer7TopAttacksParamsHTTPMethod = "BPROPFIND"
642-
AttackLayer7TopAttacksParamsHTTPMethodBproppatch AttackLayer7TopAttacksParamsHTTPMethod = "BPROPPATCH"
643-
AttackLayer7TopAttacksParamsHTTPMethodCheckin AttackLayer7TopAttacksParamsHTTPMethod = "CHECKIN"
644-
AttackLayer7TopAttacksParamsHTTPMethodCheckout AttackLayer7TopAttacksParamsHTTPMethod = "CHECKOUT"
645-
AttackLayer7TopAttacksParamsHTTPMethodConnect AttackLayer7TopAttacksParamsHTTPMethod = "CONNECT"
646-
AttackLayer7TopAttacksParamsHTTPMethodCopy AttackLayer7TopAttacksParamsHTTPMethod = "COPY"
647-
AttackLayer7TopAttacksParamsHTTPMethodLabel AttackLayer7TopAttacksParamsHTTPMethod = "LABEL"
648-
AttackLayer7TopAttacksParamsHTTPMethodLock AttackLayer7TopAttacksParamsHTTPMethod = "LOCK"
649-
AttackLayer7TopAttacksParamsHTTPMethodMerge AttackLayer7TopAttacksParamsHTTPMethod = "MERGE"
650-
AttackLayer7TopAttacksParamsHTTPMethodMkactivity AttackLayer7TopAttacksParamsHTTPMethod = "MKACTIVITY"
651-
AttackLayer7TopAttacksParamsHTTPMethodMkworkspace AttackLayer7TopAttacksParamsHTTPMethod = "MKWORKSPACE"
652-
AttackLayer7TopAttacksParamsHTTPMethodMove AttackLayer7TopAttacksParamsHTTPMethod = "MOVE"
653-
AttackLayer7TopAttacksParamsHTTPMethodNotify AttackLayer7TopAttacksParamsHTTPMethod = "NOTIFY"
654-
AttackLayer7TopAttacksParamsHTTPMethodOrderpatch AttackLayer7TopAttacksParamsHTTPMethod = "ORDERPATCH"
655-
AttackLayer7TopAttacksParamsHTTPMethodPoll AttackLayer7TopAttacksParamsHTTPMethod = "POLL"
656-
AttackLayer7TopAttacksParamsHTTPMethodProppatch AttackLayer7TopAttacksParamsHTTPMethod = "PROPPATCH"
657-
AttackLayer7TopAttacksParamsHTTPMethodReport AttackLayer7TopAttacksParamsHTTPMethod = "REPORT"
658-
AttackLayer7TopAttacksParamsHTTPMethodSearch AttackLayer7TopAttacksParamsHTTPMethod = "SEARCH"
659-
AttackLayer7TopAttacksParamsHTTPMethodSubscribe AttackLayer7TopAttacksParamsHTTPMethod = "SUBSCRIBE"
660-
AttackLayer7TopAttacksParamsHTTPMethodTrace AttackLayer7TopAttacksParamsHTTPMethod = "TRACE"
661-
AttackLayer7TopAttacksParamsHTTPMethodUncheckout AttackLayer7TopAttacksParamsHTTPMethod = "UNCHECKOUT"
662-
AttackLayer7TopAttacksParamsHTTPMethodUnlock AttackLayer7TopAttacksParamsHTTPMethod = "UNLOCK"
663-
AttackLayer7TopAttacksParamsHTTPMethodUnsubscribe AttackLayer7TopAttacksParamsHTTPMethod = "UNSUBSCRIBE"
664-
AttackLayer7TopAttacksParamsHTTPMethodUpdate AttackLayer7TopAttacksParamsHTTPMethod = "UPDATE"
665-
AttackLayer7TopAttacksParamsHTTPMethodVersioncontrol AttackLayer7TopAttacksParamsHTTPMethod = "VERSIONCONTROL"
666-
AttackLayer7TopAttacksParamsHTTPMethodBaselinecontrol AttackLayer7TopAttacksParamsHTTPMethod = "BASELINECONTROL"
667-
AttackLayer7TopAttacksParamsHTTPMethodXmsenumatts AttackLayer7TopAttacksParamsHTTPMethod = "XMSENUMATTS"
668-
AttackLayer7TopAttacksParamsHTTPMethodRpcOutData AttackLayer7TopAttacksParamsHTTPMethod = "RPC_OUT_DATA"
669-
AttackLayer7TopAttacksParamsHTTPMethodRpcInData AttackLayer7TopAttacksParamsHTTPMethod = "RPC_IN_DATA"
670-
AttackLayer7TopAttacksParamsHTTPMethodJson AttackLayer7TopAttacksParamsHTTPMethod = "JSON"
671-
AttackLayer7TopAttacksParamsHTTPMethodCook AttackLayer7TopAttacksParamsHTTPMethod = "COOK"
672-
AttackLayer7TopAttacksParamsHTTPMethodTrack AttackLayer7TopAttacksParamsHTTPMethod = "TRACK"
673-
)
674-
675-
func (r AttackLayer7TopAttacksParamsHTTPMethod) IsKnown() bool {
676-
switch r {
677-
case AttackLayer7TopAttacksParamsHTTPMethodGet, AttackLayer7TopAttacksParamsHTTPMethodPost, AttackLayer7TopAttacksParamsHTTPMethodDelete, AttackLayer7TopAttacksParamsHTTPMethodPut, AttackLayer7TopAttacksParamsHTTPMethodHead, AttackLayer7TopAttacksParamsHTTPMethodPurge, AttackLayer7TopAttacksParamsHTTPMethodOptions, AttackLayer7TopAttacksParamsHTTPMethodPropfind, AttackLayer7TopAttacksParamsHTTPMethodMkcol, AttackLayer7TopAttacksParamsHTTPMethodPatch, AttackLayer7TopAttacksParamsHTTPMethodACL, AttackLayer7TopAttacksParamsHTTPMethodBcopy, AttackLayer7TopAttacksParamsHTTPMethodBdelete, AttackLayer7TopAttacksParamsHTTPMethodBmove, AttackLayer7TopAttacksParamsHTTPMethodBpropfind, AttackLayer7TopAttacksParamsHTTPMethodBproppatch, AttackLayer7TopAttacksParamsHTTPMethodCheckin, AttackLayer7TopAttacksParamsHTTPMethodCheckout, AttackLayer7TopAttacksParamsHTTPMethodConnect, AttackLayer7TopAttacksParamsHTTPMethodCopy, AttackLayer7TopAttacksParamsHTTPMethodLabel, AttackLayer7TopAttacksParamsHTTPMethodLock, AttackLayer7TopAttacksParamsHTTPMethodMerge, AttackLayer7TopAttacksParamsHTTPMethodMkactivity, AttackLayer7TopAttacksParamsHTTPMethodMkworkspace, AttackLayer7TopAttacksParamsHTTPMethodMove, AttackLayer7TopAttacksParamsHTTPMethodNotify, AttackLayer7TopAttacksParamsHTTPMethodOrderpatch, AttackLayer7TopAttacksParamsHTTPMethodPoll, AttackLayer7TopAttacksParamsHTTPMethodProppatch, AttackLayer7TopAttacksParamsHTTPMethodReport, AttackLayer7TopAttacksParamsHTTPMethodSearch, AttackLayer7TopAttacksParamsHTTPMethodSubscribe, AttackLayer7TopAttacksParamsHTTPMethodTrace, AttackLayer7TopAttacksParamsHTTPMethodUncheckout, AttackLayer7TopAttacksParamsHTTPMethodUnlock, AttackLayer7TopAttacksParamsHTTPMethodUnsubscribe, AttackLayer7TopAttacksParamsHTTPMethodUpdate, AttackLayer7TopAttacksParamsHTTPMethodVersioncontrol, AttackLayer7TopAttacksParamsHTTPMethodBaselinecontrol, AttackLayer7TopAttacksParamsHTTPMethodXmsenumatts, AttackLayer7TopAttacksParamsHTTPMethodRpcOutData, AttackLayer7TopAttacksParamsHTTPMethodRpcInData, AttackLayer7TopAttacksParamsHTTPMethodJson, AttackLayer7TopAttacksParamsHTTPMethodCook, AttackLayer7TopAttacksParamsHTTPMethodTrack:
678-
return true
679-
}
680-
return false
681-
}
682-
683-
type AttackLayer7TopAttacksParamsHTTPVersion string
684-
685-
const (
686-
AttackLayer7TopAttacksParamsHTTPVersionHttPv1 AttackLayer7TopAttacksParamsHTTPVersion = "HTTPv1"
687-
AttackLayer7TopAttacksParamsHTTPVersionHttPv2 AttackLayer7TopAttacksParamsHTTPVersion = "HTTPv2"
688-
AttackLayer7TopAttacksParamsHTTPVersionHttPv3 AttackLayer7TopAttacksParamsHTTPVersion = "HTTPv3"
689-
)
690-
691-
func (r AttackLayer7TopAttacksParamsHTTPVersion) IsKnown() bool {
692-
switch r {
693-
case AttackLayer7TopAttacksParamsHTTPVersionHttPv1, AttackLayer7TopAttacksParamsHTTPVersionHttPv2, AttackLayer7TopAttacksParamsHTTPVersionHttPv3:
694-
return true
695-
}
696-
return false
697-
}
698-
699-
type AttackLayer7TopAttacksParamsIPVersion string
700-
701-
const (
702-
AttackLayer7TopAttacksParamsIPVersionIPv4 AttackLayer7TopAttacksParamsIPVersion = "IPv4"
703-
AttackLayer7TopAttacksParamsIPVersionIPv6 AttackLayer7TopAttacksParamsIPVersion = "IPv6"
704-
)
705-
706-
func (r AttackLayer7TopAttacksParamsIPVersion) IsKnown() bool {
707-
switch r {
708-
case AttackLayer7TopAttacksParamsIPVersionIPv4, AttackLayer7TopAttacksParamsIPVersionIPv6:
709-
return true
710-
}
711-
return false
712-
}
713-
714619
// Array of attack origin/target location attack limits. Together with
715620
// `limitPerLocation`, limits how many objects will be fetched per origin/target
716621
// location.
@@ -729,8 +634,9 @@ func (r AttackLayer7TopAttacksParamsLimitDirection) IsKnown() bool {
729634
return false
730635
}
731636

732-
// Attack magnitude can be defined by total requests mitigated or by total zones
733-
// attacked.
637+
// This parameter is deprecated. In the future, we will only support attack
638+
// magnitude defined by the total number of mitigated requests
639+
// (MITIGATED_REQUESTS).
734640
type AttackLayer7TopAttacksParamsMagnitude string
735641

736642
const (

‎radar/attacklayer7top_test.go

-3
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ func TestAttackLayer7TopAttacksWithOptionalParams(t *testing.T) {
3535
DateRange: cloudflare.F([]string{"7d"}),
3636
DateStart: cloudflare.F([]time.Time{time.Now()}),
3737
Format: cloudflare.F(radar.AttackLayer7TopAttacksParamsFormatJson),
38-
HTTPMethod: cloudflare.F([]radar.AttackLayer7TopAttacksParamsHTTPMethod{radar.AttackLayer7TopAttacksParamsHTTPMethodGet}),
39-
HTTPVersion: cloudflare.F([]radar.AttackLayer7TopAttacksParamsHTTPVersion{radar.AttackLayer7TopAttacksParamsHTTPVersionHttPv1}),
40-
IPVersion: cloudflare.F([]radar.AttackLayer7TopAttacksParamsIPVersion{radar.AttackLayer7TopAttacksParamsIPVersionIPv4}),
4138
Limit: cloudflare.F(int64(5)),
4239
LimitDirection: cloudflare.F(radar.AttackLayer7TopAttacksParamsLimitDirectionOrigin),
4340
LimitPerLocation: cloudflare.F(int64(10)),

0 commit comments

Comments
 (0)
Please sign in to comment.