From fef83d34a5f110f78c0003b2bcec9e5b4c7138ac Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 21 Feb 2024 21:09:45 +0000 Subject: [PATCH] feat: update via SDK Studio (#61) --- .stats.yml | 2 +- api.md | 233 ++++- src/resources/cache/cache-reserve.ts | 96 +++ src/resources/cache/cache.ts | 2 + src/resources/cache/index.ts | 2 + .../radar/annotations/annotations.ts | 2 + src/resources/radar/annotations/index.ts | 8 +- src/resources/radar/annotations/outages.ts | 143 ++++ src/resources/radar/attacks/layer7/index.ts | 32 +- src/resources/radar/attacks/layer7/layer7.ts | 121 ++- src/resources/radar/attacks/layer7/summary.ts | 601 +++++++++---- .../radar/attacks/layer7/timeseries-groups.ts | 808 +++++++++++++----- .../radar/attacks/layer7/top/ases.ts | 155 ++++ .../radar/attacks/layer7/top/index.ts | 1 + .../radar/attacks/layer7/top/locations.ts | 53 +- src/resources/radar/attacks/layer7/top/top.ts | 75 +- src/resources/radar/bgp/bgp.ts | 8 +- src/resources/radar/bgp/index.ts | 2 +- src/resources/radar/bgp/top/ases.ts | 204 +++++ src/resources/radar/bgp/top/index.ts | 4 + src/resources/radar/bgp/top/top.ts | 135 +++ src/resources/radar/bgp/tops/ases.ts | 77 -- src/resources/radar/bgp/tops/index.ts | 4 - src/resources/radar/bgp/tops/tops.ts | 14 - src/resources/radar/email/security/index.ts | 1 + .../radar/email/security/security.ts | 3 + .../radar/email/security/top/ases/arc.ts | 179 ++++ .../radar/email/security/top/ases/ases.ts | 210 +++++ .../radar/email/security/top/ases/dkim.ts | 179 ++++ .../radar/email/security/top/ases/dmarc.ts | 179 ++++ .../radar/email/security/top/ases/index.ts | 9 + .../email/security/top/ases/malicious.ts | 187 ++++ .../radar/email/security/top/ases/spam.ts | 184 ++++ .../radar/email/security/top/ases/spf.ts | 179 ++++ .../radar/email/security/top/index.ts | 5 + .../radar/email/security/top/locations/arc.ts | 179 ++++ .../email/security/top/locations/dkim.ts | 179 ++++ .../email/security/top/locations/dmarc.ts | 179 ++++ .../email/security/top/locations/index.ts | 9 + .../email/security/top/locations/locations.ts | 210 +++++ .../email/security/top/locations/malicious.ts | 187 ++++ .../email/security/top/locations/spam.ts | 184 ++++ .../radar/email/security/top/locations/spf.ts | 179 ++++ src/resources/radar/email/security/top/top.ts | 19 + src/resources/radar/quality/index.ts | 8 +- src/resources/radar/quality/iqi.ts | 118 +++ src/resources/radar/quality/quality.ts | 2 + src/resources/request-tracers/index.ts | 2 +- .../request-tracers/request-tracers.ts | 1 + src/resources/request-tracers/traces.ts | 83 +- .../api-resources/cache/cache-reserve.test.ts | 34 + .../radar/annotations/outages.test.ts | 40 + .../radar/attacks/layer7/layer7.test.ts | 5 +- .../radar/attacks/layer7/summary.test.ts | 88 +- .../attacks/layer7/timeseries-groups.test.ts | 103 ++- .../radar/attacks/layer7/top/ases.test.ts | 54 ++ .../attacks/layer7/top/locations.test.ts | 7 +- .../radar/attacks/layer7/top/top.test.ts | 10 +- .../api-resources/radar/bgp/top/ases.test.ts | 87 ++ .../{tops/ases.test.ts => top/top.test.ts} | 23 +- .../radar/email/security/top/ases/arc.test.ts | 59 ++ .../email/security/top/ases/ases.test.ts | 59 ++ .../email/security/top/ases/dkim.test.ts | 59 ++ .../email/security/top/ases/dmarc.test.ts | 59 ++ .../email/security/top/ases/malicious.test.ts | 62 ++ .../email/security/top/ases/spam.test.ts | 60 ++ .../radar/email/security/top/ases/spf.test.ts | 59 ++ .../email/security/top/locations/arc.test.ts | 59 ++ .../email/security/top/locations/dkim.test.ts | 59 ++ .../security/top/locations/dmarc.test.ts | 59 ++ .../security/top/locations/locations.test.ts | 59 ++ .../security/top/locations/malicious.test.ts | 62 ++ .../email/security/top/locations/spam.test.ts | 60 ++ .../email/security/top/locations/spf.test.ts | 59 ++ tests/api-resources/radar/quality/iqi.test.ts | 29 + 75 files changed, 6135 insertions(+), 815 deletions(-) create mode 100644 src/resources/radar/attacks/layer7/top/ases.ts create mode 100644 src/resources/radar/bgp/top/ases.ts create mode 100644 src/resources/radar/bgp/top/index.ts create mode 100644 src/resources/radar/bgp/top/top.ts delete mode 100644 src/resources/radar/bgp/tops/ases.ts delete mode 100644 src/resources/radar/bgp/tops/index.ts delete mode 100644 src/resources/radar/bgp/tops/tops.ts create mode 100644 src/resources/radar/email/security/top/ases/arc.ts create mode 100644 src/resources/radar/email/security/top/ases/ases.ts create mode 100644 src/resources/radar/email/security/top/ases/dkim.ts create mode 100644 src/resources/radar/email/security/top/ases/dmarc.ts create mode 100644 src/resources/radar/email/security/top/ases/index.ts create mode 100644 src/resources/radar/email/security/top/ases/malicious.ts create mode 100644 src/resources/radar/email/security/top/ases/spam.ts create mode 100644 src/resources/radar/email/security/top/ases/spf.ts create mode 100644 src/resources/radar/email/security/top/index.ts create mode 100644 src/resources/radar/email/security/top/locations/arc.ts create mode 100644 src/resources/radar/email/security/top/locations/dkim.ts create mode 100644 src/resources/radar/email/security/top/locations/dmarc.ts create mode 100644 src/resources/radar/email/security/top/locations/index.ts create mode 100644 src/resources/radar/email/security/top/locations/locations.ts create mode 100644 src/resources/radar/email/security/top/locations/malicious.ts create mode 100644 src/resources/radar/email/security/top/locations/spam.ts create mode 100644 src/resources/radar/email/security/top/locations/spf.ts create mode 100644 src/resources/radar/email/security/top/top.ts create mode 100644 tests/api-resources/radar/attacks/layer7/top/ases.test.ts create mode 100644 tests/api-resources/radar/bgp/top/ases.test.ts rename tests/api-resources/radar/bgp/{tops/ases.test.ts => top/top.test.ts} (69%) create mode 100644 tests/api-resources/radar/email/security/top/ases/arc.test.ts create mode 100644 tests/api-resources/radar/email/security/top/ases/ases.test.ts create mode 100644 tests/api-resources/radar/email/security/top/ases/dkim.test.ts create mode 100644 tests/api-resources/radar/email/security/top/ases/dmarc.test.ts create mode 100644 tests/api-resources/radar/email/security/top/ases/malicious.test.ts create mode 100644 tests/api-resources/radar/email/security/top/ases/spam.test.ts create mode 100644 tests/api-resources/radar/email/security/top/ases/spf.test.ts create mode 100644 tests/api-resources/radar/email/security/top/locations/arc.test.ts create mode 100644 tests/api-resources/radar/email/security/top/locations/dkim.test.ts create mode 100644 tests/api-resources/radar/email/security/top/locations/dmarc.test.ts create mode 100644 tests/api-resources/radar/email/security/top/locations/locations.test.ts create mode 100644 tests/api-resources/radar/email/security/top/locations/malicious.test.ts create mode 100644 tests/api-resources/radar/email/security/top/locations/spam.test.ts create mode 100644 tests/api-resources/radar/email/security/top/locations/spf.test.ts diff --git a/.stats.yml b/.stats.yml index 0692994e46..ea03a65f6b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1 +1 @@ -configured_endpoints: 1168 +configured_endpoints: 1209 diff --git a/api.md b/api.md index 4201a33d1e..cb53d987c3 100644 --- a/api.md +++ b/api.md @@ -815,12 +815,16 @@ Methods: Types: - CacheReserveListResponse +- CacheReserveClearResponse - CacheReserveEditResponse +- CacheReserveStatusResponse Methods: - client.cache.cacheReserve.list(zoneId) -> CacheReserveListResponse +- client.cache.cacheReserve.clear(zoneId) -> CacheReserveClearResponse - client.cache.cacheReserve.edit(zoneId, { ...params }) -> CacheReserveEditResponse +- client.cache.cacheReserve.status(zoneId) -> CacheReserveStatusResponse ## TieredCacheSmartTopology @@ -3971,6 +3975,7 @@ Methods: Types: +- EJbHDUdxTrace - TraceCreateResponse Methods: @@ -5267,10 +5272,12 @@ Methods: Types: +- OutageGetResponse - OutageLocationsResponse Methods: +- client.radar.annotations.outages.get({ ...params }) -> OutageGetResponse - client.radar.annotations.outages.locations({ ...params }) -> OutageLocationsResponse ## BGP @@ -5293,17 +5300,27 @@ Methods: - client.radar.bgp.leaks.events({ ...params }) -> LeakEventsResponse -### Tops +### Top + +Types: + +- TopPrefixesResponse + +Methods: + +- client.radar.bgp.top.prefixes({ ...params }) -> TopPrefixesResponse #### Ases Types: -- AsePrefixesResponse +- AseGetResponse +- AsePrefixesResponse Methods: -- client.radar.bgp.tops.ases.prefixes({ ...params }) -> AsePrefixesResponse +- client.radar.bgp.top.ases.get({ ...params }) -> AseGetResponse +- client.radar.bgp.top.ases.prefixes({ ...params }) -> AsePrefixesResponse ### Hijacks @@ -5485,6 +5502,148 @@ Methods: ### Security +#### Top + +##### Ases + +Types: + +- AseGetResponse + +Methods: + +- client.radar.email.security.top.ases.get({ ...params }) -> AseGetResponse + +###### Arc + +Types: + +- ArcGetResponse + +Methods: + +- client.radar.email.security.top.ases.arc.get(arc, { ...params }) -> ArcGetResponse + +###### DKIM + +Types: + +- DKIMGetResponse + +Methods: + +- client.radar.email.security.top.ases.dkim.get(dkim, { ...params }) -> DKIMGetResponse + +###### Dmarc + +Types: + +- DmarcGetResponse + +Methods: + +- client.radar.email.security.top.ases.dmarc.get(dmarc, { ...params }) -> DmarcGetResponse + +###### Malicious + +Types: + +- MaliciousGetResponse + +Methods: + +- client.radar.email.security.top.ases.malicious.get(malicious, { ...params }) -> MaliciousGetResponse + +###### Spam + +Types: + +- SpamGetResponse + +Methods: + +- client.radar.email.security.top.ases.spam.get(spam, { ...params }) -> SpamGetResponse + +###### SPF + +Types: + +- SPFGetResponse + +Methods: + +- client.radar.email.security.top.ases.spf.get(spf, { ...params }) -> SPFGetResponse + +##### Locations + +Types: + +- LocationGetResponse + +Methods: + +- client.radar.email.security.top.locations.get({ ...params }) -> LocationGetResponse + +###### Arc + +Types: + +- ArcGetResponse + +Methods: + +- client.radar.email.security.top.locations.arc.get(arc, { ...params }) -> ArcGetResponse + +###### DKIM + +Types: + +- DKIMGetResponse + +Methods: + +- client.radar.email.security.top.locations.dkim.get(dkim, { ...params }) -> DKIMGetResponse + +###### Dmarc + +Types: + +- DmarcGetResponse + +Methods: + +- client.radar.email.security.top.locations.dmarc.get(dmarc, { ...params }) -> DmarcGetResponse + +###### Malicious + +Types: + +- MaliciousGetResponse + +Methods: + +- client.radar.email.security.top.locations.malicious.get(malicious, { ...params }) -> MaliciousGetResponse + +###### Spam + +Types: + +- SpamGetResponse + +Methods: + +- client.radar.email.security.top.locations.spam.get(spam, { ...params }) -> SpamGetResponse + +###### SPF + +Types: + +- SPFGetResponse + +Methods: + +- client.radar.email.security.top.locations.spf.get(spf, { ...params }) -> SPFGetResponse + #### Summary Types: @@ -5609,51 +5768,51 @@ Types: Methods: -- client.radar.attacks.layer7.timeseries({ ...params }) -> Layer7TimeseriesResponse +- client.radar.attacks.layer7.timeseries({ ...params }) -> Layer7TimeseriesResponse #### Summary Types: -- SummaryBitrateResponse -- SummaryDurationResponse - SummaryGetResponse +- SummaryHTTPMethodResponse +- SummaryHTTPVersionResponse - SummaryIPVersionResponse -- SummaryProtocolResponse -- SummaryVectorResponse +- SummaryManagedRulesResponse +- SummaryMitigationProductResponse Methods: -- client.radar.attacks.layer7.summary.bitrate({ ...params }) -> SummaryBitrateResponse -- client.radar.attacks.layer7.summary.duration({ ...params }) -> SummaryDurationResponse -- client.radar.attacks.layer7.summary.get({ ...params }) -> SummaryGetResponse -- client.radar.attacks.layer7.summary.ipVersion({ ...params }) -> SummaryIPVersionResponse -- client.radar.attacks.layer7.summary.protocol({ ...params }) -> SummaryProtocolResponse -- client.radar.attacks.layer7.summary.vector({ ...params }) -> SummaryVectorResponse +- client.radar.attacks.layer7.summary.get({ ...params }) -> SummaryGetResponse +- client.radar.attacks.layer7.summary.httpMethod({ ...params }) -> SummaryHTTPMethodResponse +- client.radar.attacks.layer7.summary.httpVersion({ ...params }) -> SummaryHTTPVersionResponse +- client.radar.attacks.layer7.summary.ipVersion({ ...params }) -> SummaryIPVersionResponse +- client.radar.attacks.layer7.summary.managedRules({ ...params }) -> SummaryManagedRulesResponse +- client.radar.attacks.layer7.summary.mitigationProduct({ ...params }) -> SummaryMitigationProductResponse #### TimeseriesGroups Types: -- TimeseriesGroupBitrateResponse -- TimeseriesGroupDurationResponse - TimeseriesGroupGetResponse +- TimeseriesGroupHTTPMethodResponse +- TimeseriesGroupHTTPVersionResponse - TimeseriesGroupIndustryResponse - TimeseriesGroupIPVersionResponse -- TimeseriesGroupProtocolResponse -- TimeseriesGroupVectorResponse +- TimeseriesGroupManagedRulesResponse +- TimeseriesGroupMitigationProductResponse - TimeseriesGroupVerticalResponse Methods: -- client.radar.attacks.layer7.timeseriesGroups.bitrate({ ...params }) -> TimeseriesGroupBitrateResponse -- client.radar.attacks.layer7.timeseriesGroups.duration({ ...params }) -> TimeseriesGroupDurationResponse -- client.radar.attacks.layer7.timeseriesGroups.get({ ...params }) -> TimeseriesGroupGetResponse -- client.radar.attacks.layer7.timeseriesGroups.industry({ ...params }) -> TimeseriesGroupIndustryResponse -- client.radar.attacks.layer7.timeseriesGroups.ipVersion({ ...params }) -> TimeseriesGroupIPVersionResponse -- client.radar.attacks.layer7.timeseriesGroups.protocol({ ...params }) -> TimeseriesGroupProtocolResponse -- client.radar.attacks.layer7.timeseriesGroups.vector({ ...params }) -> TimeseriesGroupVectorResponse -- client.radar.attacks.layer7.timeseriesGroups.vertical({ ...params }) -> TimeseriesGroupVerticalResponse +- client.radar.attacks.layer7.timeseriesGroups.get({ ...params }) -> TimeseriesGroupGetResponse +- client.radar.attacks.layer7.timeseriesGroups.httpMethod({ ...params }) -> TimeseriesGroupHTTPMethodResponse +- client.radar.attacks.layer7.timeseriesGroups.httpVersion({ ...params }) -> TimeseriesGroupHTTPVersionResponse +- client.radar.attacks.layer7.timeseriesGroups.industry({ ...params }) -> TimeseriesGroupIndustryResponse +- client.radar.attacks.layer7.timeseriesGroups.ipVersion({ ...params }) -> TimeseriesGroupIPVersionResponse +- client.radar.attacks.layer7.timeseriesGroups.managedRules({ ...params }) -> TimeseriesGroupManagedRulesResponse +- client.radar.attacks.layer7.timeseriesGroups.mitigationProduct({ ...params }) -> TimeseriesGroupMitigationProductResponse +- client.radar.attacks.layer7.timeseriesGroups.vertical({ ...params }) -> TimeseriesGroupVerticalResponse #### Top @@ -5665,9 +5824,9 @@ Types: Methods: -- client.radar.attacks.layer7.top.attacks({ ...params }) -> TopAttacksResponse -- client.radar.attacks.layer7.top.industry({ ...params }) -> TopIndustryResponse -- client.radar.attacks.layer7.top.vertical({ ...params }) -> TopVerticalResponse +- client.radar.attacks.layer7.top.attacks({ ...params }) -> TopAttacksResponse +- client.radar.attacks.layer7.top.industry({ ...params }) -> TopIndustryResponse +- client.radar.attacks.layer7.top.vertical({ ...params }) -> TopVerticalResponse ##### Locations @@ -5678,8 +5837,18 @@ Types: Methods: -- client.radar.attacks.layer7.top.locations.origin({ ...params }) -> LocationOriginResponse -- client.radar.attacks.layer7.top.locations.target({ ...params }) -> LocationTargetResponse +- client.radar.attacks.layer7.top.locations.origin({ ...params }) -> LocationOriginResponse +- client.radar.attacks.layer7.top.locations.target({ ...params }) -> LocationTargetResponse + +##### Ases + +Types: + +- AseOriginResponse + +Methods: + +- client.radar.attacks.layer7.top.ases.origin({ ...params }) -> AseOriginResponse ## Emails @@ -5970,10 +6139,12 @@ Methods: Types: - IqiSummaryResponse +- IqiTimeseriesGroupsResponse Methods: - client.radar.quality.iqi.summary({ ...params }) -> IqiSummaryResponse +- client.radar.quality.iqi.timeseriesGroups({ ...params }) -> IqiTimeseriesGroupsResponse ### Speed diff --git a/src/resources/cache/cache-reserve.ts b/src/resources/cache/cache-reserve.ts index f2e983abde..ac4f4216c2 100644 --- a/src/resources/cache/cache-reserve.ts +++ b/src/resources/cache/cache-reserve.ts @@ -21,6 +21,20 @@ export class CacheReserve extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * You can use Cache Reserve Clear to clear your Cache Reserve, but you must first + * disable Cache Reserve. In most cases, this will be accomplished within 24 hours. + * You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind + * that you cannot undo or cancel this operation. + */ + clear(zoneId: string, options?: Core.RequestOptions): Core.APIPromise { + return ( + this._client.post(`/zones/${zoneId}/cache/cache_reserve_clear`, options) as Core.APIPromise<{ + result: CacheReserveClearResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + /** * Increase cache lifetimes by automatically storing all cacheable files into * Cloudflare's persistent object storage buckets. Requires Cache Reserve @@ -40,6 +54,20 @@ export class CacheReserve extends APIResource { }> )._thenUnwrap((obj) => obj.result); } + + /** + * You can use Cache Reserve Clear to clear your Cache Reserve, but you must first + * disable Cache Reserve. In most cases, this will be accomplished within 24 hours. + * You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind + * that you cannot undo or cancel this operation. + */ + status(zoneId: string, options?: Core.RequestOptions): Core.APIPromise { + return ( + this._client.get(`/zones/${zoneId}/cache/cache_reserve_clear`, options) as Core.APIPromise<{ + result: CacheReserveStatusResponse; + }> + )._thenUnwrap((obj) => obj.result); + } } /** @@ -67,6 +95,39 @@ export interface CacheReserveListResponse { value: 'on' | 'off'; } +/** + * You can use Cache Reserve Clear to clear your Cache Reserve, but you must first + * disable Cache Reserve. In most cases, this will be accomplished within 24 hours. + * You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind + * that you cannot undo or cancel this operation. + */ +export interface CacheReserveClearResponse { + /** + * ID of the zone setting. + */ + id: 'cache_reserve_clear'; + + /** + * last time this setting was modified. + */ + modified_on: string | null; + + /** + * The time that the latest Cache Reserve Clear operation started. + */ + start_ts: string; + + /** + * The current state of the Cache Reserve Clear operation. + */ + state: 'In-progress' | 'Completed'; + + /** + * The time that the latest Cache Reserve Clear operation completed. + */ + end_ts?: string; +} + /** * Increase cache lifetimes by automatically storing all cacheable files into * Cloudflare's persistent object storage buckets. Requires Cache Reserve @@ -92,6 +153,39 @@ export interface CacheReserveEditResponse { value: 'on' | 'off'; } +/** + * You can use Cache Reserve Clear to clear your Cache Reserve, but you must first + * disable Cache Reserve. In most cases, this will be accomplished within 24 hours. + * You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind + * that you cannot undo or cancel this operation. + */ +export interface CacheReserveStatusResponse { + /** + * ID of the zone setting. + */ + id: 'cache_reserve_clear'; + + /** + * last time this setting was modified. + */ + modified_on: string | null; + + /** + * The time that the latest Cache Reserve Clear operation started. + */ + start_ts: string; + + /** + * The current state of the Cache Reserve Clear operation. + */ + state: 'In-progress' | 'Completed'; + + /** + * The time that the latest Cache Reserve Clear operation completed. + */ + end_ts?: string; +} + export interface CacheReserveEditParams { /** * Value of the Cache Reserve zone setting. @@ -101,6 +195,8 @@ export interface CacheReserveEditParams { export namespace CacheReserve { export import CacheReserveListResponse = CacheReserveAPI.CacheReserveListResponse; + export import CacheReserveClearResponse = CacheReserveAPI.CacheReserveClearResponse; export import CacheReserveEditResponse = CacheReserveAPI.CacheReserveEditResponse; + export import CacheReserveStatusResponse = CacheReserveAPI.CacheReserveStatusResponse; export import CacheReserveEditParams = CacheReserveAPI.CacheReserveEditParams; } diff --git a/src/resources/cache/cache.ts b/src/resources/cache/cache.ts index 547fd486cc..79740a6119 100644 --- a/src/resources/cache/cache.ts +++ b/src/resources/cache/cache.ts @@ -108,7 +108,9 @@ export namespace Cache { export import CachePurgeParams = CacheAPI.CachePurgeParams; export import CacheReserve = CacheReserveAPI.CacheReserve; export import CacheReserveListResponse = CacheReserveAPI.CacheReserveListResponse; + export import CacheReserveClearResponse = CacheReserveAPI.CacheReserveClearResponse; export import CacheReserveEditResponse = CacheReserveAPI.CacheReserveEditResponse; + export import CacheReserveStatusResponse = CacheReserveAPI.CacheReserveStatusResponse; export import CacheReserveEditParams = CacheReserveAPI.CacheReserveEditParams; export import TieredCacheSmartTopology = TieredCacheSmartTopologyAPI.TieredCacheSmartTopology; export import TieredCacheSmartTopologyDeleteResponse = TieredCacheSmartTopologyAPI.TieredCacheSmartTopologyDeleteResponse; diff --git a/src/resources/cache/index.ts b/src/resources/cache/index.ts index 4e30c997b7..2fb8f15600 100644 --- a/src/resources/cache/index.ts +++ b/src/resources/cache/index.ts @@ -3,7 +3,9 @@ export { CachePurgeResponse, CachePurgeParams, Cache } from './cache'; export { CacheReserveListResponse, + CacheReserveClearResponse, CacheReserveEditResponse, + CacheReserveStatusResponse, CacheReserveEditParams, CacheReserve, } from './cache-reserve'; diff --git a/src/resources/radar/annotations/annotations.ts b/src/resources/radar/annotations/annotations.ts index d3ab7962bb..5889558c9b 100644 --- a/src/resources/radar/annotations/annotations.ts +++ b/src/resources/radar/annotations/annotations.ts @@ -9,6 +9,8 @@ export class Annotations extends APIResource { export namespace Annotations { export import Outages = OutagesAPI.Outages; + export import OutageGetResponse = OutagesAPI.OutageGetResponse; export import OutageLocationsResponse = OutagesAPI.OutageLocationsResponse; + export import OutageGetParams = OutagesAPI.OutageGetParams; export import OutageLocationsParams = OutagesAPI.OutageLocationsParams; } diff --git a/src/resources/radar/annotations/index.ts b/src/resources/radar/annotations/index.ts index 359b5e3af4..0aeb472a62 100644 --- a/src/resources/radar/annotations/index.ts +++ b/src/resources/radar/annotations/index.ts @@ -1,4 +1,10 @@ // File generated from our OpenAPI spec by Stainless. export { Annotations } from './annotations'; -export { OutageLocationsResponse, OutageLocationsParams, Outages } from './outages'; +export { + OutageGetResponse, + OutageLocationsResponse, + OutageGetParams, + OutageLocationsParams, + Outages, +} from './outages'; diff --git a/src/resources/radar/annotations/outages.ts b/src/resources/radar/annotations/outages.ts index 893d05d356..324cd2a45e 100644 --- a/src/resources/radar/annotations/outages.ts +++ b/src/resources/radar/annotations/outages.ts @@ -6,6 +6,25 @@ import { isRequestOptions } from 'cloudflare/core'; import * as OutagesAPI from 'cloudflare/resources/radar/annotations/outages'; export class Outages extends APIResource { + /** + * Get latest Internet outages and anomalies. + */ + get(query?: OutageGetParams, options?: Core.RequestOptions): Core.APIPromise; + get(options?: Core.RequestOptions): Core.APIPromise; + get( + query: OutageGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get({}, query); + } + return ( + this._client.get('/radar/annotations/outages', { query, ...options }) as Core.APIPromise<{ + result: OutageGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + /** * Get the number of outages for locations. */ @@ -29,6 +48,70 @@ export class Outages extends APIResource { } } +export interface OutageGetResponse { + annotations: Array; +} + +export namespace OutageGetResponse { + export interface Annotation { + id: string; + + asns: Array; + + asnsDetails: Array; + + dataSource: string; + + eventType: string; + + locations: Array; + + locationsDetails: Array; + + outage: Annotation.Outage; + + startDate: string; + + description?: string; + + endDate?: string; + + linkedUrl?: string; + + scope?: string; + } + + export namespace Annotation { + export interface AsnsDetail { + asn: string; + + name: string; + + locations?: AsnsDetail.Locations; + } + + export namespace AsnsDetail { + export interface Locations { + code: string; + + name: string; + } + } + + export interface LocationsDetail { + code: string; + + name: string; + } + + export interface Outage { + outageCause: string; + + outageType: string; + } + } +} + export interface OutageLocationsResponse { annotations: Array; } @@ -43,6 +126,64 @@ export namespace OutageLocationsResponse { } } +export interface OutageGetParams { + /** + * Single ASN as integer. + */ + asn?: number; + + /** + * End of the date range (inclusive). + */ + dateEnd?: string; + + /** + * Shorthand date ranges for the last X days - use when you don't need specific + * start and end dates. + */ + dateRange?: + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl'; + + /** + * Start of the date range (inclusive). + */ + dateStart?: string; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Location Alpha2 code. + */ + location?: string; + + /** + * Number of objects to skip before grabbing results. + */ + offset?: number; +} + export interface OutageLocationsParams { /** * End of the date range (inclusive). @@ -87,6 +228,8 @@ export interface OutageLocationsParams { } export namespace Outages { + export import OutageGetResponse = OutagesAPI.OutageGetResponse; export import OutageLocationsResponse = OutagesAPI.OutageLocationsResponse; + export import OutageGetParams = OutagesAPI.OutageGetParams; export import OutageLocationsParams = OutagesAPI.OutageLocationsParams; } diff --git a/src/resources/radar/attacks/layer7/index.ts b/src/resources/radar/attacks/layer7/index.ts index d34526e841..1b8f616a4c 100644 --- a/src/resources/radar/attacks/layer7/index.ts +++ b/src/resources/radar/attacks/layer7/index.ts @@ -2,36 +2,36 @@ export { Layer7TimeseriesResponse, Layer7TimeseriesParams, Layer7 } from './layer7'; export { - SummaryBitrateResponse, - SummaryDurationResponse, SummaryGetResponse, + SummaryHTTPMethodResponse, + SummaryHTTPVersionResponse, SummaryIPVersionResponse, - SummaryProtocolResponse, - SummaryVectorResponse, - SummaryBitrateParams, - SummaryDurationParams, + SummaryManagedRulesResponse, + SummaryMitigationProductResponse, SummaryGetParams, + SummaryHTTPMethodParams, + SummaryHTTPVersionParams, SummaryIPVersionParams, - SummaryProtocolParams, - SummaryVectorParams, + SummaryManagedRulesParams, + SummaryMitigationProductParams, Summary, } from './summary'; export { - TimeseriesGroupBitrateResponse, - TimeseriesGroupDurationResponse, TimeseriesGroupGetResponse, + TimeseriesGroupHTTPMethodResponse, + TimeseriesGroupHTTPVersionResponse, TimeseriesGroupIndustryResponse, TimeseriesGroupIPVersionResponse, - TimeseriesGroupProtocolResponse, - TimeseriesGroupVectorResponse, + TimeseriesGroupManagedRulesResponse, + TimeseriesGroupMitigationProductResponse, TimeseriesGroupVerticalResponse, - TimeseriesGroupBitrateParams, - TimeseriesGroupDurationParams, TimeseriesGroupGetParams, + TimeseriesGroupHTTPMethodParams, + TimeseriesGroupHTTPVersionParams, TimeseriesGroupIndustryParams, TimeseriesGroupIPVersionParams, - TimeseriesGroupProtocolParams, - TimeseriesGroupVectorParams, + TimeseriesGroupManagedRulesParams, + TimeseriesGroupMitigationProductParams, TimeseriesGroupVerticalParams, TimeseriesGroups, } from './timeseries-groups'; diff --git a/src/resources/radar/attacks/layer7/layer7.ts b/src/resources/radar/attacks/layer7/layer7.ts index db9ddc6d62..1cf7582677 100644 --- a/src/resources/radar/attacks/layer7/layer7.ts +++ b/src/resources/radar/attacks/layer7/layer7.ts @@ -16,7 +16,8 @@ export class Layer7 extends APIResource { top: TopAPI.Top = new TopAPI.Top(this._client); /** - * Get attacks change over time by bytes. + * Get a timeseries of Layer 7 attacks. Values represent HTTP requests and are + * normalized using min-max by default. */ timeseries( query?: Layer7TimeseriesParams, @@ -31,7 +32,7 @@ export class Layer7 extends APIResource { return this.timeseries({}, query); } return ( - this._client.get('/radar/attacks/layer3/timeseries', { query, ...options }) as Core.APIPromise<{ + this._client.get('/radar/attacks/layer7/timeseries', { query, ...options }) as Core.APIPromise<{ result: Layer7TimeseriesResponse; }> )._thenUnwrap((obj) => obj.result); @@ -39,12 +40,60 @@ export class Layer7 extends APIResource { } export interface Layer7TimeseriesResponse { - meta: unknown; + meta: Layer7TimeseriesResponse.Meta; serie_0: Layer7TimeseriesResponse.Serie0; } export namespace Layer7TimeseriesResponse { + export interface Meta { + aggInterval: string; + + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + export interface Serie0 { timestamps: Array; @@ -67,6 +116,19 @@ export interface Layer7TimeseriesParams { */ asn?: Array; + /** + * Array of L7 attack types. + */ + attack?: Array< + | 'DDOS' + | 'WAF' + | 'BOT_MANAGEMENT' + | 'ACCESS_RULES' + | 'IP_REPUTATION' + | 'API_SHIELD' + | 'DATA_LOSS_PREVENTION' + >; + /** * End of the date range (inclusive). */ @@ -100,22 +162,11 @@ export interface Layer7TimeseriesParams { */ dateStart?: Array; - /** - * Together with the `location` parameter, will apply the filter to origin or - * target location. - */ - direction?: 'ORIGIN' | 'TARGET'; - /** * Format results are returned in. */ format?: 'JSON' | 'CSV'; - /** - * Filter for ip version. - */ - ipVersion?: Array<'IPv4' | 'IPv6'>; - /** * Array of comma separated list of locations (alpha-2 country codes). Start with * `-` to exclude from results. For example, `-US,PT` excludes results from the US, @@ -123,11 +174,6 @@ export interface Layer7TimeseriesParams { */ location?: Array; - /** - * Measurement units, eg. bytes. - */ - metric?: 'BYTES' | 'BYTES_OLD'; - /** * Array of names that will be used to name the series in responses. */ @@ -138,45 +184,40 @@ export interface Layer7TimeseriesParams { * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). */ normalization?: 'PERCENTAGE_CHANGE' | 'MIN0_MAX'; - - /** - * Array of L3/4 attack types. - */ - protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; } export namespace Layer7 { export import Layer7TimeseriesResponse = Layer7API.Layer7TimeseriesResponse; export import Layer7TimeseriesParams = Layer7API.Layer7TimeseriesParams; export import Summary = SummaryAPI.Summary; - export import SummaryBitrateResponse = SummaryAPI.SummaryBitrateResponse; - export import SummaryDurationResponse = SummaryAPI.SummaryDurationResponse; export import SummaryGetResponse = SummaryAPI.SummaryGetResponse; + export import SummaryHTTPMethodResponse = SummaryAPI.SummaryHTTPMethodResponse; + export import SummaryHTTPVersionResponse = SummaryAPI.SummaryHTTPVersionResponse; export import SummaryIPVersionResponse = SummaryAPI.SummaryIPVersionResponse; - export import SummaryProtocolResponse = SummaryAPI.SummaryProtocolResponse; - export import SummaryVectorResponse = SummaryAPI.SummaryVectorResponse; - export import SummaryBitrateParams = SummaryAPI.SummaryBitrateParams; - export import SummaryDurationParams = SummaryAPI.SummaryDurationParams; + export import SummaryManagedRulesResponse = SummaryAPI.SummaryManagedRulesResponse; + export import SummaryMitigationProductResponse = SummaryAPI.SummaryMitigationProductResponse; export import SummaryGetParams = SummaryAPI.SummaryGetParams; + export import SummaryHTTPMethodParams = SummaryAPI.SummaryHTTPMethodParams; + export import SummaryHTTPVersionParams = SummaryAPI.SummaryHTTPVersionParams; export import SummaryIPVersionParams = SummaryAPI.SummaryIPVersionParams; - export import SummaryProtocolParams = SummaryAPI.SummaryProtocolParams; - export import SummaryVectorParams = SummaryAPI.SummaryVectorParams; + export import SummaryManagedRulesParams = SummaryAPI.SummaryManagedRulesParams; + export import SummaryMitigationProductParams = SummaryAPI.SummaryMitigationProductParams; export import TimeseriesGroups = TimeseriesGroupsAPI.TimeseriesGroups; - export import TimeseriesGroupBitrateResponse = TimeseriesGroupsAPI.TimeseriesGroupBitrateResponse; - export import TimeseriesGroupDurationResponse = TimeseriesGroupsAPI.TimeseriesGroupDurationResponse; export import TimeseriesGroupGetResponse = TimeseriesGroupsAPI.TimeseriesGroupGetResponse; + export import TimeseriesGroupHTTPMethodResponse = TimeseriesGroupsAPI.TimeseriesGroupHTTPMethodResponse; + export import TimeseriesGroupHTTPVersionResponse = TimeseriesGroupsAPI.TimeseriesGroupHTTPVersionResponse; export import TimeseriesGroupIndustryResponse = TimeseriesGroupsAPI.TimeseriesGroupIndustryResponse; export import TimeseriesGroupIPVersionResponse = TimeseriesGroupsAPI.TimeseriesGroupIPVersionResponse; - export import TimeseriesGroupProtocolResponse = TimeseriesGroupsAPI.TimeseriesGroupProtocolResponse; - export import TimeseriesGroupVectorResponse = TimeseriesGroupsAPI.TimeseriesGroupVectorResponse; + export import TimeseriesGroupManagedRulesResponse = TimeseriesGroupsAPI.TimeseriesGroupManagedRulesResponse; + export import TimeseriesGroupMitigationProductResponse = TimeseriesGroupsAPI.TimeseriesGroupMitigationProductResponse; export import TimeseriesGroupVerticalResponse = TimeseriesGroupsAPI.TimeseriesGroupVerticalResponse; - export import TimeseriesGroupBitrateParams = TimeseriesGroupsAPI.TimeseriesGroupBitrateParams; - export import TimeseriesGroupDurationParams = TimeseriesGroupsAPI.TimeseriesGroupDurationParams; export import TimeseriesGroupGetParams = TimeseriesGroupsAPI.TimeseriesGroupGetParams; + export import TimeseriesGroupHTTPMethodParams = TimeseriesGroupsAPI.TimeseriesGroupHTTPMethodParams; + export import TimeseriesGroupHTTPVersionParams = TimeseriesGroupsAPI.TimeseriesGroupHTTPVersionParams; export import TimeseriesGroupIndustryParams = TimeseriesGroupsAPI.TimeseriesGroupIndustryParams; export import TimeseriesGroupIPVersionParams = TimeseriesGroupsAPI.TimeseriesGroupIPVersionParams; - export import TimeseriesGroupProtocolParams = TimeseriesGroupsAPI.TimeseriesGroupProtocolParams; - export import TimeseriesGroupVectorParams = TimeseriesGroupsAPI.TimeseriesGroupVectorParams; + export import TimeseriesGroupManagedRulesParams = TimeseriesGroupsAPI.TimeseriesGroupManagedRulesParams; + export import TimeseriesGroupMitigationProductParams = TimeseriesGroupsAPI.TimeseriesGroupMitigationProductParams; export import TimeseriesGroupVerticalParams = TimeseriesGroupsAPI.TimeseriesGroupVerticalParams; export import Top = TopAPI.Top; export import TopAttacksResponse = TopAPI.TopAttacksResponse; diff --git a/src/resources/radar/attacks/layer7/summary.ts b/src/resources/radar/attacks/layer7/summary.ts index ef28bf8d86..bedcd3cc9d 100644 --- a/src/resources/radar/attacks/layer7/summary.ts +++ b/src/resources/radar/attacks/layer7/summary.ts @@ -7,66 +7,67 @@ import * as SummaryAPI from 'cloudflare/resources/radar/attacks/layer7/summary'; export class Summary extends APIResource { /** - * Percentage distribution of attacks by bitrate. + * Percentage distribution of mitigation techniques in Layer 7 attacks. */ - bitrate( - query?: SummaryBitrateParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - bitrate(options?: Core.RequestOptions): Core.APIPromise; - bitrate( - query: SummaryBitrateParams | Core.RequestOptions = {}, + get(query?: SummaryGetParams, options?: Core.RequestOptions): Core.APIPromise; + get(options?: Core.RequestOptions): Core.APIPromise; + get( + query: SummaryGetParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { if (isRequestOptions(query)) { - return this.bitrate({}, query); + return this.get({}, query); } return ( - this._client.get('/radar/attacks/layer3/summary/bitrate', { query, ...options }) as Core.APIPromise<{ - result: SummaryBitrateResponse; + this._client.get('/radar/attacks/layer7/summary', { query, ...options }) as Core.APIPromise<{ + result: SummaryGetResponse; }> )._thenUnwrap((obj) => obj.result); } /** - * Percentage distribution of attacks by duration. + * Percentage distribution of attacks by http method used. */ - duration( - query?: SummaryDurationParams, + httpMethod( + query?: SummaryHTTPMethodParams, options?: Core.RequestOptions, - ): Core.APIPromise; - duration(options?: Core.RequestOptions): Core.APIPromise; - duration( - query: SummaryDurationParams | Core.RequestOptions = {}, + ): Core.APIPromise; + httpMethod(options?: Core.RequestOptions): Core.APIPromise; + httpMethod( + query: SummaryHTTPMethodParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { if (isRequestOptions(query)) { - return this.duration({}, query); + return this.httpMethod({}, query); } return ( - this._client.get('/radar/attacks/layer3/summary/duration', { query, ...options }) as Core.APIPromise<{ - result: SummaryDurationResponse; - }> + this._client.get('/radar/attacks/layer7/summary/http_method', { + query, + ...options, + }) as Core.APIPromise<{ result: SummaryHTTPMethodResponse }> )._thenUnwrap((obj) => obj.result); } /** - * Percentage distribution of network protocols in layer 3/4 attacks over a given - * time period. + * Percentage distribution of attacks by http version used. */ - get(query?: SummaryGetParams, options?: Core.RequestOptions): Core.APIPromise; - get(options?: Core.RequestOptions): Core.APIPromise; - get( - query: SummaryGetParams | Core.RequestOptions = {}, + httpVersion( + query?: SummaryHTTPVersionParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise; + httpVersion(options?: Core.RequestOptions): Core.APIPromise; + httpVersion( + query: SummaryHTTPVersionParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { if (isRequestOptions(query)) { - return this.get({}, query); + return this.httpVersion({}, query); } return ( - this._client.get('/radar/attacks/layer3/summary', { query, ...options }) as Core.APIPromise<{ - result: SummaryGetResponse; - }> + this._client.get('/radar/attacks/layer7/summary/http_version', { + query, + ...options, + }) as Core.APIPromise<{ result: SummaryHTTPVersionResponse }> )._thenUnwrap((obj) => obj.result); } @@ -86,68 +87,69 @@ export class Summary extends APIResource { return this.ipVersion({}, query); } return ( - this._client.get('/radar/attacks/layer3/summary/ip_version', { query, ...options }) as Core.APIPromise<{ + this._client.get('/radar/attacks/layer7/summary/ip_version', { query, ...options }) as Core.APIPromise<{ result: SummaryIPVersionResponse; }> )._thenUnwrap((obj) => obj.result); } /** - * Percentage distribution of attacks by protocol used. + * Percentage distribution of attacks by managed rules used. */ - protocol( - query?: SummaryProtocolParams, + managedRules( + query?: SummaryManagedRulesParams, options?: Core.RequestOptions, - ): Core.APIPromise; - protocol(options?: Core.RequestOptions): Core.APIPromise; - protocol( - query: SummaryProtocolParams | Core.RequestOptions = {}, + ): Core.APIPromise; + managedRules(options?: Core.RequestOptions): Core.APIPromise; + managedRules( + query: SummaryManagedRulesParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { if (isRequestOptions(query)) { - return this.protocol({}, query); + return this.managedRules({}, query); } return ( - this._client.get('/radar/attacks/layer3/summary/protocol', { query, ...options }) as Core.APIPromise<{ - result: SummaryProtocolResponse; - }> + this._client.get('/radar/attacks/layer7/summary/managed_rules', { + query, + ...options, + }) as Core.APIPromise<{ result: SummaryManagedRulesResponse }> )._thenUnwrap((obj) => obj.result); } /** - * Percentage distribution of attacks by vector. + * Percentage distribution of attacks by mitigation product used. */ - vector(query?: SummaryVectorParams, options?: Core.RequestOptions): Core.APIPromise; - vector(options?: Core.RequestOptions): Core.APIPromise; - vector( - query: SummaryVectorParams | Core.RequestOptions = {}, + mitigationProduct( + query?: SummaryMitigationProductParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise; + mitigationProduct(options?: Core.RequestOptions): Core.APIPromise; + mitigationProduct( + query: SummaryMitigationProductParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { if (isRequestOptions(query)) { - return this.vector({}, query); + return this.mitigationProduct({}, query); } return ( - this._client.get('/radar/attacks/layer3/summary/vector', { query, ...options }) as Core.APIPromise<{ - result: SummaryVectorResponse; - }> + this._client.get('/radar/attacks/layer7/summary/mitigation_product', { + query, + ...options, + }) as Core.APIPromise<{ result: SummaryMitigationProductResponse }> )._thenUnwrap((obj) => obj.result); } } -export interface SummaryBitrateResponse { - meta: SummaryBitrateResponse.Meta; +export interface SummaryGetResponse { + meta: SummaryGetResponse.Meta; - summary_0: SummaryBitrateResponse.Summary0; + summary_0: SummaryGetResponse.Summary0; } -export namespace SummaryBitrateResponse { +export namespace SummaryGetResponse { export interface Meta { dateRange: Array; - lastUpdated: string; - - normalization: string; - confidenceInfo?: Meta.ConfidenceInfo; } @@ -190,25 +192,29 @@ export namespace SummaryBitrateResponse { } export interface Summary0 { - _1_GBPS_TO_10_GBPS: string; + ACCESS_RULES: string; - _10_GBPS_TO_100_GBPS: string; + API_SHIELD: string; - _500_MBPS_TO_1_GBPS: string; + BOT_MANAGEMENT: string; - OVER_100_GBPS: string; + DATA_LOSS_PREVENTION: string; - UNDER_500_MBPS: string; + DDOS: string; + + IP_REPUTATION: string; + + WAF: string; } } -export interface SummaryDurationResponse { - meta: SummaryDurationResponse.Meta; +export interface SummaryHTTPMethodResponse { + meta: SummaryHTTPMethodResponse.Meta; - summary_0: SummaryDurationResponse.Summary0; + summary_0: SummaryHTTPMethodResponse.Summary0; } -export namespace SummaryDurationResponse { +export namespace SummaryHTTPMethodResponse { export interface Meta { dateRange: Array; @@ -258,30 +264,26 @@ export namespace SummaryDurationResponse { } export interface Summary0 { - _1_HOUR_TO_3_HOURS: string; - - _10_MINS_TO_20_MINS: string; - - _20_MINS_TO_40_MINS: string; - - _40_MINS_TO_1_HOUR: string; + GET: string; - OVER_3_HOURS: string; - - UNDER_10_MINS: string; + POST: string; } } -export interface SummaryGetResponse { - meta: SummaryGetResponse.Meta; +export interface SummaryHTTPVersionResponse { + meta: SummaryHTTPVersionResponse.Meta; - summary_0: SummaryGetResponse.Summary0; + summary_0: SummaryHTTPVersionResponse.Summary0; } -export namespace SummaryGetResponse { +export namespace SummaryHTTPVersionResponse { export interface Meta { dateRange: Array; + lastUpdated: string; + + normalization: string; + confidenceInfo?: Meta.ConfidenceInfo; } @@ -324,13 +326,11 @@ export namespace SummaryGetResponse { } export interface Summary0 { - gre: string; + 'HTTP/1.x': string; - icmp: string; + 'HTTP/2': string; - tcp: string; - - udp: string; + 'HTTP/3': string; } } @@ -396,13 +396,13 @@ export namespace SummaryIPVersionResponse { } } -export interface SummaryProtocolResponse { - meta: SummaryProtocolResponse.Meta; +export interface SummaryManagedRulesResponse { + meta: SummaryManagedRulesResponse.Meta; - summary_0: SummaryProtocolResponse.Summary0; + summary_0: SummaryManagedRulesResponse.Summary0; } -export namespace SummaryProtocolResponse { +export namespace SummaryManagedRulesResponse { export interface Meta { dateRange: Array; @@ -452,23 +452,19 @@ export namespace SummaryProtocolResponse { } export interface Summary0 { - GRE: string; - - ICMP: string; - - TCP: string; + Bot: string; - UDP: string; + 'HTTP Anomaly': string; } } -export interface SummaryVectorResponse { - meta: SummaryVectorResponse.Meta; +export interface SummaryMitigationProductResponse { + meta: SummaryMitigationProductResponse.Meta; - summary_0: Record>; + summary_0: SummaryMitigationProductResponse.Summary0; } -export namespace SummaryVectorResponse { +export namespace SummaryMitigationProductResponse { export interface Meta { dateRange: Array; @@ -516,9 +512,22 @@ export namespace SummaryVectorResponse { } } } + + export interface Summary0 { + DDOS: string; + + WAF: string; + } } -export interface SummaryBitrateParams { +export interface SummaryGetParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + /** * End of the date range (inclusive). */ @@ -552,22 +561,11 @@ export interface SummaryBitrateParams { */ dateStart?: Array; - /** - * Together with the `location` parameter, will apply the filter to origin or - * target location. - */ - direction?: 'ORIGIN' | 'TARGET'; - /** * Format results are returned in. */ format?: 'JSON' | 'CSV'; - /** - * Filter for ip version. - */ - ipVersion?: Array<'IPv4' | 'IPv6'>; - /** * Array of comma separated list of locations (alpha-2 country codes). Start with * `-` to exclude from results. For example, `-US,PT` excludes results from the US, @@ -579,14 +577,16 @@ export interface SummaryBitrateParams { * Array of names that will be used to name the series in responses. */ name?: Array; +} +export interface SummaryHTTPMethodParams { /** - * Array of L3/4 attack types. + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. */ - protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; -} + asn?: Array; -export interface SummaryDurationParams { /** * End of the date range (inclusive). */ @@ -621,15 +621,14 @@ export interface SummaryDurationParams { dateStart?: Array; /** - * Together with the `location` parameter, will apply the filter to origin or - * target location. + * Format results are returned in. */ - direction?: 'ORIGIN' | 'TARGET'; + format?: 'JSON' | 'CSV'; /** - * Format results are returned in. + * Filter for http version. */ - format?: 'JSON' | 'CSV'; + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; /** * Filter for ip version. @@ -644,17 +643,25 @@ export interface SummaryDurationParams { location?: Array; /** - * Array of names that will be used to name the series in responses. + * Array of L7 mitigation products. */ - name?: Array; + mitigationProduct?: Array< + | 'DDOS' + | 'WAF' + | 'BOT_MANAGEMENT' + | 'ACCESS_RULES' + | 'IP_REPUTATION' + | 'API_SHIELD' + | 'DATA_LOSS_PREVENTION' + >; /** - * Array of L3/4 attack types. + * Array of names that will be used to name the series in responses. */ - protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; + name?: Array; } -export interface SummaryGetParams { +export interface SummaryHTTPVersionParams { /** * Array of comma separated list of ASNs, start with `-` to exclude from results. * For example, `-174, 3356` excludes results from AS174, but includes results from @@ -700,6 +707,63 @@ export interface SummaryGetParams { */ format?: 'JSON' | 'CSV'; + /** + * Filter for http method. + */ + httpMethod?: Array< + | 'GET' + | 'POST' + | 'DELETE' + | 'PUT' + | 'HEAD' + | 'PURGE' + | 'OPTIONS' + | 'PROPFIND' + | 'MKCOL' + | 'PATCH' + | 'ACL' + | 'BCOPY' + | 'BDELETE' + | 'BMOVE' + | 'BPROPFIND' + | 'BPROPPATCH' + | 'CHECKIN' + | 'CHECKOUT' + | 'CONNECT' + | 'COPY' + | 'LABEL' + | 'LOCK' + | 'MERGE' + | 'MKACTIVITY' + | 'MKWORKSPACE' + | 'MOVE' + | 'NOTIFY' + | 'ORDERPATCH' + | 'POLL' + | 'PROPPATCH' + | 'REPORT' + | 'SEARCH' + | 'SUBSCRIBE' + | 'TRACE' + | 'UNCHECKOUT' + | 'UNLOCK' + | 'UNSUBSCRIBE' + | 'UPDATE' + | 'VERSIONCONTROL' + | 'BASELINECONTROL' + | 'XMSENUMATTS' + | 'RPC_OUT_DATA' + | 'RPC_IN_DATA' + | 'JSON' + | 'COOK' + | 'TRACK' + >; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + /** * Array of comma separated list of locations (alpha-2 country codes). Start with * `-` to exclude from results. For example, `-US,PT` excludes results from the US, @@ -707,6 +771,19 @@ export interface SummaryGetParams { */ location?: Array; + /** + * Array of L7 mitigation products. + */ + mitigationProduct?: Array< + | 'DDOS' + | 'WAF' + | 'BOT_MANAGEMENT' + | 'ACCESS_RULES' + | 'IP_REPUTATION' + | 'API_SHIELD' + | 'DATA_LOSS_PREVENTION' + >; + /** * Array of names that will be used to name the series in responses. */ @@ -714,6 +791,13 @@ export interface SummaryGetParams { } export interface SummaryIPVersionParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + /** * End of the date range (inclusive). */ @@ -748,15 +832,66 @@ export interface SummaryIPVersionParams { dateStart?: Array; /** - * Together with the `location` parameter, will apply the filter to origin or - * target location. + * Format results are returned in. */ - direction?: 'ORIGIN' | 'TARGET'; + format?: 'JSON' | 'CSV'; /** - * Format results are returned in. + * Filter for http method. */ - format?: 'JSON' | 'CSV'; + httpMethod?: Array< + | 'GET' + | 'POST' + | 'DELETE' + | 'PUT' + | 'HEAD' + | 'PURGE' + | 'OPTIONS' + | 'PROPFIND' + | 'MKCOL' + | 'PATCH' + | 'ACL' + | 'BCOPY' + | 'BDELETE' + | 'BMOVE' + | 'BPROPFIND' + | 'BPROPPATCH' + | 'CHECKIN' + | 'CHECKOUT' + | 'CONNECT' + | 'COPY' + | 'LABEL' + | 'LOCK' + | 'MERGE' + | 'MKACTIVITY' + | 'MKWORKSPACE' + | 'MOVE' + | 'NOTIFY' + | 'ORDERPATCH' + | 'POLL' + | 'PROPPATCH' + | 'REPORT' + | 'SEARCH' + | 'SUBSCRIBE' + | 'TRACE' + | 'UNCHECKOUT' + | 'UNLOCK' + | 'UNSUBSCRIBE' + | 'UPDATE' + | 'VERSIONCONTROL' + | 'BASELINECONTROL' + | 'XMSENUMATTS' + | 'RPC_OUT_DATA' + | 'RPC_IN_DATA' + | 'JSON' + | 'COOK' + | 'TRACK' + >; + + /** + * Filter for http version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; /** * Array of comma separated list of locations (alpha-2 country codes). Start with @@ -765,18 +900,33 @@ export interface SummaryIPVersionParams { */ location?: Array; + /** + * Array of L7 mitigation products. + */ + mitigationProduct?: Array< + | 'DDOS' + | 'WAF' + | 'BOT_MANAGEMENT' + | 'ACCESS_RULES' + | 'IP_REPUTATION' + | 'API_SHIELD' + | 'DATA_LOSS_PREVENTION' + >; + /** * Array of names that will be used to name the series in responses. */ name?: Array; +} +export interface SummaryManagedRulesParams { /** - * Array of L3/4 attack types. + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. */ - protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; -} + asn?: Array; -export interface SummaryProtocolParams { /** * End of the date range (inclusive). */ @@ -811,15 +961,66 @@ export interface SummaryProtocolParams { dateStart?: Array; /** - * Together with the `location` parameter, will apply the filter to origin or - * target location. + * Format results are returned in. */ - direction?: 'ORIGIN' | 'TARGET'; + format?: 'JSON' | 'CSV'; /** - * Format results are returned in. + * Filter for http method. */ - format?: 'JSON' | 'CSV'; + httpMethod?: Array< + | 'GET' + | 'POST' + | 'DELETE' + | 'PUT' + | 'HEAD' + | 'PURGE' + | 'OPTIONS' + | 'PROPFIND' + | 'MKCOL' + | 'PATCH' + | 'ACL' + | 'BCOPY' + | 'BDELETE' + | 'BMOVE' + | 'BPROPFIND' + | 'BPROPPATCH' + | 'CHECKIN' + | 'CHECKOUT' + | 'CONNECT' + | 'COPY' + | 'LABEL' + | 'LOCK' + | 'MERGE' + | 'MKACTIVITY' + | 'MKWORKSPACE' + | 'MOVE' + | 'NOTIFY' + | 'ORDERPATCH' + | 'POLL' + | 'PROPPATCH' + | 'REPORT' + | 'SEARCH' + | 'SUBSCRIBE' + | 'TRACE' + | 'UNCHECKOUT' + | 'UNLOCK' + | 'UNSUBSCRIBE' + | 'UPDATE' + | 'VERSIONCONTROL' + | 'BASELINECONTROL' + | 'XMSENUMATTS' + | 'RPC_OUT_DATA' + | 'RPC_IN_DATA' + | 'JSON' + | 'COOK' + | 'TRACK' + >; + + /** + * Filter for http version. + */ + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; /** * Filter for ip version. @@ -833,13 +1034,33 @@ export interface SummaryProtocolParams { */ location?: Array; + /** + * Array of L7 mitigation products. + */ + mitigationProduct?: Array< + | 'DDOS' + | 'WAF' + | 'BOT_MANAGEMENT' + | 'ACCESS_RULES' + | 'IP_REPUTATION' + | 'API_SHIELD' + | 'DATA_LOSS_PREVENTION' + >; + /** * Array of names that will be used to name the series in responses. */ name?: Array; } -export interface SummaryVectorParams { +export interface SummaryMitigationProductParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + /** * End of the date range (inclusive). */ @@ -874,15 +1095,66 @@ export interface SummaryVectorParams { dateStart?: Array; /** - * Together with the `location` parameter, will apply the filter to origin or - * target location. + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filter for http method. */ - direction?: 'ORIGIN' | 'TARGET'; + httpMethod?: Array< + | 'GET' + | 'POST' + | 'DELETE' + | 'PUT' + | 'HEAD' + | 'PURGE' + | 'OPTIONS' + | 'PROPFIND' + | 'MKCOL' + | 'PATCH' + | 'ACL' + | 'BCOPY' + | 'BDELETE' + | 'BMOVE' + | 'BPROPFIND' + | 'BPROPPATCH' + | 'CHECKIN' + | 'CHECKOUT' + | 'CONNECT' + | 'COPY' + | 'LABEL' + | 'LOCK' + | 'MERGE' + | 'MKACTIVITY' + | 'MKWORKSPACE' + | 'MOVE' + | 'NOTIFY' + | 'ORDERPATCH' + | 'POLL' + | 'PROPPATCH' + | 'REPORT' + | 'SEARCH' + | 'SUBSCRIBE' + | 'TRACE' + | 'UNCHECKOUT' + | 'UNLOCK' + | 'UNSUBSCRIBE' + | 'UPDATE' + | 'VERSIONCONTROL' + | 'BASELINECONTROL' + | 'XMSENUMATTS' + | 'RPC_OUT_DATA' + | 'RPC_IN_DATA' + | 'JSON' + | 'COOK' + | 'TRACK' + >; /** - * Format results are returned in. + * Filter for http version. */ - format?: 'JSON' | 'CSV'; + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; /** * Filter for ip version. @@ -900,24 +1172,19 @@ export interface SummaryVectorParams { * Array of names that will be used to name the series in responses. */ name?: Array; - - /** - * Array of L3/4 attack types. - */ - protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; } export namespace Summary { - export import SummaryBitrateResponse = SummaryAPI.SummaryBitrateResponse; - export import SummaryDurationResponse = SummaryAPI.SummaryDurationResponse; export import SummaryGetResponse = SummaryAPI.SummaryGetResponse; + export import SummaryHTTPMethodResponse = SummaryAPI.SummaryHTTPMethodResponse; + export import SummaryHTTPVersionResponse = SummaryAPI.SummaryHTTPVersionResponse; export import SummaryIPVersionResponse = SummaryAPI.SummaryIPVersionResponse; - export import SummaryProtocolResponse = SummaryAPI.SummaryProtocolResponse; - export import SummaryVectorResponse = SummaryAPI.SummaryVectorResponse; - export import SummaryBitrateParams = SummaryAPI.SummaryBitrateParams; - export import SummaryDurationParams = SummaryAPI.SummaryDurationParams; + export import SummaryManagedRulesResponse = SummaryAPI.SummaryManagedRulesResponse; + export import SummaryMitigationProductResponse = SummaryAPI.SummaryMitigationProductResponse; export import SummaryGetParams = SummaryAPI.SummaryGetParams; + export import SummaryHTTPMethodParams = SummaryAPI.SummaryHTTPMethodParams; + export import SummaryHTTPVersionParams = SummaryAPI.SummaryHTTPVersionParams; export import SummaryIPVersionParams = SummaryAPI.SummaryIPVersionParams; - export import SummaryProtocolParams = SummaryAPI.SummaryProtocolParams; - export import SummaryVectorParams = SummaryAPI.SummaryVectorParams; + export import SummaryManagedRulesParams = SummaryAPI.SummaryManagedRulesParams; + export import SummaryMitigationProductParams = SummaryAPI.SummaryMitigationProductParams; } diff --git a/src/resources/radar/attacks/layer7/timeseries-groups.ts b/src/resources/radar/attacks/layer7/timeseries-groups.ts index 53192fd83a..ec1aa04384 100644 --- a/src/resources/radar/attacks/layer7/timeseries-groups.ts +++ b/src/resources/radar/attacks/layer7/timeseries-groups.ts @@ -7,71 +7,71 @@ import * as TimeseriesGroupsAPI from 'cloudflare/resources/radar/attacks/layer7/ export class TimeseriesGroups extends APIResource { /** - * Percentage distribution of attacks by bitrate over time. + * Get a time series of the percentual distribution of mitigation techniques, over + * time. */ - bitrate( - query?: TimeseriesGroupBitrateParams, + get( + query?: TimeseriesGroupGetParams, options?: Core.RequestOptions, - ): Core.APIPromise; - bitrate(options?: Core.RequestOptions): Core.APIPromise; - bitrate( - query: TimeseriesGroupBitrateParams | Core.RequestOptions = {}, + ): Core.APIPromise; + get(options?: Core.RequestOptions): Core.APIPromise; + get( + query: TimeseriesGroupGetParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { if (isRequestOptions(query)) { - return this.bitrate({}, query); + return this.get({}, query); } return ( - this._client.get('/radar/attacks/layer3/timeseries_groups/bitrate', { - query, - ...options, - }) as Core.APIPromise<{ result: TimeseriesGroupBitrateResponse }> + this._client.get('/radar/attacks/layer7/timeseries_groups', { query, ...options }) as Core.APIPromise<{ + result: TimeseriesGroupGetResponse; + }> )._thenUnwrap((obj) => obj.result); } /** - * Percentage distribution of attacks by duration over time. + * Percentage distribution of attacks by http method used over time. */ - duration( - query?: TimeseriesGroupDurationParams, + httpMethod( + query?: TimeseriesGroupHTTPMethodParams, options?: Core.RequestOptions, - ): Core.APIPromise; - duration(options?: Core.RequestOptions): Core.APIPromise; - duration( - query: TimeseriesGroupDurationParams | Core.RequestOptions = {}, + ): Core.APIPromise; + httpMethod(options?: Core.RequestOptions): Core.APIPromise; + httpMethod( + query: TimeseriesGroupHTTPMethodParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { if (isRequestOptions(query)) { - return this.duration({}, query); + return this.httpMethod({}, query); } return ( - this._client.get('/radar/attacks/layer3/timeseries_groups/duration', { + this._client.get('/radar/attacks/layer7/timeseries_groups/http_method', { query, ...options, - }) as Core.APIPromise<{ result: TimeseriesGroupDurationResponse }> + }) as Core.APIPromise<{ result: TimeseriesGroupHTTPMethodResponse }> )._thenUnwrap((obj) => obj.result); } /** - * Get a timeseries of the percentage distribution of network protocols in Layer - * 3/4 attacks. + * Percentage distribution of attacks by http version used over time. */ - get( - query?: TimeseriesGroupGetParams, + httpVersion( + query?: TimeseriesGroupHTTPVersionParams, options?: Core.RequestOptions, - ): Core.APIPromise; - get(options?: Core.RequestOptions): Core.APIPromise; - get( - query: TimeseriesGroupGetParams | Core.RequestOptions = {}, + ): Core.APIPromise; + httpVersion(options?: Core.RequestOptions): Core.APIPromise; + httpVersion( + query: TimeseriesGroupHTTPVersionParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { if (isRequestOptions(query)) { - return this.get({}, query); + return this.httpVersion({}, query); } return ( - this._client.get('/radar/attacks/layer3/timeseries_groups', { query, ...options }) as Core.APIPromise<{ - result: TimeseriesGroupGetResponse; - }> + this._client.get('/radar/attacks/layer7/timeseries_groups/http_version', { + query, + ...options, + }) as Core.APIPromise<{ result: TimeseriesGroupHTTPVersionResponse }> )._thenUnwrap((obj) => obj.result); } @@ -91,7 +91,7 @@ export class TimeseriesGroups extends APIResource { return this.industry({}, query); } return ( - this._client.get('/radar/attacks/layer3/timeseries_groups/industry', { + this._client.get('/radar/attacks/layer7/timeseries_groups/industry', { query, ...options, }) as Core.APIPromise<{ result: TimeseriesGroupIndustryResponse }> @@ -114,7 +114,7 @@ export class TimeseriesGroups extends APIResource { return this.ipVersion({}, query); } return ( - this._client.get('/radar/attacks/layer3/timeseries_groups/ip_version', { + this._client.get('/radar/attacks/layer7/timeseries_groups/ip_version', { query, ...options, }) as Core.APIPromise<{ result: TimeseriesGroupIPVersionResponse }> @@ -122,48 +122,48 @@ export class TimeseriesGroups extends APIResource { } /** - * Percentage distribution of attacks by protocol used over time. + * Percentage distribution of attacks by managed rules used over time. */ - protocol( - query?: TimeseriesGroupProtocolParams, + managedRules( + query?: TimeseriesGroupManagedRulesParams, options?: Core.RequestOptions, - ): Core.APIPromise; - protocol(options?: Core.RequestOptions): Core.APIPromise; - protocol( - query: TimeseriesGroupProtocolParams | Core.RequestOptions = {}, + ): Core.APIPromise; + managedRules(options?: Core.RequestOptions): Core.APIPromise; + managedRules( + query: TimeseriesGroupManagedRulesParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { if (isRequestOptions(query)) { - return this.protocol({}, query); + return this.managedRules({}, query); } return ( - this._client.get('/radar/attacks/layer3/timeseries_groups/protocol', { + this._client.get('/radar/attacks/layer7/timeseries_groups/managed_rules', { query, ...options, - }) as Core.APIPromise<{ result: TimeseriesGroupProtocolResponse }> + }) as Core.APIPromise<{ result: TimeseriesGroupManagedRulesResponse }> )._thenUnwrap((obj) => obj.result); } /** - * Percentage distribution of attacks by vector used over time. + * Percentage distribution of attacks by mitigation product used over time. */ - vector( - query?: TimeseriesGroupVectorParams, + mitigationProduct( + query?: TimeseriesGroupMitigationProductParams, options?: Core.RequestOptions, - ): Core.APIPromise; - vector(options?: Core.RequestOptions): Core.APIPromise; - vector( - query: TimeseriesGroupVectorParams | Core.RequestOptions = {}, + ): Core.APIPromise; + mitigationProduct(options?: Core.RequestOptions): Core.APIPromise; + mitigationProduct( + query: TimeseriesGroupMitigationProductParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { if (isRequestOptions(query)) { - return this.vector({}, query); + return this.mitigationProduct({}, query); } return ( - this._client.get('/radar/attacks/layer3/timeseries_groups/vector', { + this._client.get('/radar/attacks/layer7/timeseries_groups/mitigation_product', { query, ...options, - }) as Core.APIPromise<{ result: TimeseriesGroupVectorResponse }> + }) as Core.APIPromise<{ result: TimeseriesGroupMitigationProductResponse }> )._thenUnwrap((obj) => obj.result); } @@ -183,7 +183,7 @@ export class TimeseriesGroups extends APIResource { return this.vertical({}, query); } return ( - this._client.get('/radar/attacks/layer3/timeseries_groups/vertical', { + this._client.get('/radar/attacks/layer7/timeseries_groups/vertical', { query, ...options, }) as Core.APIPromise<{ result: TimeseriesGroupVerticalResponse }> @@ -191,52 +191,6 @@ export class TimeseriesGroups extends APIResource { } } -export interface TimeseriesGroupBitrateResponse { - meta: unknown; - - serie_0: TimeseriesGroupBitrateResponse.Serie0; -} - -export namespace TimeseriesGroupBitrateResponse { - export interface Serie0 { - _1_GBPS_TO_10_GBPS: Array; - - _10_GBPS_TO_100_GBPS: Array; - - _500_MBPS_TO_1_GBPS: Array; - - OVER_100_GBPS: Array; - - timestamps: Array; - - UNDER_500_MBPS: Array; - } -} - -export interface TimeseriesGroupDurationResponse { - meta: unknown; - - serie_0: TimeseriesGroupDurationResponse.Serie0; -} - -export namespace TimeseriesGroupDurationResponse { - export interface Serie0 { - _1_HOUR_TO_3_HOURS: Array; - - _10_MINS_TO_20_MINS: Array; - - _20_MINS_TO_40_MINS: Array; - - _40_MINS_TO_1_HOUR: Array; - - OVER_3_HOURS: Array; - - timestamps: Array; - - UNDER_10_MINS: Array; - } -} - export interface TimeseriesGroupGetResponse { meta: TimeseriesGroupGetResponse.Meta; @@ -293,15 +247,49 @@ export namespace TimeseriesGroupGetResponse { } export interface Serie0 { - gre: Array; + ACCESS_RULES: Array; + + API_SHIELD: Array; - icmp: Array; + BOT_MANAGEMENT: Array; - tcp: Array; + DATA_LOSS_PREVENTION: Array; + + DDOS: Array; + + IP_REPUTATION: Array; timestamps: Array; - udp: Array; + WAF: Array; + } +} + +export interface TimeseriesGroupHTTPMethodResponse { + meta: unknown; + + serie_0: TimeseriesGroupHTTPMethodResponse.Serie0; +} + +export namespace TimeseriesGroupHTTPMethodResponse { + export interface Serie0 { + GET: Array; + + timestamps: Array; + } +} + +export interface TimeseriesGroupHTTPVersionResponse { + meta: unknown; + + serie_0: TimeseriesGroupHTTPVersionResponse.Serie0; +} + +export namespace TimeseriesGroupHTTPVersionResponse { + export interface Serie0 { + 'HTTP/1.x': Array; + + timestamps: Array; } } @@ -334,36 +322,31 @@ export namespace TimeseriesGroupIPVersionResponse { } } -export interface TimeseriesGroupProtocolResponse { +export interface TimeseriesGroupManagedRulesResponse { meta: unknown; - serie_0: TimeseriesGroupProtocolResponse.Serie0; + serie_0: TimeseriesGroupManagedRulesResponse.Serie0; } -export namespace TimeseriesGroupProtocolResponse { +export namespace TimeseriesGroupManagedRulesResponse { export interface Serie0 { - GRE: Array; - - ICMP: Array; - - TCP: Array; + Bot: Array; timestamps: Array; - - UDP: Array; } } -export interface TimeseriesGroupVectorResponse { +export interface TimeseriesGroupMitigationProductResponse { meta: unknown; - serie_0: TimeseriesGroupVectorResponse.Serie0; + serie_0: TimeseriesGroupMitigationProductResponse.Serie0; } -export namespace TimeseriesGroupVectorResponse { +export namespace TimeseriesGroupMitigationProductResponse { export interface Serie0 { + DDOS: Array; + timestamps: Array; - [k: string]: Array; } } @@ -380,7 +363,7 @@ export namespace TimeseriesGroupVerticalResponse { } } -export interface TimeseriesGroupBitrateParams { +export interface TimeseriesGroupGetParams { /** * Aggregation interval results should be returned in (for example, in 15 minutes * or 1 hour intervals). Refer to @@ -388,6 +371,13 @@ export interface TimeseriesGroupBitrateParams { */ aggInterval?: '15m' | '1h' | '1d' | '1w'; + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + /** * End of the date range (inclusive). */ @@ -421,22 +411,11 @@ export interface TimeseriesGroupBitrateParams { */ dateStart?: Array; - /** - * Together with the `location` parameter, will apply the filter to origin or - * target location. - */ - direction?: 'ORIGIN' | 'TARGET'; - /** * Format results are returned in. */ format?: 'JSON' | 'CSV'; - /** - * Filter for ip version. - */ - ipVersion?: Array<'IPv4' | 'IPv6'>; - /** * Array of comma separated list of locations (alpha-2 country codes). Start with * `-` to exclude from results. For example, `-US,PT` excludes results from the US, @@ -448,20 +427,9 @@ export interface TimeseriesGroupBitrateParams { * Array of names that will be used to name the series in responses. */ name?: Array; - - /** - * Normalization method applied. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization?: 'PERCENTAGE' | 'MIN0_MAX'; - - /** - * Array of L3/4 attack types. - */ - protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; } -export interface TimeseriesGroupDurationParams { +export interface TimeseriesGroupHTTPMethodParams { /** * Aggregation interval results should be returned in (for example, in 15 minutes * or 1 hour intervals). Refer to @@ -469,6 +437,13 @@ export interface TimeseriesGroupDurationParams { */ aggInterval?: '15m' | '1h' | '1d' | '1w'; + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + /** * End of the date range (inclusive). */ @@ -503,15 +478,14 @@ export interface TimeseriesGroupDurationParams { dateStart?: Array; /** - * Together with the `location` parameter, will apply the filter to origin or - * target location. + * Format results are returned in. */ - direction?: 'ORIGIN' | 'TARGET'; + format?: 'JSON' | 'CSV'; /** - * Format results are returned in. + * Filter for http version. */ - format?: 'JSON' | 'CSV'; + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; /** * Filter for ip version. @@ -525,6 +499,19 @@ export interface TimeseriesGroupDurationParams { */ location?: Array; + /** + * Array of L7 mitigation products. + */ + mitigationProduct?: Array< + | 'DDOS' + | 'WAF' + | 'BOT_MANAGEMENT' + | 'ACCESS_RULES' + | 'IP_REPUTATION' + | 'API_SHIELD' + | 'DATA_LOSS_PREVENTION' + >; + /** * Array of names that will be used to name the series in responses. */ @@ -535,14 +522,9 @@ export interface TimeseriesGroupDurationParams { * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). */ normalization?: 'PERCENTAGE' | 'MIN0_MAX'; - - /** - * Array of L3/4 attack types. - */ - protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; } -export interface TimeseriesGroupGetParams { +export interface TimeseriesGroupHTTPVersionParams { /** * Aggregation interval results should be returned in (for example, in 15 minutes * or 1 hour intervals). Refer to @@ -595,6 +577,63 @@ export interface TimeseriesGroupGetParams { */ format?: 'JSON' | 'CSV'; + /** + * Filter for http method. + */ + httpMethod?: Array< + | 'GET' + | 'POST' + | 'DELETE' + | 'PUT' + | 'HEAD' + | 'PURGE' + | 'OPTIONS' + | 'PROPFIND' + | 'MKCOL' + | 'PATCH' + | 'ACL' + | 'BCOPY' + | 'BDELETE' + | 'BMOVE' + | 'BPROPFIND' + | 'BPROPPATCH' + | 'CHECKIN' + | 'CHECKOUT' + | 'CONNECT' + | 'COPY' + | 'LABEL' + | 'LOCK' + | 'MERGE' + | 'MKACTIVITY' + | 'MKWORKSPACE' + | 'MOVE' + | 'NOTIFY' + | 'ORDERPATCH' + | 'POLL' + | 'PROPPATCH' + | 'REPORT' + | 'SEARCH' + | 'SUBSCRIBE' + | 'TRACE' + | 'UNCHECKOUT' + | 'UNLOCK' + | 'UNSUBSCRIBE' + | 'UPDATE' + | 'VERSIONCONTROL' + | 'BASELINECONTROL' + | 'XMSENUMATTS' + | 'RPC_OUT_DATA' + | 'RPC_IN_DATA' + | 'JSON' + | 'COOK' + | 'TRACK' + >; + + /** + * Filter for ip version. + */ + ipVersion?: Array<'IPv4' | 'IPv6'>; + /** * Array of comma separated list of locations (alpha-2 country codes). Start with * `-` to exclude from results. For example, `-US,PT` excludes results from the US, @@ -602,10 +641,29 @@ export interface TimeseriesGroupGetParams { */ location?: Array; + /** + * Array of L7 mitigation products. + */ + mitigationProduct?: Array< + | 'DDOS' + | 'WAF' + | 'BOT_MANAGEMENT' + | 'ACCESS_RULES' + | 'IP_REPUTATION' + | 'API_SHIELD' + | 'DATA_LOSS_PREVENTION' + >; + /** * Array of names that will be used to name the series in responses. */ name?: Array; + + /** + * Normalization method applied. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE' | 'MIN0_MAX'; } export interface TimeseriesGroupIndustryParams { @@ -616,6 +674,13 @@ export interface TimeseriesGroupIndustryParams { */ aggInterval?: '15m' | '1h' | '1d' | '1w'; + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + /** * End of the date range (inclusive). */ @@ -650,15 +715,66 @@ export interface TimeseriesGroupIndustryParams { dateStart?: Array; /** - * Together with the `location` parameter, will apply the filter to origin or - * target location. + * Format results are returned in. */ - direction?: 'ORIGIN' | 'TARGET'; + format?: 'JSON' | 'CSV'; /** - * Format results are returned in. + * Filter for http method. + */ + httpMethod?: Array< + | 'GET' + | 'POST' + | 'DELETE' + | 'PUT' + | 'HEAD' + | 'PURGE' + | 'OPTIONS' + | 'PROPFIND' + | 'MKCOL' + | 'PATCH' + | 'ACL' + | 'BCOPY' + | 'BDELETE' + | 'BMOVE' + | 'BPROPFIND' + | 'BPROPPATCH' + | 'CHECKIN' + | 'CHECKOUT' + | 'CONNECT' + | 'COPY' + | 'LABEL' + | 'LOCK' + | 'MERGE' + | 'MKACTIVITY' + | 'MKWORKSPACE' + | 'MOVE' + | 'NOTIFY' + | 'ORDERPATCH' + | 'POLL' + | 'PROPPATCH' + | 'REPORT' + | 'SEARCH' + | 'SUBSCRIBE' + | 'TRACE' + | 'UNCHECKOUT' + | 'UNLOCK' + | 'UNSUBSCRIBE' + | 'UPDATE' + | 'VERSIONCONTROL' + | 'BASELINECONTROL' + | 'XMSENUMATTS' + | 'RPC_OUT_DATA' + | 'RPC_IN_DATA' + | 'JSON' + | 'COOK' + | 'TRACK' + >; + + /** + * Filter for http version. */ - format?: 'JSON' | 'CSV'; + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; /** * Filter for ip version. @@ -678,6 +794,19 @@ export interface TimeseriesGroupIndustryParams { */ location?: Array; + /** + * Array of L7 mitigation products. + */ + mitigationProduct?: Array< + | 'DDOS' + | 'WAF' + | 'BOT_MANAGEMENT' + | 'ACCESS_RULES' + | 'IP_REPUTATION' + | 'API_SHIELD' + | 'DATA_LOSS_PREVENTION' + >; + /** * Array of names that will be used to name the series in responses. */ @@ -698,6 +827,13 @@ export interface TimeseriesGroupIPVersionParams { */ aggInterval?: '15m' | '1h' | '1d' | '1w'; + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + /** * End of the date range (inclusive). */ @@ -732,15 +868,66 @@ export interface TimeseriesGroupIPVersionParams { dateStart?: Array; /** - * Together with the `location` parameter, will apply the filter to origin or - * target location. + * Format results are returned in. */ - direction?: 'ORIGIN' | 'TARGET'; + format?: 'JSON' | 'CSV'; /** - * Format results are returned in. + * Filter for http method. + */ + httpMethod?: Array< + | 'GET' + | 'POST' + | 'DELETE' + | 'PUT' + | 'HEAD' + | 'PURGE' + | 'OPTIONS' + | 'PROPFIND' + | 'MKCOL' + | 'PATCH' + | 'ACL' + | 'BCOPY' + | 'BDELETE' + | 'BMOVE' + | 'BPROPFIND' + | 'BPROPPATCH' + | 'CHECKIN' + | 'CHECKOUT' + | 'CONNECT' + | 'COPY' + | 'LABEL' + | 'LOCK' + | 'MERGE' + | 'MKACTIVITY' + | 'MKWORKSPACE' + | 'MOVE' + | 'NOTIFY' + | 'ORDERPATCH' + | 'POLL' + | 'PROPPATCH' + | 'REPORT' + | 'SEARCH' + | 'SUBSCRIBE' + | 'TRACE' + | 'UNCHECKOUT' + | 'UNLOCK' + | 'UNSUBSCRIBE' + | 'UPDATE' + | 'VERSIONCONTROL' + | 'BASELINECONTROL' + | 'XMSENUMATTS' + | 'RPC_OUT_DATA' + | 'RPC_IN_DATA' + | 'JSON' + | 'COOK' + | 'TRACK' + >; + + /** + * Filter for http version. */ - format?: 'JSON' | 'CSV'; + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; /** * Array of comma separated list of locations (alpha-2 country codes). Start with @@ -749,6 +936,19 @@ export interface TimeseriesGroupIPVersionParams { */ location?: Array; + /** + * Array of L7 mitigation products. + */ + mitigationProduct?: Array< + | 'DDOS' + | 'WAF' + | 'BOT_MANAGEMENT' + | 'ACCESS_RULES' + | 'IP_REPUTATION' + | 'API_SHIELD' + | 'DATA_LOSS_PREVENTION' + >; + /** * Array of names that will be used to name the series in responses. */ @@ -759,14 +959,9 @@ export interface TimeseriesGroupIPVersionParams { * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). */ normalization?: 'PERCENTAGE' | 'MIN0_MAX'; - - /** - * Array of L3/4 attack types. - */ - protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; } -export interface TimeseriesGroupProtocolParams { +export interface TimeseriesGroupManagedRulesParams { /** * Aggregation interval results should be returned in (for example, in 15 minutes * or 1 hour intervals). Refer to @@ -774,6 +969,13 @@ export interface TimeseriesGroupProtocolParams { */ aggInterval?: '15m' | '1h' | '1d' | '1w'; + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + /** * End of the date range (inclusive). */ @@ -808,15 +1010,66 @@ export interface TimeseriesGroupProtocolParams { dateStart?: Array; /** - * Together with the `location` parameter, will apply the filter to origin or - * target location. + * Format results are returned in. */ - direction?: 'ORIGIN' | 'TARGET'; + format?: 'JSON' | 'CSV'; /** - * Format results are returned in. + * Filter for http method. + */ + httpMethod?: Array< + | 'GET' + | 'POST' + | 'DELETE' + | 'PUT' + | 'HEAD' + | 'PURGE' + | 'OPTIONS' + | 'PROPFIND' + | 'MKCOL' + | 'PATCH' + | 'ACL' + | 'BCOPY' + | 'BDELETE' + | 'BMOVE' + | 'BPROPFIND' + | 'BPROPPATCH' + | 'CHECKIN' + | 'CHECKOUT' + | 'CONNECT' + | 'COPY' + | 'LABEL' + | 'LOCK' + | 'MERGE' + | 'MKACTIVITY' + | 'MKWORKSPACE' + | 'MOVE' + | 'NOTIFY' + | 'ORDERPATCH' + | 'POLL' + | 'PROPPATCH' + | 'REPORT' + | 'SEARCH' + | 'SUBSCRIBE' + | 'TRACE' + | 'UNCHECKOUT' + | 'UNLOCK' + | 'UNSUBSCRIBE' + | 'UPDATE' + | 'VERSIONCONTROL' + | 'BASELINECONTROL' + | 'XMSENUMATTS' + | 'RPC_OUT_DATA' + | 'RPC_IN_DATA' + | 'JSON' + | 'COOK' + | 'TRACK' + >; + + /** + * Filter for http version. */ - format?: 'JSON' | 'CSV'; + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; /** * Filter for ip version. @@ -830,6 +1083,19 @@ export interface TimeseriesGroupProtocolParams { */ location?: Array; + /** + * Array of L7 mitigation products. + */ + mitigationProduct?: Array< + | 'DDOS' + | 'WAF' + | 'BOT_MANAGEMENT' + | 'ACCESS_RULES' + | 'IP_REPUTATION' + | 'API_SHIELD' + | 'DATA_LOSS_PREVENTION' + >; + /** * Array of names that will be used to name the series in responses. */ @@ -842,7 +1108,7 @@ export interface TimeseriesGroupProtocolParams { normalization?: 'PERCENTAGE' | 'MIN0_MAX'; } -export interface TimeseriesGroupVectorParams { +export interface TimeseriesGroupMitigationProductParams { /** * Aggregation interval results should be returned in (for example, in 15 minutes * or 1 hour intervals). Refer to @@ -850,6 +1116,13 @@ export interface TimeseriesGroupVectorParams { */ aggInterval?: '15m' | '1h' | '1d' | '1w'; + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + /** * End of the date range (inclusive). */ @@ -883,27 +1156,72 @@ export interface TimeseriesGroupVectorParams { */ dateStart?: Array; - /** - * Together with the `location` parameter, will apply the filter to origin or - * target location. - */ - direction?: 'ORIGIN' | 'TARGET'; - /** * Format results are returned in. */ format?: 'JSON' | 'CSV'; /** - * Filter for ip version. + * Filter for http method. + */ + httpMethod?: Array< + | 'GET' + | 'POST' + | 'DELETE' + | 'PUT' + | 'HEAD' + | 'PURGE' + | 'OPTIONS' + | 'PROPFIND' + | 'MKCOL' + | 'PATCH' + | 'ACL' + | 'BCOPY' + | 'BDELETE' + | 'BMOVE' + | 'BPROPFIND' + | 'BPROPPATCH' + | 'CHECKIN' + | 'CHECKOUT' + | 'CONNECT' + | 'COPY' + | 'LABEL' + | 'LOCK' + | 'MERGE' + | 'MKACTIVITY' + | 'MKWORKSPACE' + | 'MOVE' + | 'NOTIFY' + | 'ORDERPATCH' + | 'POLL' + | 'PROPPATCH' + | 'REPORT' + | 'SEARCH' + | 'SUBSCRIBE' + | 'TRACE' + | 'UNCHECKOUT' + | 'UNLOCK' + | 'UNSUBSCRIBE' + | 'UPDATE' + | 'VERSIONCONTROL' + | 'BASELINECONTROL' + | 'XMSENUMATTS' + | 'RPC_OUT_DATA' + | 'RPC_IN_DATA' + | 'JSON' + | 'COOK' + | 'TRACK' + >; + + /** + * Filter for http version. */ - ipVersion?: Array<'IPv4' | 'IPv6'>; + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; /** - * Limit the number of objects (eg browsers, verticals, etc) to the top items over - * the time range. + * Filter for ip version. */ - limitPerGroup?: number; + ipVersion?: Array<'IPv4' | 'IPv6'>; /** * Array of comma separated list of locations (alpha-2 country codes). Start with @@ -922,11 +1240,6 @@ export interface TimeseriesGroupVectorParams { * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). */ normalization?: 'PERCENTAGE' | 'MIN0_MAX'; - - /** - * Array of L3/4 attack types. - */ - protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; } export interface TimeseriesGroupVerticalParams { @@ -937,6 +1250,13 @@ export interface TimeseriesGroupVerticalParams { */ aggInterval?: '15m' | '1h' | '1d' | '1w'; + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + /** * End of the date range (inclusive). */ @@ -971,15 +1291,66 @@ export interface TimeseriesGroupVerticalParams { dateStart?: Array; /** - * Together with the `location` parameter, will apply the filter to origin or - * target location. + * Format results are returned in. */ - direction?: 'ORIGIN' | 'TARGET'; + format?: 'JSON' | 'CSV'; /** - * Format results are returned in. + * Filter for http method. + */ + httpMethod?: Array< + | 'GET' + | 'POST' + | 'DELETE' + | 'PUT' + | 'HEAD' + | 'PURGE' + | 'OPTIONS' + | 'PROPFIND' + | 'MKCOL' + | 'PATCH' + | 'ACL' + | 'BCOPY' + | 'BDELETE' + | 'BMOVE' + | 'BPROPFIND' + | 'BPROPPATCH' + | 'CHECKIN' + | 'CHECKOUT' + | 'CONNECT' + | 'COPY' + | 'LABEL' + | 'LOCK' + | 'MERGE' + | 'MKACTIVITY' + | 'MKWORKSPACE' + | 'MOVE' + | 'NOTIFY' + | 'ORDERPATCH' + | 'POLL' + | 'PROPPATCH' + | 'REPORT' + | 'SEARCH' + | 'SUBSCRIBE' + | 'TRACE' + | 'UNCHECKOUT' + | 'UNLOCK' + | 'UNSUBSCRIBE' + | 'UPDATE' + | 'VERSIONCONTROL' + | 'BASELINECONTROL' + | 'XMSENUMATTS' + | 'RPC_OUT_DATA' + | 'RPC_IN_DATA' + | 'JSON' + | 'COOK' + | 'TRACK' + >; + + /** + * Filter for http version. */ - format?: 'JSON' | 'CSV'; + httpVersion?: Array<'HTTPv1' | 'HTTPv2' | 'HTTPv3'>; /** * Filter for ip version. @@ -999,6 +1370,19 @@ export interface TimeseriesGroupVerticalParams { */ location?: Array; + /** + * Array of L7 mitigation products. + */ + mitigationProduct?: Array< + | 'DDOS' + | 'WAF' + | 'BOT_MANAGEMENT' + | 'ACCESS_RULES' + | 'IP_REPUTATION' + | 'API_SHIELD' + | 'DATA_LOSS_PREVENTION' + >; + /** * Array of names that will be used to name the series in responses. */ @@ -1012,20 +1396,20 @@ export interface TimeseriesGroupVerticalParams { } export namespace TimeseriesGroups { - export import TimeseriesGroupBitrateResponse = TimeseriesGroupsAPI.TimeseriesGroupBitrateResponse; - export import TimeseriesGroupDurationResponse = TimeseriesGroupsAPI.TimeseriesGroupDurationResponse; export import TimeseriesGroupGetResponse = TimeseriesGroupsAPI.TimeseriesGroupGetResponse; + export import TimeseriesGroupHTTPMethodResponse = TimeseriesGroupsAPI.TimeseriesGroupHTTPMethodResponse; + export import TimeseriesGroupHTTPVersionResponse = TimeseriesGroupsAPI.TimeseriesGroupHTTPVersionResponse; export import TimeseriesGroupIndustryResponse = TimeseriesGroupsAPI.TimeseriesGroupIndustryResponse; export import TimeseriesGroupIPVersionResponse = TimeseriesGroupsAPI.TimeseriesGroupIPVersionResponse; - export import TimeseriesGroupProtocolResponse = TimeseriesGroupsAPI.TimeseriesGroupProtocolResponse; - export import TimeseriesGroupVectorResponse = TimeseriesGroupsAPI.TimeseriesGroupVectorResponse; + export import TimeseriesGroupManagedRulesResponse = TimeseriesGroupsAPI.TimeseriesGroupManagedRulesResponse; + export import TimeseriesGroupMitigationProductResponse = TimeseriesGroupsAPI.TimeseriesGroupMitigationProductResponse; export import TimeseriesGroupVerticalResponse = TimeseriesGroupsAPI.TimeseriesGroupVerticalResponse; - export import TimeseriesGroupBitrateParams = TimeseriesGroupsAPI.TimeseriesGroupBitrateParams; - export import TimeseriesGroupDurationParams = TimeseriesGroupsAPI.TimeseriesGroupDurationParams; export import TimeseriesGroupGetParams = TimeseriesGroupsAPI.TimeseriesGroupGetParams; + export import TimeseriesGroupHTTPMethodParams = TimeseriesGroupsAPI.TimeseriesGroupHTTPMethodParams; + export import TimeseriesGroupHTTPVersionParams = TimeseriesGroupsAPI.TimeseriesGroupHTTPVersionParams; export import TimeseriesGroupIndustryParams = TimeseriesGroupsAPI.TimeseriesGroupIndustryParams; export import TimeseriesGroupIPVersionParams = TimeseriesGroupsAPI.TimeseriesGroupIPVersionParams; - export import TimeseriesGroupProtocolParams = TimeseriesGroupsAPI.TimeseriesGroupProtocolParams; - export import TimeseriesGroupVectorParams = TimeseriesGroupsAPI.TimeseriesGroupVectorParams; + export import TimeseriesGroupManagedRulesParams = TimeseriesGroupsAPI.TimeseriesGroupManagedRulesParams; + export import TimeseriesGroupMitigationProductParams = TimeseriesGroupsAPI.TimeseriesGroupMitigationProductParams; export import TimeseriesGroupVerticalParams = TimeseriesGroupsAPI.TimeseriesGroupVerticalParams; } diff --git a/src/resources/radar/attacks/layer7/top/ases.ts b/src/resources/radar/attacks/layer7/top/ases.ts new file mode 100644 index 0000000000..ebb5d325d1 --- /dev/null +++ b/src/resources/radar/attacks/layer7/top/ases.ts @@ -0,0 +1,155 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as AsesAPI from 'cloudflare/resources/radar/attacks/layer7/top/ases'; + +export class Ases extends APIResource { + /** + * Get the top origin Autonomous Systems of and by layer 7 attacks. Values are a + * percentage out of the total layer 7 attacks. The origin Autonomous Systems is + * determined by the client IP. + */ + origin(query?: AseOriginParams, options?: Core.RequestOptions): Core.APIPromise; + origin(options?: Core.RequestOptions): Core.APIPromise; + origin( + query: AseOriginParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.origin({}, query); + } + return ( + this._client.get('/radar/attacks/layer7/top/ases/origin', { query, ...options }) as Core.APIPromise<{ + result: AseOriginResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface AseOriginResponse { + meta: AseOriginResponse.Meta; + + top_0: Array; +} + +export namespace AseOriginResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + originAsn: string; + + originAsnName: string; + + rank: number; + + value: string; + } +} + +export interface AseOriginParams { + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * For example, use `7d` and `7dControl` to compare this week with the previous + * week. Use this parameter or set specific start and end dates (`dateStart` and + * `dateEnd` parameters). + */ + dateRange?: Array< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; +} + +export namespace Ases { + export import AseOriginResponse = AsesAPI.AseOriginResponse; + export import AseOriginParams = AsesAPI.AseOriginParams; +} diff --git a/src/resources/radar/attacks/layer7/top/index.ts b/src/resources/radar/attacks/layer7/top/index.ts index bb58406b48..e8f88b3747 100644 --- a/src/resources/radar/attacks/layer7/top/index.ts +++ b/src/resources/radar/attacks/layer7/top/index.ts @@ -1,5 +1,6 @@ // File generated from our OpenAPI spec by Stainless. +export { AseOriginResponse, AseOriginParams, Ases } from './ases'; export { LocationOriginResponse, LocationTargetResponse, diff --git a/src/resources/radar/attacks/layer7/top/locations.ts b/src/resources/radar/attacks/layer7/top/locations.ts index 6f4ef7834b..85264525d7 100644 --- a/src/resources/radar/attacks/layer7/top/locations.ts +++ b/src/resources/radar/attacks/layer7/top/locations.ts @@ -7,7 +7,9 @@ import * as LocationsAPI from 'cloudflare/resources/radar/attacks/layer7/top/loc export class Locations extends APIResource { /** - * Get the origin locations of attacks. + * Get the top origin locations of and by layer 7 attacks. Values are a percentage + * out of the total layer 7 attacks. The origin location is determined by the + * client IP. */ origin( query?: LocationOriginParams, @@ -22,7 +24,7 @@ export class Locations extends APIResource { return this.origin({}, query); } return ( - this._client.get('/radar/attacks/layer3/top/locations/origin', { + this._client.get('/radar/attacks/layer7/top/locations/origin', { query, ...options, }) as Core.APIPromise<{ result: LocationOriginResponse }> @@ -30,7 +32,9 @@ export class Locations extends APIResource { } /** - * Get the target locations of attacks. + * Get the top target locations of and by layer 7 attacks. Values are a percentage + * out of the total layer 7 attacks. The target location is determined by the + * attacked zone's billing country, when available. */ target( query?: LocationTargetParams, @@ -45,7 +49,7 @@ export class Locations extends APIResource { return this.target({}, query); } return ( - this._client.get('/radar/attacks/layer3/top/locations/target', { + this._client.get('/radar/attacks/layer7/top/locations/target', { query, ...options, }) as Core.APIPromise<{ result: LocationTargetResponse }> @@ -182,6 +186,13 @@ export namespace LocationTargetResponse { } export interface LocationOriginParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + /** * End of the date range (inclusive). */ @@ -220,32 +231,15 @@ export interface LocationOriginParams { */ format?: 'JSON' | 'CSV'; - /** - * Filter for ip version. - */ - ipVersion?: Array<'IPv4' | 'IPv6'>; - /** * Limit the number of objects in the response. */ limit?: number; - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - /** * Array of names that will be used to name the series in responses. */ name?: Array; - - /** - * Array of L3/4 attack types. - */ - protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; } export interface LocationTargetParams { @@ -287,32 +281,15 @@ export interface LocationTargetParams { */ format?: 'JSON' | 'CSV'; - /** - * Filter for ip version. - */ - ipVersion?: Array<'IPv4' | 'IPv6'>; - /** * Limit the number of objects in the response. */ limit?: number; - /** - * Array of comma separated list of locations (alpha-2 country codes). Start with - * `-` to exclude from results. For example, `-US,PT` excludes results from the US, - * but includes results from PT. - */ - location?: Array; - /** * Array of names that will be used to name the series in responses. */ name?: Array; - - /** - * Array of L3/4 attack types. - */ - protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; } export namespace Locations { diff --git a/src/resources/radar/attacks/layer7/top/top.ts b/src/resources/radar/attacks/layer7/top/top.ts index 23568c1efb..cd8966883d 100644 --- a/src/resources/radar/attacks/layer7/top/top.ts +++ b/src/resources/radar/attacks/layer7/top/top.ts @@ -4,16 +4,19 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; import { isRequestOptions } from 'cloudflare/core'; import * as TopAPI from 'cloudflare/resources/radar/attacks/layer7/top/top'; +import * as AsesAPI from 'cloudflare/resources/radar/attacks/layer7/top/ases'; import * as LocationsAPI from 'cloudflare/resources/radar/attacks/layer7/top/locations'; export class Top extends APIResource { locations: LocationsAPI.Locations = new LocationsAPI.Locations(this._client); + ases: AsesAPI.Ases = new AsesAPI.Ases(this._client); /** * Get the top attacks from origin to target location. Values are a percentage out - * of the total layer 3 attacks (with billing country). You can optionally limit - * the number of attacks per origin/target location (useful if all the top attacks - * are from or to the same location). + * of the total layer 7 attacks (with billing country). The attack magnitude can be + * defined by the number of mitigated requests or by the number of zones affected. + * You can optionally limit the number of attacks per origin/target location + * (useful if all the top attacks are from or to the same location). */ attacks(query?: TopAttacksParams, options?: Core.RequestOptions): Core.APIPromise; attacks(options?: Core.RequestOptions): Core.APIPromise; @@ -25,7 +28,7 @@ export class Top extends APIResource { return this.attacks({}, query); } return ( - this._client.get('/radar/attacks/layer3/top/attacks', { query, ...options }) as Core.APIPromise<{ + this._client.get('/radar/attacks/layer7/top/attacks', { query, ...options }) as Core.APIPromise<{ result: TopAttacksResponse; }> )._thenUnwrap((obj) => obj.result); @@ -44,7 +47,7 @@ export class Top extends APIResource { return this.industry({}, query); } return ( - this._client.get('/radar/attacks/layer3/top/industry', { query, ...options }) as Core.APIPromise<{ + this._client.get('/radar/attacks/layer7/top/industry', { query, ...options }) as Core.APIPromise<{ result: TopIndustryResponse; }> )._thenUnwrap((obj) => obj.result); @@ -63,7 +66,7 @@ export class Top extends APIResource { return this.vertical({}, query); } return ( - this._client.get('/radar/attacks/layer3/top/vertical', { query, ...options }) as Core.APIPromise<{ + this._client.get('/radar/attacks/layer7/top/vertical', { query, ...options }) as Core.APIPromise<{ result: TopVerticalResponse; }> )._thenUnwrap((obj) => obj.result); @@ -128,6 +131,10 @@ export namespace TopAttacksResponse { originCountryName: string; + targetCountryAlpha2: string; + + targetCountryName: string; + value: string; } } @@ -253,6 +260,13 @@ export namespace TopVerticalResponse { } export interface TopAttacksParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + /** * End of the date range (inclusive). */ @@ -291,11 +305,6 @@ export interface TopAttacksParams { */ format?: 'JSON' | 'CSV'; - /** - * Filter for ip version. - */ - ipVersion?: Array<'IPv4' | 'IPv6'>; - /** * Limit the number of objects in the response. */ @@ -322,17 +331,25 @@ export interface TopAttacksParams { location?: Array; /** - * Array of names that will be used to name the series in responses. + * Attack magnitude can be defined by total requests mitigated or by total zones + * attacked. */ - name?: Array; + magnitude?: 'AFFECTED_ZONES' | 'MITIGATED_REQUESTS'; /** - * Array of L3/4 attack types. + * Array of names that will be used to name the series in responses. */ - protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; + name?: Array; } export interface TopIndustryParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + /** * End of the date range (inclusive). */ @@ -371,11 +388,6 @@ export interface TopIndustryParams { */ format?: 'JSON' | 'CSV'; - /** - * Filter for ip version. - */ - ipVersion?: Array<'IPv4' | 'IPv6'>; - /** * Limit the number of objects in the response. */ @@ -392,14 +404,16 @@ export interface TopIndustryParams { * Array of names that will be used to name the series in responses. */ name?: Array; +} +export interface TopVerticalParams { /** - * Array of L3/4 attack types. + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. */ - protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; -} + asn?: Array; -export interface TopVerticalParams { /** * End of the date range (inclusive). */ @@ -438,11 +452,6 @@ export interface TopVerticalParams { */ format?: 'JSON' | 'CSV'; - /** - * Filter for ip version. - */ - ipVersion?: Array<'IPv4' | 'IPv6'>; - /** * Limit the number of objects in the response. */ @@ -459,11 +468,6 @@ export interface TopVerticalParams { * Array of names that will be used to name the series in responses. */ name?: Array; - - /** - * Array of L3/4 attack types. - */ - protocol?: Array<'UDP' | 'TCP' | 'ICMP' | 'GRE'>; } export namespace Top { @@ -478,4 +482,7 @@ export namespace Top { export import LocationTargetResponse = LocationsAPI.LocationTargetResponse; export import LocationOriginParams = LocationsAPI.LocationOriginParams; export import LocationTargetParams = LocationsAPI.LocationTargetParams; + export import Ases = AsesAPI.Ases; + export import AseOriginResponse = AsesAPI.AseOriginResponse; + export import AseOriginParams = AsesAPI.AseOriginParams; } diff --git a/src/resources/radar/bgp/bgp.ts b/src/resources/radar/bgp/bgp.ts index 89a224bc43..7ff7567093 100644 --- a/src/resources/radar/bgp/bgp.ts +++ b/src/resources/radar/bgp/bgp.ts @@ -7,11 +7,11 @@ import * as BGPAPI from 'cloudflare/resources/radar/bgp/bgp'; import * as HijacksAPI from 'cloudflare/resources/radar/bgp/hijacks'; import * as LeaksAPI from 'cloudflare/resources/radar/bgp/leaks'; import * as RoutesAPI from 'cloudflare/resources/radar/bgp/routes'; -import * as TopsAPI from 'cloudflare/resources/radar/bgp/tops/tops'; +import * as TopAPI from 'cloudflare/resources/radar/bgp/top/top'; export class BGP extends APIResource { leaks: LeaksAPI.Leaks = new LeaksAPI.Leaks(this._client); - tops: TopsAPI.Tops = new TopsAPI.Tops(this._client); + top: TopAPI.Top = new TopAPI.Top(this._client); hijacks: HijacksAPI.Hijacks = new HijacksAPI.Hijacks(this._client); routes: RoutesAPI.Routes = new RoutesAPI.Routes(this._client); @@ -177,7 +177,9 @@ export namespace BGP { export import Leaks = LeaksAPI.Leaks; export import LeakEventsResponse = LeaksAPI.LeakEventsResponse; export import LeakEventsParams = LeaksAPI.LeakEventsParams; - export import Tops = TopsAPI.Tops; + export import Top = TopAPI.Top; + export import TopPrefixesResponse = TopAPI.TopPrefixesResponse; + export import TopPrefixesParams = TopAPI.TopPrefixesParams; export import Hijacks = HijacksAPI.Hijacks; export import HijackEventsResponse = HijacksAPI.HijackEventsResponse; export import HijackEventsParams = HijacksAPI.HijackEventsParams; diff --git a/src/resources/radar/bgp/index.ts b/src/resources/radar/bgp/index.ts index e02bcf5ce3..7f123791d8 100644 --- a/src/resources/radar/bgp/index.ts +++ b/src/resources/radar/bgp/index.ts @@ -12,4 +12,4 @@ export { RouteStatsParams, Routes, } from './routes'; -export { Tops } from './tops/index'; +export { TopPrefixesResponse, TopPrefixesParams, Top } from './top/index'; diff --git a/src/resources/radar/bgp/top/ases.ts b/src/resources/radar/bgp/top/ases.ts new file mode 100644 index 0000000000..8ef0d0d261 --- /dev/null +++ b/src/resources/radar/bgp/top/ases.ts @@ -0,0 +1,204 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as AsesAPI from 'cloudflare/resources/radar/bgp/top/ases'; + +export class Ases extends APIResource { + /** + * Get the top autonomous systems (AS) by BGP updates (announcements only). Values + * are a percentage out of the total updates. + */ + get(query?: AseGetParams, options?: Core.RequestOptions): Core.APIPromise; + get(options?: Core.RequestOptions): Core.APIPromise; + get( + query: AseGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get({}, query); + } + return ( + this._client.get('/radar/bgp/top/ases', { query, ...options }) as Core.APIPromise<{ + result: AseGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get the full list of autonomous systems on the global routing table ordered by + * announced prefixes count. The data comes from public BGP MRT data archives and + * updates every 2 hours. + */ + prefixes(query?: AsePrefixesParams, options?: Core.RequestOptions): Core.APIPromise; + prefixes(options?: Core.RequestOptions): Core.APIPromise; + prefixes( + query: AsePrefixesParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.prefixes({}, query); + } + return ( + this._client.get('/radar/bgp/top/ases/prefixes', { query, ...options }) as Core.APIPromise<{ + result: AsePrefixesResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface AseGetResponse { + meta: AseGetResponse.Meta; + + top_0: Array; +} + +export namespace AseGetResponse { + export interface Meta { + dateRange: Array; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + } + + export interface Top0 { + asn: number; + + ASName: string; + + /** + * Percentage of updates by this AS out of the total updates by all autonomous + * systems. + */ + value: string; + } +} + +export interface AsePrefixesResponse { + asns: Array; + + meta: AsePrefixesResponse.Meta; +} + +export namespace AsePrefixesResponse { + export interface Asn { + asn: number; + + country: string; + + name: string; + + pfxs_count: number; + } + + export interface Meta { + data_time: string; + + query_time: string; + + total_peers: number; + } +} + +export interface AseGetParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * For example, use `7d` and `7dControl` to compare this week with the previous + * week. Use this parameter or set specific start and end dates (`dateStart` and + * `dateEnd` parameters). + */ + dateRange?: Array< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Array of BGP network prefixes. + */ + prefix?: Array; + + /** + * Array of BGP update types. + */ + updateType?: Array<'ANNOUNCEMENT' | 'WITHDRAWAL'>; +} + +export interface AsePrefixesParams { + /** + * Alpha-2 country code. + */ + country?: string; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Maximum number of ASes to return + */ + limit?: number; +} + +export namespace Ases { + export import AseGetResponse = AsesAPI.AseGetResponse; + export import AsePrefixesResponse = AsesAPI.AsePrefixesResponse; + export import AseGetParams = AsesAPI.AseGetParams; + export import AsePrefixesParams = AsesAPI.AsePrefixesParams; +} diff --git a/src/resources/radar/bgp/top/index.ts b/src/resources/radar/bgp/top/index.ts new file mode 100644 index 0000000000..f38212d753 --- /dev/null +++ b/src/resources/radar/bgp/top/index.ts @@ -0,0 +1,4 @@ +// File generated from our OpenAPI spec by Stainless. + +export { AseGetResponse, AsePrefixesResponse, AseGetParams, AsePrefixesParams, Ases } from './ases'; +export { TopPrefixesResponse, TopPrefixesParams, Top } from './top'; diff --git a/src/resources/radar/bgp/top/top.ts b/src/resources/radar/bgp/top/top.ts new file mode 100644 index 0000000000..b425cec00f --- /dev/null +++ b/src/resources/radar/bgp/top/top.ts @@ -0,0 +1,135 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as TopAPI from 'cloudflare/resources/radar/bgp/top/top'; +import * as AsesAPI from 'cloudflare/resources/radar/bgp/top/ases'; + +export class Top extends APIResource { + ases: AsesAPI.Ases = new AsesAPI.Ases(this._client); + + /** + * Get the top network prefixes by BGP updates. Values are a percentage out of the + * total BGP updates. + */ + prefixes(query?: TopPrefixesParams, options?: Core.RequestOptions): Core.APIPromise; + prefixes(options?: Core.RequestOptions): Core.APIPromise; + prefixes( + query: TopPrefixesParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.prefixes({}, query); + } + return ( + this._client.get('/radar/bgp/top/prefixes', { query, ...options }) as Core.APIPromise<{ + result: TopPrefixesResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface TopPrefixesResponse { + meta: TopPrefixesResponse.Meta; + + top_0: Array; +} + +export namespace TopPrefixesResponse { + export interface Meta { + dateRange: Array; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + } + + export interface Top0 { + prefix: string; + + value: string; + } +} + +export interface TopPrefixesParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * For example, use `7d` and `7dControl` to compare this week with the previous + * week. Use this parameter or set specific start and end dates (`dateStart` and + * `dateEnd` parameters). + */ + dateRange?: Array< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Array of BGP update types. + */ + updateType?: Array<'ANNOUNCEMENT' | 'WITHDRAWAL'>; +} + +export namespace Top { + export import TopPrefixesResponse = TopAPI.TopPrefixesResponse; + export import TopPrefixesParams = TopAPI.TopPrefixesParams; + export import Ases = AsesAPI.Ases; + export import AseGetResponse = AsesAPI.AseGetResponse; + export import AsePrefixesResponse = AsesAPI.AsePrefixesResponse; + export import AseGetParams = AsesAPI.AseGetParams; + export import AsePrefixesParams = AsesAPI.AsePrefixesParams; +} diff --git a/src/resources/radar/bgp/tops/ases.ts b/src/resources/radar/bgp/tops/ases.ts deleted file mode 100644 index 3fbfff0102..0000000000 --- a/src/resources/radar/bgp/tops/ases.ts +++ /dev/null @@ -1,77 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as AsesAPI from 'cloudflare/resources/radar/bgp/tops/ases'; - -export class Ases extends APIResource { - /** - * Get the full list of autonomous systems on the global routing table ordered by - * announced prefixes count. The data comes from public BGP MRT data archives and - * updates every 2 hours. - */ - prefixes(query?: AsePrefixesParams, options?: Core.RequestOptions): Core.APIPromise; - prefixes(options?: Core.RequestOptions): Core.APIPromise; - prefixes( - query: AsePrefixesParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.prefixes({}, query); - } - return ( - this._client.get('/radar/bgp/top/ases/prefixes', { query, ...options }) as Core.APIPromise<{ - result: AsePrefixesResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface AsePrefixesResponse { - asns: Array; - - meta: AsePrefixesResponse.Meta; -} - -export namespace AsePrefixesResponse { - export interface Asn { - asn: number; - - country: string; - - name: string; - - pfxs_count: number; - } - - export interface Meta { - data_time: string; - - query_time: string; - - total_peers: number; - } -} - -export interface AsePrefixesParams { - /** - * Alpha-2 country code. - */ - country?: string; - - /** - * Format results are returned in. - */ - format?: 'JSON' | 'CSV'; - - /** - * Maximum number of ASes to return - */ - limit?: number; -} - -export namespace Ases { - export import AsePrefixesResponse = AsesAPI.AsePrefixesResponse; - export import AsePrefixesParams = AsesAPI.AsePrefixesParams; -} diff --git a/src/resources/radar/bgp/tops/index.ts b/src/resources/radar/bgp/tops/index.ts deleted file mode 100644 index 9670979e66..0000000000 --- a/src/resources/radar/bgp/tops/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -export { AsePrefixesResponse, AsePrefixesParams, Ases } from './ases'; -export { Tops } from './tops'; diff --git a/src/resources/radar/bgp/tops/tops.ts b/src/resources/radar/bgp/tops/tops.ts deleted file mode 100644 index f9cd1467d5..0000000000 --- a/src/resources/radar/bgp/tops/tops.ts +++ /dev/null @@ -1,14 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import { APIResource } from 'cloudflare/resource'; -import * as AsesAPI from 'cloudflare/resources/radar/bgp/tops/ases'; - -export class Tops extends APIResource { - ases: AsesAPI.Ases = new AsesAPI.Ases(this._client); -} - -export namespace Tops { - export import Ases = AsesAPI.Ases; - export import AsePrefixesResponse = AsesAPI.AsePrefixesResponse; - export import AsePrefixesParams = AsesAPI.AsePrefixesParams; -} diff --git a/src/resources/radar/email/security/index.ts b/src/resources/radar/email/security/index.ts index 0f1c040757..1fcec611d9 100644 --- a/src/resources/radar/email/security/index.ts +++ b/src/resources/radar/email/security/index.ts @@ -25,3 +25,4 @@ export { TimeseriesGroupDKIMParams, TimeseriesGroups, } from './timeseries-groups'; +export { Top } from './top/index'; diff --git a/src/resources/radar/email/security/security.ts b/src/resources/radar/email/security/security.ts index f0fd4dae1a..c909af7649 100644 --- a/src/resources/radar/email/security/security.ts +++ b/src/resources/radar/email/security/security.ts @@ -3,8 +3,10 @@ import { APIResource } from 'cloudflare/resource'; import * as SummaryAPI from 'cloudflare/resources/radar/email/security/summary'; import * as TimeseriesGroupsAPI from 'cloudflare/resources/radar/email/security/timeseries-groups'; +import * as TopAPI from 'cloudflare/resources/radar/email/security/top/top'; export class Security extends APIResource { + top: TopAPI.Top = new TopAPI.Top(this._client); summary: SummaryAPI.Summary = new SummaryAPI.Summary(this._client); timeseriesGroups: TimeseriesGroupsAPI.TimeseriesGroups = new TimeseriesGroupsAPI.TimeseriesGroups( this._client, @@ -12,6 +14,7 @@ export class Security extends APIResource { } export namespace Security { + export import Top = TopAPI.Top; export import Summary = SummaryAPI.Summary; export import SummaryArcResponse = SummaryAPI.SummaryArcResponse; export import SummaryDKIMResponse = SummaryAPI.SummaryDKIMResponse; diff --git a/src/resources/radar/email/security/top/ases/arc.ts b/src/resources/radar/email/security/top/ases/arc.ts new file mode 100644 index 0000000000..1881194c9d --- /dev/null +++ b/src/resources/radar/email/security/top/ases/arc.ts @@ -0,0 +1,179 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as ArcAPI from 'cloudflare/resources/radar/email/security/top/ases/arc'; + +export class Arc extends APIResource { + /** + * Get the top autonomous systems (AS) by emails ARC validation. + */ + get( + arc: 'PASS' | 'NONE' | 'FAIL', + query?: ArcGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + get(arc: 'PASS' | 'NONE' | 'FAIL', options?: Core.RequestOptions): Core.APIPromise; + get( + arc: 'PASS' | 'NONE' | 'FAIL', + query: ArcGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(arc, {}, query); + } + return ( + this._client.get(`/radar/email/security/top/ases/arc/${arc}`, { + query, + ...options, + }) as Core.APIPromise<{ result: ArcGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface ArcGetResponse { + meta: ArcGetResponse.Meta; + + top_0: Array; +} + +export namespace ArcGetResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + clientASN: number; + + clientASName: string; + + value: string; + } +} + +export interface ArcGetParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * For example, use `7d` and `7dControl` to compare this week with the previous + * week. Use this parameter or set specific start and end dates (`dateStart` and + * `dateEnd` parameters). + */ + dateRange?: Array< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for dkim. + */ + dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filter for dmarc. + */ + dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for spf. + */ + spf?: Array<'PASS' | 'NONE' | 'FAIL'>; +} + +export namespace Arc { + export import ArcGetResponse = ArcAPI.ArcGetResponse; + export import ArcGetParams = ArcAPI.ArcGetParams; +} diff --git a/src/resources/radar/email/security/top/ases/ases.ts b/src/resources/radar/email/security/top/ases/ases.ts new file mode 100644 index 0000000000..1dfcfb2ea9 --- /dev/null +++ b/src/resources/radar/email/security/top/ases/ases.ts @@ -0,0 +1,210 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as AsesAPI from 'cloudflare/resources/radar/email/security/top/ases/ases'; +import * as ArcAPI from 'cloudflare/resources/radar/email/security/top/ases/arc'; +import * as DKIMAPI from 'cloudflare/resources/radar/email/security/top/ases/dkim'; +import * as DmarcAPI from 'cloudflare/resources/radar/email/security/top/ases/dmarc'; +import * as MaliciousAPI from 'cloudflare/resources/radar/email/security/top/ases/malicious'; +import * as SpamAPI from 'cloudflare/resources/radar/email/security/top/ases/spam'; +import * as SPFAPI from 'cloudflare/resources/radar/email/security/top/ases/spf'; + +export class Ases extends APIResource { + arc: ArcAPI.Arc = new ArcAPI.Arc(this._client); + dkim: DKIMAPI.DKIM = new DKIMAPI.DKIM(this._client); + dmarc: DmarcAPI.Dmarc = new DmarcAPI.Dmarc(this._client); + malicious: MaliciousAPI.Malicious = new MaliciousAPI.Malicious(this._client); + spam: SpamAPI.Spam = new SpamAPI.Spam(this._client); + spf: SPFAPI.SPF = new SPFAPI.SPF(this._client); + + /** + * Get the top autonomous systems (AS) by email messages. Values are a percentage + * out of the total emails. + */ + get(query?: AseGetParams, options?: Core.RequestOptions): Core.APIPromise; + get(options?: Core.RequestOptions): Core.APIPromise; + get( + query: AseGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get({}, query); + } + return ( + this._client.get('/radar/email/security/top/ases', { query, ...options }) as Core.APIPromise<{ + result: AseGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface AseGetResponse { + meta: AseGetResponse.Meta; + + top_0: Array; +} + +export namespace AseGetResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + clientASN: number; + + clientASName: string; + + value: string; + } +} + +export interface AseGetParams { + /** + * Filter for arc (Authenticated Received Chain). + */ + arc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * For example, use `7d` and `7dControl` to compare this week with the previous + * week. Use this parameter or set specific start and end dates (`dateStart` and + * `dateEnd` parameters). + */ + dateRange?: Array< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for dkim. + */ + dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filter for dmarc. + */ + dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for spf. + */ + spf?: Array<'PASS' | 'NONE' | 'FAIL'>; +} + +export namespace Ases { + export import AseGetResponse = AsesAPI.AseGetResponse; + export import AseGetParams = AsesAPI.AseGetParams; + export import Arc = ArcAPI.Arc; + export import ArcGetResponse = ArcAPI.ArcGetResponse; + export import ArcGetParams = ArcAPI.ArcGetParams; + export import DKIM = DKIMAPI.DKIM; + export import DKIMGetResponse = DKIMAPI.DKIMGetResponse; + export import DKIMGetParams = DKIMAPI.DKIMGetParams; + export import Dmarc = DmarcAPI.Dmarc; + export import DmarcGetResponse = DmarcAPI.DmarcGetResponse; + export import DmarcGetParams = DmarcAPI.DmarcGetParams; + export import Malicious = MaliciousAPI.Malicious; + export import MaliciousGetResponse = MaliciousAPI.MaliciousGetResponse; + export import MaliciousGetParams = MaliciousAPI.MaliciousGetParams; + export import Spam = SpamAPI.Spam; + export import SpamGetResponse = SpamAPI.SpamGetResponse; + export import SpamGetParams = SpamAPI.SpamGetParams; + export import SPF = SPFAPI.SPF; + export import SPFGetResponse = SPFAPI.SPFGetResponse; + export import SPFGetParams = SPFAPI.SPFGetParams; +} diff --git a/src/resources/radar/email/security/top/ases/dkim.ts b/src/resources/radar/email/security/top/ases/dkim.ts new file mode 100644 index 0000000000..b16e721795 --- /dev/null +++ b/src/resources/radar/email/security/top/ases/dkim.ts @@ -0,0 +1,179 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as DKIMAPI from 'cloudflare/resources/radar/email/security/top/ases/dkim'; + +export class DKIM extends APIResource { + /** + * Get the top autonomous systems (AS), by email DKIM validation. + */ + get( + dkim: 'PASS' | 'NONE' | 'FAIL', + query?: DKIMGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + get(dkim: 'PASS' | 'NONE' | 'FAIL', options?: Core.RequestOptions): Core.APIPromise; + get( + dkim: 'PASS' | 'NONE' | 'FAIL', + query: DKIMGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(dkim, {}, query); + } + return ( + this._client.get(`/radar/email/security/top/ases/dkim/${dkim}`, { + query, + ...options, + }) as Core.APIPromise<{ result: DKIMGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface DKIMGetResponse { + meta: DKIMGetResponse.Meta; + + top_0: Array; +} + +export namespace DKIMGetResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + clientASN: number; + + clientASName: string; + + value: string; + } +} + +export interface DKIMGetParams { + /** + * Filter for arc (Authenticated Received Chain). + */ + arc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * For example, use `7d` and `7dControl` to compare this week with the previous + * week. Use this parameter or set specific start and end dates (`dateStart` and + * `dateEnd` parameters). + */ + dateRange?: Array< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for dmarc. + */ + dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for spf. + */ + spf?: Array<'PASS' | 'NONE' | 'FAIL'>; +} + +export namespace DKIM { + export import DKIMGetResponse = DKIMAPI.DKIMGetResponse; + export import DKIMGetParams = DKIMAPI.DKIMGetParams; +} diff --git a/src/resources/radar/email/security/top/ases/dmarc.ts b/src/resources/radar/email/security/top/ases/dmarc.ts new file mode 100644 index 0000000000..27550b9b75 --- /dev/null +++ b/src/resources/radar/email/security/top/ases/dmarc.ts @@ -0,0 +1,179 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as DmarcAPI from 'cloudflare/resources/radar/email/security/top/ases/dmarc'; + +export class Dmarc extends APIResource { + /** + * Get the top autonomous systems (AS) by emails DMARC validation. + */ + get( + dmarc: 'PASS' | 'NONE' | 'FAIL', + query?: DmarcGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + get(dmarc: 'PASS' | 'NONE' | 'FAIL', options?: Core.RequestOptions): Core.APIPromise; + get( + dmarc: 'PASS' | 'NONE' | 'FAIL', + query: DmarcGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(dmarc, {}, query); + } + return ( + this._client.get(`/radar/email/security/top/ases/dmarc/${dmarc}`, { + query, + ...options, + }) as Core.APIPromise<{ result: DmarcGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface DmarcGetResponse { + meta: DmarcGetResponse.Meta; + + top_0: Array; +} + +export namespace DmarcGetResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + clientASN: number; + + clientASName: string; + + value: string; + } +} + +export interface DmarcGetParams { + /** + * Filter for arc (Authenticated Received Chain). + */ + arc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * For example, use `7d` and `7dControl` to compare this week with the previous + * week. Use this parameter or set specific start and end dates (`dateStart` and + * `dateEnd` parameters). + */ + dateRange?: Array< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for dkim. + */ + dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for spf. + */ + spf?: Array<'PASS' | 'NONE' | 'FAIL'>; +} + +export namespace Dmarc { + export import DmarcGetResponse = DmarcAPI.DmarcGetResponse; + export import DmarcGetParams = DmarcAPI.DmarcGetParams; +} diff --git a/src/resources/radar/email/security/top/ases/index.ts b/src/resources/radar/email/security/top/ases/index.ts new file mode 100644 index 0000000000..8483c666cc --- /dev/null +++ b/src/resources/radar/email/security/top/ases/index.ts @@ -0,0 +1,9 @@ +// File generated from our OpenAPI spec by Stainless. + +export { ArcGetResponse, ArcGetParams, Arc } from './arc'; +export { AseGetResponse, AseGetParams, Ases } from './ases'; +export { DKIMGetResponse, DKIMGetParams, DKIM } from './dkim'; +export { DmarcGetResponse, DmarcGetParams, Dmarc } from './dmarc'; +export { MaliciousGetResponse, MaliciousGetParams, Malicious } from './malicious'; +export { SPFGetResponse, SPFGetParams, SPF } from './spf'; +export { SpamGetResponse, SpamGetParams, Spam } from './spam'; diff --git a/src/resources/radar/email/security/top/ases/malicious.ts b/src/resources/radar/email/security/top/ases/malicious.ts new file mode 100644 index 0000000000..2db688ae33 --- /dev/null +++ b/src/resources/radar/email/security/top/ases/malicious.ts @@ -0,0 +1,187 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as MaliciousAPI from 'cloudflare/resources/radar/email/security/top/ases/malicious'; + +export class Malicious extends APIResource { + /** + * Get the top autonomous systems (AS), by emails classified as Malicious or not. + */ + get( + malicious: 'MALICIOUS' | 'NOT_MALICIOUS', + query?: MaliciousGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + get( + malicious: 'MALICIOUS' | 'NOT_MALICIOUS', + options?: Core.RequestOptions, + ): Core.APIPromise; + get( + malicious: 'MALICIOUS' | 'NOT_MALICIOUS', + query: MaliciousGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(malicious, {}, query); + } + return ( + this._client.get(`/radar/email/security/top/ases/malicious/${malicious}`, { + query, + ...options, + }) as Core.APIPromise<{ result: MaliciousGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface MaliciousGetResponse { + meta: MaliciousGetResponse.Meta; + + top_0: Array; +} + +export namespace MaliciousGetResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + clientASN: number; + + clientASName: string; + + value: string; + } +} + +export interface MaliciousGetParams { + /** + * Filter for arc (Authenticated Received Chain). + */ + arc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * For example, use `7d` and `7dControl` to compare this week with the previous + * week. Use this parameter or set specific start and end dates (`dateStart` and + * `dateEnd` parameters). + */ + dateRange?: Array< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for dkim. + */ + dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filter for dmarc. + */ + dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for spf. + */ + spf?: Array<'PASS' | 'NONE' | 'FAIL'>; +} + +export namespace Malicious { + export import MaliciousGetResponse = MaliciousAPI.MaliciousGetResponse; + export import MaliciousGetParams = MaliciousAPI.MaliciousGetParams; +} diff --git a/src/resources/radar/email/security/top/ases/spam.ts b/src/resources/radar/email/security/top/ases/spam.ts new file mode 100644 index 0000000000..1074611de5 --- /dev/null +++ b/src/resources/radar/email/security/top/ases/spam.ts @@ -0,0 +1,184 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as SpamAPI from 'cloudflare/resources/radar/email/security/top/ases/spam'; + +export class Spam extends APIResource { + /** + * Get the top autonomous systems (AS), by emails classified, of Spam validations. + */ + get( + spam: 'SPAM' | 'NOT_SPAM', + query?: SpamGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + get(spam: 'SPAM' | 'NOT_SPAM', options?: Core.RequestOptions): Core.APIPromise; + get( + spam: 'SPAM' | 'NOT_SPAM', + query: SpamGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(spam, {}, query); + } + return ( + this._client.get(`/radar/email/security/top/ases/spam/${spam}`, { + query, + ...options, + }) as Core.APIPromise<{ result: SpamGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface SpamGetResponse { + meta: SpamGetResponse.Meta; + + top_0: Array; +} + +export namespace SpamGetResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + clientASN: number; + + clientASName: string; + + value: string; + } +} + +export interface SpamGetParams { + /** + * Filter for arc (Authenticated Received Chain). + */ + arc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * For example, use `7d` and `7dControl` to compare this week with the previous + * week. Use this parameter or set specific start and end dates (`dateStart` and + * `dateEnd` parameters). + */ + dateRange?: Array< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for dkim. + */ + dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filter for dmarc. + */ + dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for spf. + */ + spf?: Array<'PASS' | 'NONE' | 'FAIL'>; +} + +export namespace Spam { + export import SpamGetResponse = SpamAPI.SpamGetResponse; + export import SpamGetParams = SpamAPI.SpamGetParams; +} diff --git a/src/resources/radar/email/security/top/ases/spf.ts b/src/resources/radar/email/security/top/ases/spf.ts new file mode 100644 index 0000000000..678bb57fc0 --- /dev/null +++ b/src/resources/radar/email/security/top/ases/spf.ts @@ -0,0 +1,179 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as SPFAPI from 'cloudflare/resources/radar/email/security/top/ases/spf'; + +export class SPF extends APIResource { + /** + * Get the top autonomous systems (AS) by email SPF validation. + */ + get( + spf: 'PASS' | 'NONE' | 'FAIL', + query?: SPFGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + get(spf: 'PASS' | 'NONE' | 'FAIL', options?: Core.RequestOptions): Core.APIPromise; + get( + spf: 'PASS' | 'NONE' | 'FAIL', + query: SPFGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(spf, {}, query); + } + return ( + this._client.get(`/radar/email/security/top/ases/spf/${spf}`, { + query, + ...options, + }) as Core.APIPromise<{ result: SPFGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface SPFGetResponse { + meta: SPFGetResponse.Meta; + + top_0: Array; +} + +export namespace SPFGetResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + clientASN: number; + + clientASName: string; + + value: string; + } +} + +export interface SPFGetParams { + /** + * Filter for arc (Authenticated Received Chain). + */ + arc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * For example, use `7d` and `7dControl` to compare this week with the previous + * week. Use this parameter or set specific start and end dates (`dateStart` and + * `dateEnd` parameters). + */ + dateRange?: Array< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for dkim. + */ + dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filter for dmarc. + */ + dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; +} + +export namespace SPF { + export import SPFGetResponse = SPFAPI.SPFGetResponse; + export import SPFGetParams = SPFAPI.SPFGetParams; +} diff --git a/src/resources/radar/email/security/top/index.ts b/src/resources/radar/email/security/top/index.ts new file mode 100644 index 0000000000..28fc0527dd --- /dev/null +++ b/src/resources/radar/email/security/top/index.ts @@ -0,0 +1,5 @@ +// File generated from our OpenAPI spec by Stainless. + +export { AseGetResponse, AseGetParams, Ases } from './ases/index'; +export { LocationGetResponse, LocationGetParams, Locations } from './locations/index'; +export { Top } from './top'; diff --git a/src/resources/radar/email/security/top/locations/arc.ts b/src/resources/radar/email/security/top/locations/arc.ts new file mode 100644 index 0000000000..80a67aedf3 --- /dev/null +++ b/src/resources/radar/email/security/top/locations/arc.ts @@ -0,0 +1,179 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as ArcAPI from 'cloudflare/resources/radar/email/security/top/locations/arc'; + +export class Arc extends APIResource { + /** + * Get the locations, by emails ARC validation. + */ + get( + arc: 'PASS' | 'NONE' | 'FAIL', + query?: ArcGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + get(arc: 'PASS' | 'NONE' | 'FAIL', options?: Core.RequestOptions): Core.APIPromise; + get( + arc: 'PASS' | 'NONE' | 'FAIL', + query: ArcGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(arc, {}, query); + } + return ( + this._client.get(`/radar/email/security/top/locations/arc/${arc}`, { + query, + ...options, + }) as Core.APIPromise<{ result: ArcGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface ArcGetResponse { + meta: ArcGetResponse.Meta; + + top_0: Array; +} + +export namespace ArcGetResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + clientCountryAlpha2: string; + + clientCountryName: string; + + value: string; + } +} + +export interface ArcGetParams { + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * For example, use `7d` and `7dControl` to compare this week with the previous + * week. Use this parameter or set specific start and end dates (`dateStart` and + * `dateEnd` parameters). + */ + dateRange?: Array< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for dkim. + */ + dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filter for dmarc. + */ + dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for spf. + */ + spf?: Array<'PASS' | 'NONE' | 'FAIL'>; +} + +export namespace Arc { + export import ArcGetResponse = ArcAPI.ArcGetResponse; + export import ArcGetParams = ArcAPI.ArcGetParams; +} diff --git a/src/resources/radar/email/security/top/locations/dkim.ts b/src/resources/radar/email/security/top/locations/dkim.ts new file mode 100644 index 0000000000..e2867e0760 --- /dev/null +++ b/src/resources/radar/email/security/top/locations/dkim.ts @@ -0,0 +1,179 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as DKIMAPI from 'cloudflare/resources/radar/email/security/top/locations/dkim'; + +export class DKIM extends APIResource { + /** + * Get the locations, by email DKIM validation. + */ + get( + dkim: 'PASS' | 'NONE' | 'FAIL', + query?: DKIMGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + get(dkim: 'PASS' | 'NONE' | 'FAIL', options?: Core.RequestOptions): Core.APIPromise; + get( + dkim: 'PASS' | 'NONE' | 'FAIL', + query: DKIMGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(dkim, {}, query); + } + return ( + this._client.get(`/radar/email/security/top/locations/dkim/${dkim}`, { + query, + ...options, + }) as Core.APIPromise<{ result: DKIMGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface DKIMGetResponse { + meta: DKIMGetResponse.Meta; + + top_0: Array; +} + +export namespace DKIMGetResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + clientCountryAlpha2: string; + + clientCountryName: string; + + value: string; + } +} + +export interface DKIMGetParams { + /** + * Filter for arc (Authenticated Received Chain). + */ + arc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * For example, use `7d` and `7dControl` to compare this week with the previous + * week. Use this parameter or set specific start and end dates (`dateStart` and + * `dateEnd` parameters). + */ + dateRange?: Array< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for dmarc. + */ + dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for spf. + */ + spf?: Array<'PASS' | 'NONE' | 'FAIL'>; +} + +export namespace DKIM { + export import DKIMGetResponse = DKIMAPI.DKIMGetResponse; + export import DKIMGetParams = DKIMAPI.DKIMGetParams; +} diff --git a/src/resources/radar/email/security/top/locations/dmarc.ts b/src/resources/radar/email/security/top/locations/dmarc.ts new file mode 100644 index 0000000000..bf3228cb97 --- /dev/null +++ b/src/resources/radar/email/security/top/locations/dmarc.ts @@ -0,0 +1,179 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as DmarcAPI from 'cloudflare/resources/radar/email/security/top/locations/dmarc'; + +export class Dmarc extends APIResource { + /** + * Get the locations by email DMARC validation. + */ + get( + dmarc: 'PASS' | 'NONE' | 'FAIL', + query?: DmarcGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + get(dmarc: 'PASS' | 'NONE' | 'FAIL', options?: Core.RequestOptions): Core.APIPromise; + get( + dmarc: 'PASS' | 'NONE' | 'FAIL', + query: DmarcGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(dmarc, {}, query); + } + return ( + this._client.get(`/radar/email/security/top/locations/dmarc/${dmarc}`, { + query, + ...options, + }) as Core.APIPromise<{ result: DmarcGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface DmarcGetResponse { + meta: DmarcGetResponse.Meta; + + top_0: Array; +} + +export namespace DmarcGetResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + clientCountryAlpha2: string; + + clientCountryName: string; + + value: string; + } +} + +export interface DmarcGetParams { + /** + * Filter for arc (Authenticated Received Chain). + */ + arc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * For example, use `7d` and `7dControl` to compare this week with the previous + * week. Use this parameter or set specific start and end dates (`dateStart` and + * `dateEnd` parameters). + */ + dateRange?: Array< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for dkim. + */ + dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for spf. + */ + spf?: Array<'PASS' | 'NONE' | 'FAIL'>; +} + +export namespace Dmarc { + export import DmarcGetResponse = DmarcAPI.DmarcGetResponse; + export import DmarcGetParams = DmarcAPI.DmarcGetParams; +} diff --git a/src/resources/radar/email/security/top/locations/index.ts b/src/resources/radar/email/security/top/locations/index.ts new file mode 100644 index 0000000000..57a0f02215 --- /dev/null +++ b/src/resources/radar/email/security/top/locations/index.ts @@ -0,0 +1,9 @@ +// File generated from our OpenAPI spec by Stainless. + +export { ArcGetResponse, ArcGetParams, Arc } from './arc'; +export { DKIMGetResponse, DKIMGetParams, DKIM } from './dkim'; +export { DmarcGetResponse, DmarcGetParams, Dmarc } from './dmarc'; +export { LocationGetResponse, LocationGetParams, Locations } from './locations'; +export { MaliciousGetResponse, MaliciousGetParams, Malicious } from './malicious'; +export { SPFGetResponse, SPFGetParams, SPF } from './spf'; +export { SpamGetResponse, SpamGetParams, Spam } from './spam'; diff --git a/src/resources/radar/email/security/top/locations/locations.ts b/src/resources/radar/email/security/top/locations/locations.ts new file mode 100644 index 0000000000..a7b3d0c5e3 --- /dev/null +++ b/src/resources/radar/email/security/top/locations/locations.ts @@ -0,0 +1,210 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as LocationsAPI from 'cloudflare/resources/radar/email/security/top/locations/locations'; +import * as ArcAPI from 'cloudflare/resources/radar/email/security/top/locations/arc'; +import * as DKIMAPI from 'cloudflare/resources/radar/email/security/top/locations/dkim'; +import * as DmarcAPI from 'cloudflare/resources/radar/email/security/top/locations/dmarc'; +import * as MaliciousAPI from 'cloudflare/resources/radar/email/security/top/locations/malicious'; +import * as SpamAPI from 'cloudflare/resources/radar/email/security/top/locations/spam'; +import * as SPFAPI from 'cloudflare/resources/radar/email/security/top/locations/spf'; + +export class Locations extends APIResource { + arc: ArcAPI.Arc = new ArcAPI.Arc(this._client); + dkim: DKIMAPI.DKIM = new DKIMAPI.DKIM(this._client); + dmarc: DmarcAPI.Dmarc = new DmarcAPI.Dmarc(this._client); + malicious: MaliciousAPI.Malicious = new MaliciousAPI.Malicious(this._client); + spam: SpamAPI.Spam = new SpamAPI.Spam(this._client); + spf: SPFAPI.SPF = new SPFAPI.SPF(this._client); + + /** + * Get the top locations by email messages. Values are a percentage out of the + * total emails. + */ + get(query?: LocationGetParams, options?: Core.RequestOptions): Core.APIPromise; + get(options?: Core.RequestOptions): Core.APIPromise; + get( + query: LocationGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get({}, query); + } + return ( + this._client.get('/radar/email/security/top/locations', { query, ...options }) as Core.APIPromise<{ + result: LocationGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface LocationGetResponse { + meta: LocationGetResponse.Meta; + + top_0: Array; +} + +export namespace LocationGetResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + clientCountryAlpha2: string; + + clientCountryName: string; + + value: string; + } +} + +export interface LocationGetParams { + /** + * Filter for arc (Authenticated Received Chain). + */ + arc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * For example, use `7d` and `7dControl` to compare this week with the previous + * week. Use this parameter or set specific start and end dates (`dateStart` and + * `dateEnd` parameters). + */ + dateRange?: Array< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for dkim. + */ + dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filter for dmarc. + */ + dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for spf. + */ + spf?: Array<'PASS' | 'NONE' | 'FAIL'>; +} + +export namespace Locations { + export import LocationGetResponse = LocationsAPI.LocationGetResponse; + export import LocationGetParams = LocationsAPI.LocationGetParams; + export import Arc = ArcAPI.Arc; + export import ArcGetResponse = ArcAPI.ArcGetResponse; + export import ArcGetParams = ArcAPI.ArcGetParams; + export import DKIM = DKIMAPI.DKIM; + export import DKIMGetResponse = DKIMAPI.DKIMGetResponse; + export import DKIMGetParams = DKIMAPI.DKIMGetParams; + export import Dmarc = DmarcAPI.Dmarc; + export import DmarcGetResponse = DmarcAPI.DmarcGetResponse; + export import DmarcGetParams = DmarcAPI.DmarcGetParams; + export import Malicious = MaliciousAPI.Malicious; + export import MaliciousGetResponse = MaliciousAPI.MaliciousGetResponse; + export import MaliciousGetParams = MaliciousAPI.MaliciousGetParams; + export import Spam = SpamAPI.Spam; + export import SpamGetResponse = SpamAPI.SpamGetResponse; + export import SpamGetParams = SpamAPI.SpamGetParams; + export import SPF = SPFAPI.SPF; + export import SPFGetResponse = SPFAPI.SPFGetResponse; + export import SPFGetParams = SPFAPI.SPFGetParams; +} diff --git a/src/resources/radar/email/security/top/locations/malicious.ts b/src/resources/radar/email/security/top/locations/malicious.ts new file mode 100644 index 0000000000..b99a71db78 --- /dev/null +++ b/src/resources/radar/email/security/top/locations/malicious.ts @@ -0,0 +1,187 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as MaliciousAPI from 'cloudflare/resources/radar/email/security/top/locations/malicious'; + +export class Malicious extends APIResource { + /** + * Get the locations by emails classified as malicious or not. + */ + get( + malicious: 'MALICIOUS' | 'NOT_MALICIOUS', + query?: MaliciousGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + get( + malicious: 'MALICIOUS' | 'NOT_MALICIOUS', + options?: Core.RequestOptions, + ): Core.APIPromise; + get( + malicious: 'MALICIOUS' | 'NOT_MALICIOUS', + query: MaliciousGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(malicious, {}, query); + } + return ( + this._client.get(`/radar/email/security/top/locations/malicious/${malicious}`, { + query, + ...options, + }) as Core.APIPromise<{ result: MaliciousGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface MaliciousGetResponse { + meta: MaliciousGetResponse.Meta; + + top_0: Array; +} + +export namespace MaliciousGetResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + clientCountryAlpha2: string; + + clientCountryName: string; + + value: string; + } +} + +export interface MaliciousGetParams { + /** + * Filter for arc (Authenticated Received Chain). + */ + arc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * For example, use `7d` and `7dControl` to compare this week with the previous + * week. Use this parameter or set specific start and end dates (`dateStart` and + * `dateEnd` parameters). + */ + dateRange?: Array< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for dkim. + */ + dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filter for dmarc. + */ + dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for spf. + */ + spf?: Array<'PASS' | 'NONE' | 'FAIL'>; +} + +export namespace Malicious { + export import MaliciousGetResponse = MaliciousAPI.MaliciousGetResponse; + export import MaliciousGetParams = MaliciousAPI.MaliciousGetParams; +} diff --git a/src/resources/radar/email/security/top/locations/spam.ts b/src/resources/radar/email/security/top/locations/spam.ts new file mode 100644 index 0000000000..466419ca51 --- /dev/null +++ b/src/resources/radar/email/security/top/locations/spam.ts @@ -0,0 +1,184 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as SpamAPI from 'cloudflare/resources/radar/email/security/top/locations/spam'; + +export class Spam extends APIResource { + /** + * Get the top locations by emails classified as Spam or not. + */ + get( + spam: 'SPAM' | 'NOT_SPAM', + query?: SpamGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + get(spam: 'SPAM' | 'NOT_SPAM', options?: Core.RequestOptions): Core.APIPromise; + get( + spam: 'SPAM' | 'NOT_SPAM', + query: SpamGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(spam, {}, query); + } + return ( + this._client.get(`/radar/email/security/top/locations/spam/${spam}`, { + query, + ...options, + }) as Core.APIPromise<{ result: SpamGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface SpamGetResponse { + meta: SpamGetResponse.Meta; + + top_0: Array; +} + +export namespace SpamGetResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + clientCountryAlpha2: string; + + clientCountryName: string; + + value: string; + } +} + +export interface SpamGetParams { + /** + * Filter for arc (Authenticated Received Chain). + */ + arc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * For example, use `7d` and `7dControl` to compare this week with the previous + * week. Use this parameter or set specific start and end dates (`dateStart` and + * `dateEnd` parameters). + */ + dateRange?: Array< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for dkim. + */ + dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filter for dmarc. + */ + dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; + + /** + * Filter for spf. + */ + spf?: Array<'PASS' | 'NONE' | 'FAIL'>; +} + +export namespace Spam { + export import SpamGetResponse = SpamAPI.SpamGetResponse; + export import SpamGetParams = SpamAPI.SpamGetParams; +} diff --git a/src/resources/radar/email/security/top/locations/spf.ts b/src/resources/radar/email/security/top/locations/spf.ts new file mode 100644 index 0000000000..5995c01119 --- /dev/null +++ b/src/resources/radar/email/security/top/locations/spf.ts @@ -0,0 +1,179 @@ +// File generated from our OpenAPI spec by Stainless. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import { isRequestOptions } from 'cloudflare/core'; +import * as SPFAPI from 'cloudflare/resources/radar/email/security/top/locations/spf'; + +export class SPF extends APIResource { + /** + * Get the top locations by email SPF validation. + */ + get( + spf: 'PASS' | 'NONE' | 'FAIL', + query?: SPFGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + get(spf: 'PASS' | 'NONE' | 'FAIL', options?: Core.RequestOptions): Core.APIPromise; + get( + spf: 'PASS' | 'NONE' | 'FAIL', + query: SPFGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(spf, {}, query); + } + return ( + this._client.get(`/radar/email/security/top/locations/spf/${spf}`, { + query, + ...options, + }) as Core.APIPromise<{ result: SPFGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface SPFGetResponse { + meta: SPFGetResponse.Meta; + + top_0: Array; +} + +export namespace SPFGetResponse { + export interface Meta { + dateRange: Array; + + lastUpdated: string; + + confidenceInfo?: Meta.ConfidenceInfo; + } + + export namespace Meta { + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface ConfidenceInfo { + annotations?: Array; + + level?: number; + } + + export namespace ConfidenceInfo { + export interface Annotation { + dataSource: string; + + description: string; + + eventType: string; + + isInstantaneous: unknown; + + endTime?: string; + + linkedUrl?: string; + + startTime?: string; + } + } + } + + export interface Top0 { + clientCountryAlpha2: string; + + clientCountryName: string; + + value: string; + } +} + +export interface SPFGetParams { + /** + * Filter for arc (Authenticated Received Chain). + */ + arc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * For example, use `7d` and `7dControl` to compare this week with the previous + * week. Use this parameter or set specific start and end dates (`dateStart` and + * `dateEnd` parameters). + */ + dateRange?: Array< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Filter for dkim. + */ + dkim?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Filter for dmarc. + */ + dmarc?: Array<'PASS' | 'NONE' | 'FAIL'>; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limit the number of objects in the response. + */ + limit?: number; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; +} + +export namespace SPF { + export import SPFGetResponse = SPFAPI.SPFGetResponse; + export import SPFGetParams = SPFAPI.SPFGetParams; +} diff --git a/src/resources/radar/email/security/top/top.ts b/src/resources/radar/email/security/top/top.ts new file mode 100644 index 0000000000..3fa95fec5e --- /dev/null +++ b/src/resources/radar/email/security/top/top.ts @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec by Stainless. + +import { APIResource } from 'cloudflare/resource'; +import * as AsesAPI from 'cloudflare/resources/radar/email/security/top/ases/ases'; +import * as LocationsAPI from 'cloudflare/resources/radar/email/security/top/locations/locations'; + +export class Top extends APIResource { + ases: AsesAPI.Ases = new AsesAPI.Ases(this._client); + locations: LocationsAPI.Locations = new LocationsAPI.Locations(this._client); +} + +export namespace Top { + export import Ases = AsesAPI.Ases; + export import AseGetResponse = AsesAPI.AseGetResponse; + export import AseGetParams = AsesAPI.AseGetParams; + export import Locations = LocationsAPI.Locations; + export import LocationGetResponse = LocationsAPI.LocationGetResponse; + export import LocationGetParams = LocationsAPI.LocationGetParams; +} diff --git a/src/resources/radar/quality/index.ts b/src/resources/radar/quality/index.ts index dc25ffb68f..0e279a8324 100644 --- a/src/resources/radar/quality/index.ts +++ b/src/resources/radar/quality/index.ts @@ -1,6 +1,12 @@ // File generated from our OpenAPI spec by Stainless. -export { IqiSummaryResponse, IqiSummaryParams, Iqi } from './iqi'; +export { + IqiSummaryResponse, + IqiTimeseriesGroupsResponse, + IqiSummaryParams, + IqiTimeseriesGroupsParams, + Iqi, +} from './iqi'; export { Quality } from './quality'; export { SpeedHistogramResponse, diff --git a/src/resources/radar/quality/iqi.ts b/src/resources/radar/quality/iqi.ts index aa36657a36..1c5c6cbc39 100644 --- a/src/resources/radar/quality/iqi.ts +++ b/src/resources/radar/quality/iqi.ts @@ -16,6 +16,21 @@ export class Iqi extends APIResource { }> )._thenUnwrap((obj) => obj.result); } + + /** + * Get a time series (percentiles) of bandwidth, latency or DNS response time from + * the Radar Internet Quality Index (IQI). + */ + timeseriesGroups( + query: IqiTimeseriesGroupsParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.get('/radar/quality/iqi/timeseries_groups', { query, ...options }) as Core.APIPromise<{ + result: IqiTimeseriesGroupsResponse; + }> + )._thenUnwrap((obj) => obj.result); + } } export interface IqiSummaryResponse { @@ -82,6 +97,24 @@ export namespace IqiSummaryResponse { } } +export interface IqiTimeseriesGroupsResponse { + meta: unknown; + + serie_0: IqiTimeseriesGroupsResponse.Serie0; +} + +export namespace IqiTimeseriesGroupsResponse { + export interface Serie0 { + p25: Array; + + p50: Array; + + p75: Array; + + timestamps: Array; + } +} + export interface IqiSummaryParams { /** * Which metric to return: bandwidth, latency or DNS response time. @@ -153,7 +186,92 @@ export interface IqiSummaryParams { name?: Array; } +export interface IqiTimeseriesGroupsParams { + /** + * Which metric to return: bandwidth, latency or DNS response time. + */ + metric: 'BANDWIDTH' | 'DNS' | 'LATENCY'; + + /** + * Aggregation interval results should be returned in (for example, in 15 minutes + * or 1 hour intervals). Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Array of comma separated list of ASNs, start with `-` to exclude from results. + * For example, `-174, 3356` excludes results from AS174, but includes results from + * AS3356. + */ + asn?: Array; + + /** + * Array of comma separated list of continents (alpha-2 continent codes). Start + * with `-` to exclude from results. For example, `-EU,NA` excludes results from + * Europe, but includes results from North America. + */ + continent?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * For example, use `7d` and `7dControl` to compare this week with the previous + * week. Use this parameter or set specific start and end dates (`dateStart` and + * `dateEnd` parameters). + */ + dateRange?: Array< + | '1d' + | '2d' + | '7d' + | '14d' + | '28d' + | '12w' + | '24w' + | '52w' + | '1dControl' + | '2dControl' + | '7dControl' + | '14dControl' + | '28dControl' + | '12wControl' + | '24wControl' + >; + + /** + * Array of datetimes to filter the start of a series. + */ + dateStart?: Array; + + /** + * Format results are returned in. + */ + format?: 'JSON' | 'CSV'; + + /** + * Enable interpolation for all series (using the average). + */ + interpolation?: boolean; + + /** + * Array of comma separated list of locations (alpha-2 country codes). Start with + * `-` to exclude from results. For example, `-US,PT` excludes results from the US, + * but includes results from PT. + */ + location?: Array; + + /** + * Array of names that will be used to name the series in responses. + */ + name?: Array; +} + export namespace Iqi { export import IqiSummaryResponse = IqiAPI.IqiSummaryResponse; + export import IqiTimeseriesGroupsResponse = IqiAPI.IqiTimeseriesGroupsResponse; export import IqiSummaryParams = IqiAPI.IqiSummaryParams; + export import IqiTimeseriesGroupsParams = IqiAPI.IqiTimeseriesGroupsParams; } diff --git a/src/resources/radar/quality/quality.ts b/src/resources/radar/quality/quality.ts index 67d74fa3fa..a6693f99ed 100644 --- a/src/resources/radar/quality/quality.ts +++ b/src/resources/radar/quality/quality.ts @@ -12,7 +12,9 @@ export class Quality extends APIResource { export namespace Quality { export import Iqi = IqiAPI.Iqi; export import IqiSummaryResponse = IqiAPI.IqiSummaryResponse; + export import IqiTimeseriesGroupsResponse = IqiAPI.IqiTimeseriesGroupsResponse; export import IqiSummaryParams = IqiAPI.IqiSummaryParams; + export import IqiTimeseriesGroupsParams = IqiAPI.IqiTimeseriesGroupsParams; export import Speed = SpeedAPI.Speed; export import SpeedHistogramResponse = SpeedAPI.SpeedHistogramResponse; export import SpeedSummaryResponse = SpeedAPI.SpeedSummaryResponse; diff --git a/src/resources/request-tracers/index.ts b/src/resources/request-tracers/index.ts index abc216df83..4fb5dfa0d7 100644 --- a/src/resources/request-tracers/index.ts +++ b/src/resources/request-tracers/index.ts @@ -1,4 +1,4 @@ // File generated from our OpenAPI spec by Stainless. +export { EJbHDUdxTrace, TraceCreateResponse, TraceCreateParams, Traces } from './traces'; export { RequestTracers } from './request-tracers'; -export { TraceCreateResponse, TraceCreateParams, Traces } from './traces'; diff --git a/src/resources/request-tracers/request-tracers.ts b/src/resources/request-tracers/request-tracers.ts index 2c2204a2c1..2028749365 100644 --- a/src/resources/request-tracers/request-tracers.ts +++ b/src/resources/request-tracers/request-tracers.ts @@ -9,6 +9,7 @@ export class RequestTracers extends APIResource { export namespace RequestTracers { export import Traces = TracesAPI.Traces; + export import EJbHDUdxTrace = TracesAPI.EJbHDUdxTrace; export import TraceCreateResponse = TracesAPI.TraceCreateResponse; export import TraceCreateParams = TracesAPI.TraceCreateParams; } diff --git a/src/resources/request-tracers/traces.ts b/src/resources/request-tracers/traces.ts index 06e250fd31..73aec8a910 100644 --- a/src/resources/request-tracers/traces.ts +++ b/src/resources/request-tracers/traces.ts @@ -22,23 +22,13 @@ export class Traces extends APIResource { } } -/** - * Trace result with an origin status code - */ -export interface TraceCreateResponse { - /** - * HTTP Status code of zone response - */ - status_code?: number; - - trace?: Array; -} +export type EJbHDUdxTrace = Array; -export namespace TraceCreateResponse { +export namespace EJbHDUdxTrace { /** * List of steps acting on request/response */ - export interface Trace { + export interface EJbHDUdxTraceItem { /** * If step type is rule, then action performed by this rule */ @@ -79,67 +69,25 @@ export namespace TraceCreateResponse { */ step_name?: string; - trace?: Array; + trace?: TracesAPI.EJbHDUdxTrace; /** * Tracing step type */ type?: string; } +} - export namespace Trace { - /** - * List of steps acting on request/response - */ - export interface Trace { - /** - * If step type is rule, then action performed by this rule - */ - action?: string; - - /** - * If step type is rule, then action parameters of this rule as JSON - */ - action_parameters?: unknown; - - /** - * If step type is rule or ruleset, the description of this entity - */ - description?: string; - - /** - * If step type is rule, then expression used to match for this rule - */ - expression?: string; - - /** - * If step type is ruleset, then kind of this ruleset - */ - kind?: string; - - /** - * Whether tracing step affected tracing request/response - */ - matched?: boolean; - - /** - * If step type is ruleset, then name of this ruleset - */ - name?: string; - - /** - * Tracing step identifying name - */ - step_name?: string; - - trace?: unknown; - - /** - * Tracing step type - */ - type?: string; - } - } +/** + * Trace result with an origin status code + */ +export interface TraceCreateResponse { + /** + * HTTP Status code of zone response + */ + status_code?: number; + + trace?: EJbHDUdxTrace; } export interface TraceCreateParams { @@ -253,6 +201,7 @@ export namespace TraceCreateParams { } export namespace Traces { + export import EJbHDUdxTrace = TracesAPI.EJbHDUdxTrace; export import TraceCreateResponse = TracesAPI.TraceCreateResponse; export import TraceCreateParams = TracesAPI.TraceCreateParams; } diff --git a/tests/api-resources/cache/cache-reserve.test.ts b/tests/api-resources/cache/cache-reserve.test.ts index f8b2ab43c5..d5702ddf0e 100644 --- a/tests/api-resources/cache/cache-reserve.test.ts +++ b/tests/api-resources/cache/cache-reserve.test.ts @@ -35,6 +35,18 @@ describe('resource cacheReserve', () => { ).rejects.toThrow(Cloudflare.NotFoundError); }); + // skipped: tests are disabled for the time being + test.skip('clear', async () => { + const responsePromise = cloudflare.cache.cacheReserve.clear('023e105f4ecef8ad9ca31a8372d0c353'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('edit: only required params', async () => { const responsePromise = cloudflare.cache.cacheReserve.edit('023e105f4ecef8ad9ca31a8372d0c353', { @@ -55,4 +67,26 @@ describe('resource cacheReserve', () => { value: 'on', }); }); + + // skipped: tests are disabled for the time being + test.skip('status', async () => { + const responsePromise = cloudflare.cache.cacheReserve.status('023e105f4ecef8ad9ca31a8372d0c353'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('status: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.cache.cacheReserve.status('023e105f4ecef8ad9ca31a8372d0c353', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); }); diff --git a/tests/api-resources/radar/annotations/outages.test.ts b/tests/api-resources/radar/annotations/outages.test.ts index 78b53460f4..70f2d11a18 100644 --- a/tests/api-resources/radar/annotations/outages.test.ts +++ b/tests/api-resources/radar/annotations/outages.test.ts @@ -13,6 +13,46 @@ const cloudflare = new Cloudflare({ }); describe('resource outages', () => { + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.radar.annotations.outages.get(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.annotations.outages.get({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.annotations.outages.get( + { + asn: 0, + dateEnd: '2023-09-01T11:41:33.782Z', + dateRange: '7d', + dateStart: '2023-09-01T11:41:33.782Z', + format: 'JSON', + limit: 5, + location: 'US', + offset: 0, + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + // skipped: tests are disabled for the time being test.skip('locations', async () => { const responsePromise = cloudflare.radar.annotations.outages.locations(); diff --git a/tests/api-resources/radar/attacks/layer7/layer7.test.ts b/tests/api-resources/radar/attacks/layer7/layer7.test.ts index 6169295a8f..4636cd78be 100644 --- a/tests/api-resources/radar/attacks/layer7/layer7.test.ts +++ b/tests/api-resources/radar/attacks/layer7/layer7.test.ts @@ -41,17 +41,14 @@ describe('resource layer7', () => { { aggInterval: '1h', asn: ['string', 'string', 'string'], + attack: ['DDOS', 'WAF', 'BOT_MANAGEMENT'], dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], dateRange: ['1d', '2d', '7d'], dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - direction: 'ORIGIN', format: 'JSON', - ipVersion: ['IPv4', 'IPv6'], location: ['string', 'string', 'string'], - metric: 'BYTES', name: ['string', 'string', 'string'], normalization: 'MIN0_MAX', - protocol: ['UDP', 'TCP', 'ICMP'], }, { path: '/_stainless_unknown_path' }, ), diff --git a/tests/api-resources/radar/attacks/layer7/summary.test.ts b/tests/api-resources/radar/attacks/layer7/summary.test.ts index 7479d456c6..266cbde2ef 100644 --- a/tests/api-resources/radar/attacks/layer7/summary.test.ts +++ b/tests/api-resources/radar/attacks/layer7/summary.test.ts @@ -14,8 +14,8 @@ const cloudflare = new Cloudflare({ describe('resource summary', () => { // skipped: tests are disabled for the time being - test.skip('bitrate', async () => { - const responsePromise = cloudflare.radar.attacks.layer7.summary.bitrate(); + test.skip('get', async () => { + const responsePromise = cloudflare.radar.attacks.layer7.summary.get(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -26,28 +26,26 @@ describe('resource summary', () => { }); // skipped: tests are disabled for the time being - test.skip('bitrate: request options instead of params are passed correctly', async () => { + test.skip('get: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.attacks.layer7.summary.bitrate({ path: '/_stainless_unknown_path' }), + cloudflare.radar.attacks.layer7.summary.get({ path: '/_stainless_unknown_path' }), ).rejects.toThrow(Cloudflare.NotFoundError); }); // skipped: tests are disabled for the time being - test.skip('bitrate: request options and params are passed correctly', async () => { + test.skip('get: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.attacks.layer7.summary.bitrate( + cloudflare.radar.attacks.layer7.summary.get( { + asn: ['string', 'string', 'string'], dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], dateRange: ['1d', '2d', '7d'], dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - direction: 'ORIGIN', format: 'JSON', - ipVersion: ['IPv4', 'IPv6'], location: ['string', 'string', 'string'], name: ['string', 'string', 'string'], - protocol: ['UDP', 'TCP', 'ICMP'], }, { path: '/_stainless_unknown_path' }, ), @@ -55,8 +53,8 @@ describe('resource summary', () => { }); // skipped: tests are disabled for the time being - test.skip('duration', async () => { - const responsePromise = cloudflare.radar.attacks.layer7.summary.duration(); + test.skip('httpMethod', async () => { + const responsePromise = cloudflare.radar.attacks.layer7.summary.httpMethod(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -67,28 +65,29 @@ describe('resource summary', () => { }); // skipped: tests are disabled for the time being - test.skip('duration: request options instead of params are passed correctly', async () => { + test.skip('httpMethod: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.attacks.layer7.summary.duration({ path: '/_stainless_unknown_path' }), + cloudflare.radar.attacks.layer7.summary.httpMethod({ path: '/_stainless_unknown_path' }), ).rejects.toThrow(Cloudflare.NotFoundError); }); // skipped: tests are disabled for the time being - test.skip('duration: request options and params are passed correctly', async () => { + test.skip('httpMethod: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.attacks.layer7.summary.duration( + cloudflare.radar.attacks.layer7.summary.httpMethod( { + asn: ['string', 'string', 'string'], dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], dateRange: ['1d', '2d', '7d'], dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - direction: 'ORIGIN', format: 'JSON', + httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], ipVersion: ['IPv4', 'IPv6'], location: ['string', 'string', 'string'], + mitigationProduct: ['DDOS', 'WAF', 'BOT_MANAGEMENT'], name: ['string', 'string', 'string'], - protocol: ['UDP', 'TCP', 'ICMP'], }, { path: '/_stainless_unknown_path' }, ), @@ -96,8 +95,8 @@ describe('resource summary', () => { }); // skipped: tests are disabled for the time being - test.skip('get', async () => { - const responsePromise = cloudflare.radar.attacks.layer7.summary.get(); + test.skip('httpVersion', async () => { + const responsePromise = cloudflare.radar.attacks.layer7.summary.httpVersion(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -108,25 +107,28 @@ describe('resource summary', () => { }); // skipped: tests are disabled for the time being - test.skip('get: request options instead of params are passed correctly', async () => { + test.skip('httpVersion: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.attacks.layer7.summary.get({ path: '/_stainless_unknown_path' }), + cloudflare.radar.attacks.layer7.summary.httpVersion({ path: '/_stainless_unknown_path' }), ).rejects.toThrow(Cloudflare.NotFoundError); }); // skipped: tests are disabled for the time being - test.skip('get: request options and params are passed correctly', async () => { + test.skip('httpVersion: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.attacks.layer7.summary.get( + cloudflare.radar.attacks.layer7.summary.httpVersion( { asn: ['string', 'string', 'string'], dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], dateRange: ['1d', '2d', '7d'], dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], format: 'JSON', + httpMethod: ['GET', 'POST', 'DELETE'], + ipVersion: ['IPv4', 'IPv6'], location: ['string', 'string', 'string'], + mitigationProduct: ['DDOS', 'WAF', 'BOT_MANAGEMENT'], name: ['string', 'string', 'string'], }, { path: '/_stainless_unknown_path' }, @@ -160,14 +162,16 @@ describe('resource summary', () => { await expect( cloudflare.radar.attacks.layer7.summary.ipVersion( { + asn: ['string', 'string', 'string'], dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], dateRange: ['1d', '2d', '7d'], dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - direction: 'ORIGIN', format: 'JSON', + httpMethod: ['GET', 'POST', 'DELETE'], + httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], location: ['string', 'string', 'string'], + mitigationProduct: ['DDOS', 'WAF', 'BOT_MANAGEMENT'], name: ['string', 'string', 'string'], - protocol: ['UDP', 'TCP', 'ICMP'], }, { path: '/_stainless_unknown_path' }, ), @@ -175,8 +179,8 @@ describe('resource summary', () => { }); // skipped: tests are disabled for the time being - test.skip('protocol', async () => { - const responsePromise = cloudflare.radar.attacks.layer7.summary.protocol(); + test.skip('managedRules', async () => { + const responsePromise = cloudflare.radar.attacks.layer7.summary.managedRules(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -187,26 +191,29 @@ describe('resource summary', () => { }); // skipped: tests are disabled for the time being - test.skip('protocol: request options instead of params are passed correctly', async () => { + test.skip('managedRules: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.attacks.layer7.summary.protocol({ path: '/_stainless_unknown_path' }), + cloudflare.radar.attacks.layer7.summary.managedRules({ path: '/_stainless_unknown_path' }), ).rejects.toThrow(Cloudflare.NotFoundError); }); // skipped: tests are disabled for the time being - test.skip('protocol: request options and params are passed correctly', async () => { + test.skip('managedRules: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.attacks.layer7.summary.protocol( + cloudflare.radar.attacks.layer7.summary.managedRules( { + asn: ['string', 'string', 'string'], dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], dateRange: ['1d', '2d', '7d'], dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - direction: 'ORIGIN', format: 'JSON', + httpMethod: ['GET', 'POST', 'DELETE'], + httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], ipVersion: ['IPv4', 'IPv6'], location: ['string', 'string', 'string'], + mitigationProduct: ['DDOS', 'WAF', 'BOT_MANAGEMENT'], name: ['string', 'string', 'string'], }, { path: '/_stainless_unknown_path' }, @@ -215,8 +222,8 @@ describe('resource summary', () => { }); // skipped: tests are disabled for the time being - test.skip('vector', async () => { - const responsePromise = cloudflare.radar.attacks.layer7.summary.vector(); + test.skip('mitigationProduct', async () => { + const responsePromise = cloudflare.radar.attacks.layer7.summary.mitigationProduct(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -227,28 +234,29 @@ describe('resource summary', () => { }); // skipped: tests are disabled for the time being - test.skip('vector: request options instead of params are passed correctly', async () => { + test.skip('mitigationProduct: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.attacks.layer7.summary.vector({ path: '/_stainless_unknown_path' }), + cloudflare.radar.attacks.layer7.summary.mitigationProduct({ path: '/_stainless_unknown_path' }), ).rejects.toThrow(Cloudflare.NotFoundError); }); // skipped: tests are disabled for the time being - test.skip('vector: request options and params are passed correctly', async () => { + test.skip('mitigationProduct: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.attacks.layer7.summary.vector( + cloudflare.radar.attacks.layer7.summary.mitigationProduct( { + asn: ['string', 'string', 'string'], dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], dateRange: ['1d', '2d', '7d'], dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - direction: 'ORIGIN', format: 'JSON', + httpMethod: ['GET', 'POST', 'DELETE'], + httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], ipVersion: ['IPv4', 'IPv6'], location: ['string', 'string', 'string'], name: ['string', 'string', 'string'], - protocol: ['UDP', 'TCP', 'ICMP'], }, { path: '/_stainless_unknown_path' }, ), diff --git a/tests/api-resources/radar/attacks/layer7/timeseries-groups.test.ts b/tests/api-resources/radar/attacks/layer7/timeseries-groups.test.ts index 67d4ba8c55..3ec60248c4 100644 --- a/tests/api-resources/radar/attacks/layer7/timeseries-groups.test.ts +++ b/tests/api-resources/radar/attacks/layer7/timeseries-groups.test.ts @@ -14,8 +14,8 @@ const cloudflare = new Cloudflare({ describe('resource timeseriesGroups', () => { // skipped: tests are disabled for the time being - test.skip('bitrate', async () => { - const responsePromise = cloudflare.radar.attacks.layer7.timeseriesGroups.bitrate(); + test.skip('get', async () => { + const responsePromise = cloudflare.radar.attacks.layer7.timeseriesGroups.get(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -26,30 +26,27 @@ describe('resource timeseriesGroups', () => { }); // skipped: tests are disabled for the time being - test.skip('bitrate: request options instead of params are passed correctly', async () => { + test.skip('get: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.attacks.layer7.timeseriesGroups.bitrate({ path: '/_stainless_unknown_path' }), + cloudflare.radar.attacks.layer7.timeseriesGroups.get({ path: '/_stainless_unknown_path' }), ).rejects.toThrow(Cloudflare.NotFoundError); }); // skipped: tests are disabled for the time being - test.skip('bitrate: request options and params are passed correctly', async () => { + test.skip('get: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.attacks.layer7.timeseriesGroups.bitrate( + cloudflare.radar.attacks.layer7.timeseriesGroups.get( { aggInterval: '1h', + asn: ['string', 'string', 'string'], dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], dateRange: ['1d', '2d', '7d'], dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - direction: 'ORIGIN', format: 'JSON', - ipVersion: ['IPv4', 'IPv6'], location: ['string', 'string', 'string'], name: ['string', 'string', 'string'], - normalization: 'PERCENTAGE', - protocol: ['UDP', 'TCP', 'ICMP'], }, { path: '/_stainless_unknown_path' }, ), @@ -57,8 +54,8 @@ describe('resource timeseriesGroups', () => { }); // skipped: tests are disabled for the time being - test.skip('duration', async () => { - const responsePromise = cloudflare.radar.attacks.layer7.timeseriesGroups.duration(); + test.skip('httpMethod', async () => { + const responsePromise = cloudflare.radar.attacks.layer7.timeseriesGroups.httpMethod(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -69,30 +66,31 @@ describe('resource timeseriesGroups', () => { }); // skipped: tests are disabled for the time being - test.skip('duration: request options instead of params are passed correctly', async () => { + test.skip('httpMethod: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.attacks.layer7.timeseriesGroups.duration({ path: '/_stainless_unknown_path' }), + cloudflare.radar.attacks.layer7.timeseriesGroups.httpMethod({ path: '/_stainless_unknown_path' }), ).rejects.toThrow(Cloudflare.NotFoundError); }); // skipped: tests are disabled for the time being - test.skip('duration: request options and params are passed correctly', async () => { + test.skip('httpMethod: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.attacks.layer7.timeseriesGroups.duration( + cloudflare.radar.attacks.layer7.timeseriesGroups.httpMethod( { aggInterval: '1h', + asn: ['string', 'string', 'string'], dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], dateRange: ['1d', '2d', '7d'], dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - direction: 'ORIGIN', format: 'JSON', + httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], ipVersion: ['IPv4', 'IPv6'], location: ['string', 'string', 'string'], + mitigationProduct: ['DDOS', 'WAF', 'BOT_MANAGEMENT'], name: ['string', 'string', 'string'], normalization: 'PERCENTAGE', - protocol: ['UDP', 'TCP', 'ICMP'], }, { path: '/_stainless_unknown_path' }, ), @@ -100,8 +98,8 @@ describe('resource timeseriesGroups', () => { }); // skipped: tests are disabled for the time being - test.skip('get', async () => { - const responsePromise = cloudflare.radar.attacks.layer7.timeseriesGroups.get(); + test.skip('httpVersion', async () => { + const responsePromise = cloudflare.radar.attacks.layer7.timeseriesGroups.httpVersion(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -112,18 +110,18 @@ describe('resource timeseriesGroups', () => { }); // skipped: tests are disabled for the time being - test.skip('get: request options instead of params are passed correctly', async () => { + test.skip('httpVersion: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.attacks.layer7.timeseriesGroups.get({ path: '/_stainless_unknown_path' }), + cloudflare.radar.attacks.layer7.timeseriesGroups.httpVersion({ path: '/_stainless_unknown_path' }), ).rejects.toThrow(Cloudflare.NotFoundError); }); // skipped: tests are disabled for the time being - test.skip('get: request options and params are passed correctly', async () => { + test.skip('httpVersion: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.attacks.layer7.timeseriesGroups.get( + cloudflare.radar.attacks.layer7.timeseriesGroups.httpVersion( { aggInterval: '1h', asn: ['string', 'string', 'string'], @@ -131,8 +129,12 @@ describe('resource timeseriesGroups', () => { dateRange: ['1d', '2d', '7d'], dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], format: 'JSON', + httpMethod: ['GET', 'POST', 'DELETE'], + ipVersion: ['IPv4', 'IPv6'], location: ['string', 'string', 'string'], + mitigationProduct: ['DDOS', 'WAF', 'BOT_MANAGEMENT'], name: ['string', 'string', 'string'], + normalization: 'PERCENTAGE', }, { path: '/_stainless_unknown_path' }, ), @@ -166,14 +168,17 @@ describe('resource timeseriesGroups', () => { cloudflare.radar.attacks.layer7.timeseriesGroups.industry( { aggInterval: '1h', + asn: ['string', 'string', 'string'], dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], dateRange: ['1d', '2d', '7d'], dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - direction: 'ORIGIN', format: 'JSON', + httpMethod: ['GET', 'POST', 'DELETE'], + httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], ipVersion: ['IPv4', 'IPv6'], limitPerGroup: 4, location: ['string', 'string', 'string'], + mitigationProduct: ['DDOS', 'WAF', 'BOT_MANAGEMENT'], name: ['string', 'string', 'string'], normalization: 'PERCENTAGE', }, @@ -209,15 +214,17 @@ describe('resource timeseriesGroups', () => { cloudflare.radar.attacks.layer7.timeseriesGroups.ipVersion( { aggInterval: '1h', + asn: ['string', 'string', 'string'], dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], dateRange: ['1d', '2d', '7d'], dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - direction: 'ORIGIN', format: 'JSON', + httpMethod: ['GET', 'POST', 'DELETE'], + httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], location: ['string', 'string', 'string'], + mitigationProduct: ['DDOS', 'WAF', 'BOT_MANAGEMENT'], name: ['string', 'string', 'string'], normalization: 'PERCENTAGE', - protocol: ['UDP', 'TCP', 'ICMP'], }, { path: '/_stainless_unknown_path' }, ), @@ -225,8 +232,8 @@ describe('resource timeseriesGroups', () => { }); // skipped: tests are disabled for the time being - test.skip('protocol', async () => { - const responsePromise = cloudflare.radar.attacks.layer7.timeseriesGroups.protocol(); + test.skip('managedRules', async () => { + const responsePromise = cloudflare.radar.attacks.layer7.timeseriesGroups.managedRules(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -237,27 +244,30 @@ describe('resource timeseriesGroups', () => { }); // skipped: tests are disabled for the time being - test.skip('protocol: request options instead of params are passed correctly', async () => { + test.skip('managedRules: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.attacks.layer7.timeseriesGroups.protocol({ path: '/_stainless_unknown_path' }), + cloudflare.radar.attacks.layer7.timeseriesGroups.managedRules({ path: '/_stainless_unknown_path' }), ).rejects.toThrow(Cloudflare.NotFoundError); }); // skipped: tests are disabled for the time being - test.skip('protocol: request options and params are passed correctly', async () => { + test.skip('managedRules: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.attacks.layer7.timeseriesGroups.protocol( + cloudflare.radar.attacks.layer7.timeseriesGroups.managedRules( { aggInterval: '1h', + asn: ['string', 'string', 'string'], dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], dateRange: ['1d', '2d', '7d'], dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - direction: 'ORIGIN', format: 'JSON', + httpMethod: ['GET', 'POST', 'DELETE'], + httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], ipVersion: ['IPv4', 'IPv6'], location: ['string', 'string', 'string'], + mitigationProduct: ['DDOS', 'WAF', 'BOT_MANAGEMENT'], name: ['string', 'string', 'string'], normalization: 'PERCENTAGE', }, @@ -267,8 +277,8 @@ describe('resource timeseriesGroups', () => { }); // skipped: tests are disabled for the time being - test.skip('vector', async () => { - const responsePromise = cloudflare.radar.attacks.layer7.timeseriesGroups.vector(); + test.skip('mitigationProduct', async () => { + const responsePromise = cloudflare.radar.attacks.layer7.timeseriesGroups.mitigationProduct(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -279,31 +289,33 @@ describe('resource timeseriesGroups', () => { }); // skipped: tests are disabled for the time being - test.skip('vector: request options instead of params are passed correctly', async () => { + test.skip('mitigationProduct: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.attacks.layer7.timeseriesGroups.vector({ path: '/_stainless_unknown_path' }), + cloudflare.radar.attacks.layer7.timeseriesGroups.mitigationProduct({ + path: '/_stainless_unknown_path', + }), ).rejects.toThrow(Cloudflare.NotFoundError); }); // skipped: tests are disabled for the time being - test.skip('vector: request options and params are passed correctly', async () => { + test.skip('mitigationProduct: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.attacks.layer7.timeseriesGroups.vector( + cloudflare.radar.attacks.layer7.timeseriesGroups.mitigationProduct( { aggInterval: '1h', + asn: ['string', 'string', 'string'], dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], dateRange: ['1d', '2d', '7d'], dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - direction: 'ORIGIN', format: 'JSON', + httpMethod: ['GET', 'POST', 'DELETE'], + httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], ipVersion: ['IPv4', 'IPv6'], - limitPerGroup: 4, location: ['string', 'string', 'string'], name: ['string', 'string', 'string'], normalization: 'PERCENTAGE', - protocol: ['UDP', 'TCP', 'ICMP'], }, { path: '/_stainless_unknown_path' }, ), @@ -337,14 +349,17 @@ describe('resource timeseriesGroups', () => { cloudflare.radar.attacks.layer7.timeseriesGroups.vertical( { aggInterval: '1h', + asn: ['string', 'string', 'string'], dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], dateRange: ['1d', '2d', '7d'], dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], - direction: 'ORIGIN', format: 'JSON', + httpMethod: ['GET', 'POST', 'DELETE'], + httpVersion: ['HTTPv1', 'HTTPv2', 'HTTPv3'], ipVersion: ['IPv4', 'IPv6'], limitPerGroup: 4, location: ['string', 'string', 'string'], + mitigationProduct: ['DDOS', 'WAF', 'BOT_MANAGEMENT'], name: ['string', 'string', 'string'], normalization: 'PERCENTAGE', }, diff --git a/tests/api-resources/radar/attacks/layer7/top/ases.test.ts b/tests/api-resources/radar/attacks/layer7/top/ases.test.ts new file mode 100644 index 0000000000..ff6b508f5e --- /dev/null +++ b/tests/api-resources/radar/attacks/layer7/top/ases.test.ts @@ -0,0 +1,54 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource ases', () => { + // skipped: tests are disabled for the time being + test.skip('origin', async () => { + const responsePromise = cloudflare.radar.attacks.layer7.top.ases.origin(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('origin: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.top.ases.origin({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('origin: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.attacks.layer7.top.ases.origin( + { + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/attacks/layer7/top/locations.test.ts b/tests/api-resources/radar/attacks/layer7/top/locations.test.ts index 2854d88933..45bceb6180 100644 --- a/tests/api-resources/radar/attacks/layer7/top/locations.test.ts +++ b/tests/api-resources/radar/attacks/layer7/top/locations.test.ts @@ -39,15 +39,13 @@ describe('resource locations', () => { await expect( cloudflare.radar.attacks.layer7.top.locations.origin( { + asn: ['string', 'string', 'string'], dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], dateRange: ['1d', '2d', '7d'], dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], format: 'JSON', - ipVersion: ['IPv4', 'IPv6'], limit: 5, - location: ['string', 'string', 'string'], name: ['string', 'string', 'string'], - protocol: ['UDP', 'TCP', 'ICMP'], }, { path: '/_stainless_unknown_path' }, ), @@ -84,11 +82,8 @@ describe('resource locations', () => { dateRange: ['1d', '2d', '7d'], dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], format: 'JSON', - ipVersion: ['IPv4', 'IPv6'], limit: 5, - location: ['string', 'string', 'string'], name: ['string', 'string', 'string'], - protocol: ['UDP', 'TCP', 'ICMP'], }, { path: '/_stainless_unknown_path' }, ), diff --git a/tests/api-resources/radar/attacks/layer7/top/top.test.ts b/tests/api-resources/radar/attacks/layer7/top/top.test.ts index 95153e8140..a5582d6aa5 100644 --- a/tests/api-resources/radar/attacks/layer7/top/top.test.ts +++ b/tests/api-resources/radar/attacks/layer7/top/top.test.ts @@ -39,17 +39,17 @@ describe('resource top', () => { await expect( cloudflare.radar.attacks.layer7.top.attacks( { + asn: ['string', 'string', 'string'], dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], dateRange: ['1d', '2d', '7d'], dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], format: 'JSON', - ipVersion: ['IPv4', 'IPv6'], limit: 5, limitDirection: 'ORIGIN', limitPerLocation: 10, location: ['string', 'string', 'string'], + magnitude: 'MITIGATED_REQUESTS', name: ['string', 'string', 'string'], - protocol: ['UDP', 'TCP', 'ICMP'], }, { path: '/_stainless_unknown_path' }, ), @@ -82,15 +82,14 @@ describe('resource top', () => { await expect( cloudflare.radar.attacks.layer7.top.industry( { + asn: ['string', 'string', 'string'], dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], dateRange: ['1d', '2d', '7d'], dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], format: 'JSON', - ipVersion: ['IPv4', 'IPv6'], limit: 5, location: ['string', 'string', 'string'], name: ['string', 'string', 'string'], - protocol: ['UDP', 'TCP', 'ICMP'], }, { path: '/_stainless_unknown_path' }, ), @@ -123,15 +122,14 @@ describe('resource top', () => { await expect( cloudflare.radar.attacks.layer7.top.vertical( { + asn: ['string', 'string', 'string'], dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], dateRange: ['1d', '2d', '7d'], dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], format: 'JSON', - ipVersion: ['IPv4', 'IPv6'], limit: 5, location: ['string', 'string', 'string'], name: ['string', 'string', 'string'], - protocol: ['UDP', 'TCP', 'ICMP'], }, { path: '/_stainless_unknown_path' }, ), diff --git a/tests/api-resources/radar/bgp/top/ases.test.ts b/tests/api-resources/radar/bgp/top/ases.test.ts new file mode 100644 index 0000000000..312233a473 --- /dev/null +++ b/tests/api-resources/radar/bgp/top/ases.test.ts @@ -0,0 +1,87 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource ases', () => { + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.radar.bgp.top.ases.get(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(cloudflare.radar.bgp.top.ases.get({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.bgp.top.ases.get( + { + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + limit: 5, + name: ['string', 'string', 'string'], + prefix: ['string', 'string', 'string'], + updateType: ['ANNOUNCEMENT', 'WITHDRAWAL'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('prefixes', async () => { + const responsePromise = cloudflare.radar.bgp.top.ases.prefixes(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('prefixes: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.bgp.top.ases.prefixes({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('prefixes: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.bgp.top.ases.prefixes( + { country: 'NZ', format: 'JSON', limit: 10 }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/bgp/tops/ases.test.ts b/tests/api-resources/radar/bgp/top/top.test.ts similarity index 69% rename from tests/api-resources/radar/bgp/tops/ases.test.ts rename to tests/api-resources/radar/bgp/top/top.test.ts index 4d00eb1586..0fd26db19e 100644 --- a/tests/api-resources/radar/bgp/tops/ases.test.ts +++ b/tests/api-resources/radar/bgp/top/top.test.ts @@ -12,10 +12,10 @@ const cloudflare = new Cloudflare({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource ases', () => { +describe('resource top', () => { // skipped: tests are disabled for the time being test.skip('prefixes', async () => { - const responsePromise = cloudflare.radar.bgp.tops.ases.prefixes(); + const responsePromise = cloudflare.radar.bgp.top.prefixes(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -28,17 +28,26 @@ describe('resource ases', () => { // skipped: tests are disabled for the time being test.skip('prefixes: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.radar.bgp.tops.ases.prefixes({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); + await expect(cloudflare.radar.bgp.top.prefixes({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); }); // skipped: tests are disabled for the time being test.skip('prefixes: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.radar.bgp.tops.ases.prefixes( - { country: 'NZ', format: 'JSON', limit: 10 }, + cloudflare.radar.bgp.top.prefixes( + { + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + limit: 5, + name: ['string', 'string', 'string'], + updateType: ['ANNOUNCEMENT', 'WITHDRAWAL'], + }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(Cloudflare.NotFoundError); diff --git a/tests/api-resources/radar/email/security/top/ases/arc.test.ts b/tests/api-resources/radar/email/security/top/ases/arc.test.ts new file mode 100644 index 0000000000..320ca177b5 --- /dev/null +++ b/tests/api-resources/radar/email/security/top/ases/arc.test.ts @@ -0,0 +1,59 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource arc', () => { + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.radar.email.security.top.ases.arc.get('PASS'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.top.ases.arc.get('PASS', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.top.ases.arc.get( + 'PASS', + { + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dkim: ['PASS', 'NONE', 'FAIL'], + dmarc: ['PASS', 'NONE', 'FAIL'], + format: 'JSON', + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + spf: ['PASS', 'NONE', 'FAIL'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/email/security/top/ases/ases.test.ts b/tests/api-resources/radar/email/security/top/ases/ases.test.ts new file mode 100644 index 0000000000..6867308c3c --- /dev/null +++ b/tests/api-resources/radar/email/security/top/ases/ases.test.ts @@ -0,0 +1,59 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource ases', () => { + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.radar.email.security.top.ases.get(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.top.ases.get({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.top.ases.get( + { + arc: ['PASS', 'NONE', 'FAIL'], + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dkim: ['PASS', 'NONE', 'FAIL'], + dmarc: ['PASS', 'NONE', 'FAIL'], + format: 'JSON', + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + spf: ['PASS', 'NONE', 'FAIL'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/email/security/top/ases/dkim.test.ts b/tests/api-resources/radar/email/security/top/ases/dkim.test.ts new file mode 100644 index 0000000000..d6883ad1a2 --- /dev/null +++ b/tests/api-resources/radar/email/security/top/ases/dkim.test.ts @@ -0,0 +1,59 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource dkim', () => { + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.radar.email.security.top.ases.dkim.get('PASS'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.top.ases.dkim.get('PASS', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.top.ases.dkim.get( + 'PASS', + { + arc: ['PASS', 'NONE', 'FAIL'], + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dmarc: ['PASS', 'NONE', 'FAIL'], + format: 'JSON', + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + spf: ['PASS', 'NONE', 'FAIL'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/email/security/top/ases/dmarc.test.ts b/tests/api-resources/radar/email/security/top/ases/dmarc.test.ts new file mode 100644 index 0000000000..db0921f76a --- /dev/null +++ b/tests/api-resources/radar/email/security/top/ases/dmarc.test.ts @@ -0,0 +1,59 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource dmarc', () => { + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.radar.email.security.top.ases.dmarc.get('PASS'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.top.ases.dmarc.get('PASS', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.top.ases.dmarc.get( + 'PASS', + { + arc: ['PASS', 'NONE', 'FAIL'], + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dkim: ['PASS', 'NONE', 'FAIL'], + format: 'JSON', + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + spf: ['PASS', 'NONE', 'FAIL'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/email/security/top/ases/malicious.test.ts b/tests/api-resources/radar/email/security/top/ases/malicious.test.ts new file mode 100644 index 0000000000..9ae7b995c4 --- /dev/null +++ b/tests/api-resources/radar/email/security/top/ases/malicious.test.ts @@ -0,0 +1,62 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource malicious', () => { + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.radar.email.security.top.ases.malicious.get('MALICIOUS'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.top.ases.malicious.get('MALICIOUS', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.top.ases.malicious.get( + 'MALICIOUS', + { + arc: ['PASS', 'NONE', 'FAIL'], + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dkim: ['PASS', 'NONE', 'FAIL'], + dmarc: ['PASS', 'NONE', 'FAIL'], + format: 'JSON', + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + spf: ['PASS', 'NONE', 'FAIL'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/email/security/top/ases/spam.test.ts b/tests/api-resources/radar/email/security/top/ases/spam.test.ts new file mode 100644 index 0000000000..bea2d7d95b --- /dev/null +++ b/tests/api-resources/radar/email/security/top/ases/spam.test.ts @@ -0,0 +1,60 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource spam', () => { + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.radar.email.security.top.ases.spam.get('SPAM'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.top.ases.spam.get('SPAM', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.top.ases.spam.get( + 'SPAM', + { + arc: ['PASS', 'NONE', 'FAIL'], + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dkim: ['PASS', 'NONE', 'FAIL'], + dmarc: ['PASS', 'NONE', 'FAIL'], + format: 'JSON', + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + spf: ['PASS', 'NONE', 'FAIL'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/email/security/top/ases/spf.test.ts b/tests/api-resources/radar/email/security/top/ases/spf.test.ts new file mode 100644 index 0000000000..b1c64c8e02 --- /dev/null +++ b/tests/api-resources/radar/email/security/top/ases/spf.test.ts @@ -0,0 +1,59 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource spf', () => { + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.radar.email.security.top.ases.spf.get('PASS'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.top.ases.spf.get('PASS', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.top.ases.spf.get( + 'PASS', + { + arc: ['PASS', 'NONE', 'FAIL'], + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dkim: ['PASS', 'NONE', 'FAIL'], + dmarc: ['PASS', 'NONE', 'FAIL'], + format: 'JSON', + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/email/security/top/locations/arc.test.ts b/tests/api-resources/radar/email/security/top/locations/arc.test.ts new file mode 100644 index 0000000000..e613fa2eee --- /dev/null +++ b/tests/api-resources/radar/email/security/top/locations/arc.test.ts @@ -0,0 +1,59 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource arc', () => { + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.radar.email.security.top.locations.arc.get('PASS'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.top.locations.arc.get('PASS', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.top.locations.arc.get( + 'PASS', + { + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dkim: ['PASS', 'NONE', 'FAIL'], + dmarc: ['PASS', 'NONE', 'FAIL'], + format: 'JSON', + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + spf: ['PASS', 'NONE', 'FAIL'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/email/security/top/locations/dkim.test.ts b/tests/api-resources/radar/email/security/top/locations/dkim.test.ts new file mode 100644 index 0000000000..51e3750493 --- /dev/null +++ b/tests/api-resources/radar/email/security/top/locations/dkim.test.ts @@ -0,0 +1,59 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource dkim', () => { + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.radar.email.security.top.locations.dkim.get('PASS'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.top.locations.dkim.get('PASS', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.top.locations.dkim.get( + 'PASS', + { + arc: ['PASS', 'NONE', 'FAIL'], + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dmarc: ['PASS', 'NONE', 'FAIL'], + format: 'JSON', + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + spf: ['PASS', 'NONE', 'FAIL'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/email/security/top/locations/dmarc.test.ts b/tests/api-resources/radar/email/security/top/locations/dmarc.test.ts new file mode 100644 index 0000000000..36c9ff9dd5 --- /dev/null +++ b/tests/api-resources/radar/email/security/top/locations/dmarc.test.ts @@ -0,0 +1,59 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource dmarc', () => { + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.radar.email.security.top.locations.dmarc.get('PASS'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.top.locations.dmarc.get('PASS', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.top.locations.dmarc.get( + 'PASS', + { + arc: ['PASS', 'NONE', 'FAIL'], + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dkim: ['PASS', 'NONE', 'FAIL'], + format: 'JSON', + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + spf: ['PASS', 'NONE', 'FAIL'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/email/security/top/locations/locations.test.ts b/tests/api-resources/radar/email/security/top/locations/locations.test.ts new file mode 100644 index 0000000000..88f5a790b1 --- /dev/null +++ b/tests/api-resources/radar/email/security/top/locations/locations.test.ts @@ -0,0 +1,59 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource locations', () => { + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.radar.email.security.top.locations.get(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.top.locations.get({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.top.locations.get( + { + arc: ['PASS', 'NONE', 'FAIL'], + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dkim: ['PASS', 'NONE', 'FAIL'], + dmarc: ['PASS', 'NONE', 'FAIL'], + format: 'JSON', + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + spf: ['PASS', 'NONE', 'FAIL'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/email/security/top/locations/malicious.test.ts b/tests/api-resources/radar/email/security/top/locations/malicious.test.ts new file mode 100644 index 0000000000..e134199f15 --- /dev/null +++ b/tests/api-resources/radar/email/security/top/locations/malicious.test.ts @@ -0,0 +1,62 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource malicious', () => { + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.radar.email.security.top.locations.malicious.get('MALICIOUS'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.top.locations.malicious.get('MALICIOUS', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.top.locations.malicious.get( + 'MALICIOUS', + { + arc: ['PASS', 'NONE', 'FAIL'], + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dkim: ['PASS', 'NONE', 'FAIL'], + dmarc: ['PASS', 'NONE', 'FAIL'], + format: 'JSON', + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + spf: ['PASS', 'NONE', 'FAIL'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/email/security/top/locations/spam.test.ts b/tests/api-resources/radar/email/security/top/locations/spam.test.ts new file mode 100644 index 0000000000..b79c3ea8c9 --- /dev/null +++ b/tests/api-resources/radar/email/security/top/locations/spam.test.ts @@ -0,0 +1,60 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource spam', () => { + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.radar.email.security.top.locations.spam.get('SPAM'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.top.locations.spam.get('SPAM', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.top.locations.spam.get( + 'SPAM', + { + arc: ['PASS', 'NONE', 'FAIL'], + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dkim: ['PASS', 'NONE', 'FAIL'], + dmarc: ['PASS', 'NONE', 'FAIL'], + format: 'JSON', + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + spf: ['PASS', 'NONE', 'FAIL'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/email/security/top/locations/spf.test.ts b/tests/api-resources/radar/email/security/top/locations/spf.test.ts new file mode 100644 index 0000000000..439b49285e --- /dev/null +++ b/tests/api-resources/radar/email/security/top/locations/spf.test.ts @@ -0,0 +1,59 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: + 'v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource spf', () => { + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.radar.email.security.top.locations.spf.get('PASS'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.top.locations.spf.get('PASS', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.radar.email.security.top.locations.spf.get( + 'PASS', + { + arc: ['PASS', 'NONE', 'FAIL'], + asn: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dkim: ['PASS', 'NONE', 'FAIL'], + dmarc: ['PASS', 'NONE', 'FAIL'], + format: 'JSON', + limit: 5, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/quality/iqi.test.ts b/tests/api-resources/radar/quality/iqi.test.ts index 118457f358..334d8175f9 100644 --- a/tests/api-resources/radar/quality/iqi.test.ts +++ b/tests/api-resources/radar/quality/iqi.test.ts @@ -39,4 +39,33 @@ describe('resource iqi', () => { name: ['string', 'string', 'string'], }); }); + + // skipped: tests are disabled for the time being + test.skip('timeseriesGroups: only required params', async () => { + const responsePromise = cloudflare.radar.quality.iqi.timeseriesGroups({ metric: 'BANDWIDTH' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('timeseriesGroups: required and optional params', async () => { + const response = await cloudflare.radar.quality.iqi.timeseriesGroups({ + metric: 'BANDWIDTH', + aggInterval: '1h', + asn: ['string', 'string', 'string'], + continent: ['string', 'string', 'string'], + dateEnd: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + dateRange: ['1d', '2d', '7d'], + dateStart: ['2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z', '2019-12-27T18:11:19.117Z'], + format: 'JSON', + interpolation: true, + location: ['string', 'string', 'string'], + name: ['string', 'string', 'string'], + }); + }); });