// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../../resource'; import { isRequestOptions } from '../../../../core'; import * as Core from '../../../../core'; export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of layer 3 attacks by bitrate over time. */ bitrate( query?: TimeseriesGroupBitrateParams, options?: Core.RequestOptions, ): Core.APIPromise; bitrate(options?: Core.RequestOptions): Core.APIPromise; bitrate( query: TimeseriesGroupBitrateParams | Core.RequestOptions = {}, options?: Core.RequestOptions, ): Core.APIPromise { if (isRequestOptions(query)) { return this.bitrate({}, query); } return ( this._client.get('/radar/attacks/layer3/timeseries_groups/bitrate', { query, ...options, }) as Core.APIPromise<{ result: TimeseriesGroupBitrateResponse }> )._thenUnwrap((obj) => obj.result); } /** * Retrieves the distribution of layer 3 attacks by duration over time. */ duration( query?: TimeseriesGroupDurationParams, options?: Core.RequestOptions, ): Core.APIPromise; duration(options?: Core.RequestOptions): Core.APIPromise; duration( query: TimeseriesGroupDurationParams | Core.RequestOptions = {}, options?: Core.RequestOptions, ): Core.APIPromise { if (isRequestOptions(query)) { return this.duration({}, query); } return ( this._client.get('/radar/attacks/layer3/timeseries_groups/duration', { query, ...options, }) as Core.APIPromise<{ result: TimeseriesGroupDurationResponse }> )._thenUnwrap((obj) => obj.result); } /** * Retrieves the distribution of layer 3 attacks by targeted industry over time. */ industry( query?: TimeseriesGroupIndustryParams, options?: Core.RequestOptions, ): Core.APIPromise; industry(options?: Core.RequestOptions): Core.APIPromise; industry( query: TimeseriesGroupIndustryParams | Core.RequestOptions = {}, options?: Core.RequestOptions, ): Core.APIPromise { if (isRequestOptions(query)) { return this.industry({}, query); } return ( this._client.get('/radar/attacks/layer3/timeseries_groups/industry', { query, ...options, }) as Core.APIPromise<{ result: TimeseriesGroupIndustryResponse }> )._thenUnwrap((obj) => obj.result); } /** * Retrieves the distribution of layer 3 attacks by IP version over time. */ ipVersion( query?: TimeseriesGroupIPVersionParams, options?: Core.RequestOptions, ): Core.APIPromise; ipVersion(options?: Core.RequestOptions): Core.APIPromise; ipVersion( query: TimeseriesGroupIPVersionParams | Core.RequestOptions = {}, options?: Core.RequestOptions, ): Core.APIPromise { if (isRequestOptions(query)) { return this.ipVersion({}, query); } return ( this._client.get('/radar/attacks/layer3/timeseries_groups/ip_version', { query, ...options, }) as Core.APIPromise<{ result: TimeseriesGroupIPVersionResponse }> )._thenUnwrap((obj) => obj.result); } /** * Retrieves the distribution of layer 3 attacks by protocol over time. */ protocol( query?: TimeseriesGroupProtocolParams, options?: Core.RequestOptions, ): Core.APIPromise; protocol(options?: Core.RequestOptions): Core.APIPromise; protocol( query: TimeseriesGroupProtocolParams | Core.RequestOptions = {}, options?: Core.RequestOptions, ): Core.APIPromise { if (isRequestOptions(query)) { return this.protocol({}, query); } return ( this._client.get('/radar/attacks/layer3/timeseries_groups/protocol', { query, ...options, }) as Core.APIPromise<{ result: TimeseriesGroupProtocolResponse }> )._thenUnwrap((obj) => obj.result); } /** * Retrieves the distribution of layer 3 attacks by vector over time. */ vector( query?: TimeseriesGroupVectorParams, options?: Core.RequestOptions, ): Core.APIPromise; vector(options?: Core.RequestOptions): Core.APIPromise; vector( query: TimeseriesGroupVectorParams | Core.RequestOptions = {}, options?: Core.RequestOptions, ): Core.APIPromise { if (isRequestOptions(query)) { return this.vector({}, query); } return ( this._client.get('/radar/attacks/layer3/timeseries_groups/vector', { query, ...options, }) as Core.APIPromise<{ result: TimeseriesGroupVectorResponse }> )._thenUnwrap((obj) => obj.result); } /** * Retrieves the distribution of layer 3 attacks by targeted vertical over time. */ vertical( query?: TimeseriesGroupVerticalParams, options?: Core.RequestOptions, ): Core.APIPromise; vertical(options?: Core.RequestOptions): Core.APIPromise; vertical( query: TimeseriesGroupVerticalParams | Core.RequestOptions = {}, options?: Core.RequestOptions, ): Core.APIPromise { if (isRequestOptions(query)) { return this.vertical({}, query); } return ( this._client.get('/radar/attacks/layer3/timeseries_groups/vertical', { query, ...options, }) as Core.APIPromise<{ result: TimeseriesGroupVerticalResponse }> )._thenUnwrap((obj) => obj.result); } } 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 TimeseriesGroupIndustryResponse { meta: unknown; serie_0: TimeseriesGroupIndustryResponse.Serie0; } export namespace TimeseriesGroupIndustryResponse { export interface Serie0 { timestamps: Array; [k: string]: Array | undefined; } } export interface TimeseriesGroupIPVersionResponse { meta: unknown; serie_0: TimeseriesGroupIPVersionResponse.Serie0; } export namespace TimeseriesGroupIPVersionResponse { export interface Serie0 { IPv4: Array; IPv6: Array; timestamps: Array; } } export interface TimeseriesGroupProtocolResponse { meta: unknown; serie_0: TimeseriesGroupProtocolResponse.Serie0; } export namespace TimeseriesGroupProtocolResponse { export interface Serie0 { GRE: Array; ICMP: Array; TCP: Array; timestamps: Array; UDP: Array; } } export interface TimeseriesGroupVectorResponse { meta: unknown; serie_0: TimeseriesGroupVectorResponse.Serie0; } export namespace TimeseriesGroupVectorResponse { export interface Serie0 { timestamps: Array; [k: string]: Array | undefined; } } export interface TimeseriesGroupVerticalResponse { meta: unknown; serie_0: TimeseriesGroupVerticalResponse.Serie0; } export namespace TimeseriesGroupVerticalResponse { export interface Serie0 { timestamps: Array; [k: string]: Array | undefined; } } export interface TimeseriesGroupBitrateParams { /** * 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'; /** * Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to * exclude continents from results. For example, `-EU,NA` excludes results from EU, * but includes results from NA. */ continent?: Array; /** * End of the date range (inclusive). */ dateEnd?: Array; /** * Filters results by the specified date range. 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; /** * Start of the date range. */ dateStart?: Array; /** * Together with the `location` parameter, will apply the filter to origin or * target location. */ direction?: 'ORIGIN' | 'TARGET'; /** * Format in which results will be returned. */ format?: 'JSON' | 'CSV'; /** * Filters results by IP version (Ipv4 vs. IPv6). */ ipVersion?: Array<'IPv4' | 'IPv6'>; /** * Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude * locations from results. For example, `-US,PT` excludes results from the US, but * includes results from PT. */ location?: Array; /** * Array of names used to label the series in the response. */ 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 { /** * 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'; /** * Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to * exclude continents from results. For example, `-EU,NA` excludes results from EU, * but includes results from NA. */ continent?: Array; /** * End of the date range (inclusive). */ dateEnd?: Array; /** * Filters results by the specified date range. 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; /** * Start of the date range. */ dateStart?: Array; /** * Together with the `location` parameter, will apply the filter to origin or * target location. */ direction?: 'ORIGIN' | 'TARGET'; /** * Format in which results will be returned. */ format?: 'JSON' | 'CSV'; /** * Filters results by IP version (Ipv4 vs. IPv6). */ ipVersion?: Array<'IPv4' | 'IPv6'>; /** * Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude * locations from results. For example, `-US,PT` excludes results from the US, but * includes results from PT. */ location?: Array; /** * Array of names used to label the series in the response. */ 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 TimeseriesGroupIndustryParams { /** * 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'; /** * Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to * exclude continents from results. For example, `-EU,NA` excludes results from EU, * but includes results from NA. */ continent?: Array; /** * End of the date range (inclusive). */ dateEnd?: Array; /** * Filters results by the specified date range. 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; /** * Start of the date range. */ dateStart?: Array; /** * Together with the `location` parameter, will apply the filter to origin or * target location. */ direction?: 'ORIGIN' | 'TARGET'; /** * Format in which results will be returned. */ format?: 'JSON' | 'CSV'; /** * Filters results by IP version (Ipv4 vs. IPv6). */ ipVersion?: Array<'IPv4' | 'IPv6'>; /** * Limits the number of objects per group to the top items within the specified * time range. If there are more items than the limit, the response will include * the count of items, with any remaining items grouped together under an "other" * category. */ limitPerGroup?: number; /** * Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude * locations from results. For example, `-US,PT` excludes results from the US, but * includes results from PT. */ location?: Array; /** * Array of names used to label the series in the response. */ 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 TimeseriesGroupIPVersionParams { /** * 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'; /** * Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to * exclude continents from results. For example, `-EU,NA` excludes results from EU, * but includes results from NA. */ continent?: Array; /** * End of the date range (inclusive). */ dateEnd?: Array; /** * Filters results by the specified date range. 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; /** * Start of the date range. */ dateStart?: Array; /** * Together with the `location` parameter, will apply the filter to origin or * target location. */ direction?: 'ORIGIN' | 'TARGET'; /** * Format in which results will be returned. */ format?: 'JSON' | 'CSV'; /** * Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude * locations from results. For example, `-US,PT` excludes results from the US, but * includes results from PT. */ location?: Array; /** * Array of names used to label the series in the response. */ 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 TimeseriesGroupProtocolParams { /** * 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'; /** * Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to * exclude continents from results. For example, `-EU,NA` excludes results from EU, * but includes results from NA. */ continent?: Array; /** * End of the date range (inclusive). */ dateEnd?: Array; /** * Filters results by the specified date range. 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; /** * Start of the date range. */ dateStart?: Array; /** * Together with the `location` parameter, will apply the filter to origin or * target location. */ direction?: 'ORIGIN' | 'TARGET'; /** * Format in which results will be returned. */ format?: 'JSON' | 'CSV'; /** * Filters results by IP version (Ipv4 vs. IPv6). */ ipVersion?: Array<'IPv4' | 'IPv6'>; /** * Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude * locations from results. For example, `-US,PT` excludes results from the US, but * includes results from PT. */ location?: Array; /** * Array of names used to label the series in the response. */ name?: Array; /** * Normalization method applied. Refer to * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). */ normalization?: 'PERCENTAGE' | 'MIN0_MAX'; } export interface TimeseriesGroupVectorParams { /** * 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'; /** * Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to * exclude continents from results. For example, `-EU,NA` excludes results from EU, * but includes results from NA. */ continent?: Array; /** * End of the date range (inclusive). */ dateEnd?: Array; /** * Filters results by the specified date range. 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; /** * Start of the date range. */ dateStart?: Array; /** * Together with the `location` parameter, will apply the filter to origin or * target location. */ direction?: 'ORIGIN' | 'TARGET'; /** * Format in which results will be returned. */ format?: 'JSON' | 'CSV'; /** * Filters results by IP version (Ipv4 vs. IPv6). */ ipVersion?: Array<'IPv4' | 'IPv6'>; /** * Limits the number of objects per group to the top items within the specified * time range. If there are more items than the limit, the response will include * the count of items, with any remaining items grouped together under an "other" * category. */ limitPerGroup?: number; /** * Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude * locations from results. For example, `-US,PT` excludes results from the US, but * includes results from PT. */ location?: Array; /** * Array of names used to label the series in the response. */ 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 TimeseriesGroupVerticalParams { /** * 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'; /** * Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to * exclude continents from results. For example, `-EU,NA` excludes results from EU, * but includes results from NA. */ continent?: Array; /** * End of the date range (inclusive). */ dateEnd?: Array; /** * Filters results by the specified date range. 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; /** * Start of the date range. */ dateStart?: Array; /** * Together with the `location` parameter, will apply the filter to origin or * target location. */ direction?: 'ORIGIN' | 'TARGET'; /** * Format in which results will be returned. */ format?: 'JSON' | 'CSV'; /** * Filters results by IP version (Ipv4 vs. IPv6). */ ipVersion?: Array<'IPv4' | 'IPv6'>; /** * Limits the number of objects per group to the top items within the specified * time range. If there are more items than the limit, the response will include * the count of items, with any remaining items grouped together under an "other" * category. */ limitPerGroup?: number; /** * Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude * locations from results. For example, `-US,PT` excludes results from the US, but * includes results from PT. */ location?: Array; /** * Array of names used to label the series in the response. */ 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 declare namespace TimeseriesGroups { export { type TimeseriesGroupBitrateResponse as TimeseriesGroupBitrateResponse, type TimeseriesGroupDurationResponse as TimeseriesGroupDurationResponse, type TimeseriesGroupIndustryResponse as TimeseriesGroupIndustryResponse, type TimeseriesGroupIPVersionResponse as TimeseriesGroupIPVersionResponse, type TimeseriesGroupProtocolResponse as TimeseriesGroupProtocolResponse, type TimeseriesGroupVectorResponse as TimeseriesGroupVectorResponse, type TimeseriesGroupVerticalResponse as TimeseriesGroupVerticalResponse, type TimeseriesGroupBitrateParams as TimeseriesGroupBitrateParams, type TimeseriesGroupDurationParams as TimeseriesGroupDurationParams, type TimeseriesGroupIndustryParams as TimeseriesGroupIndustryParams, type TimeseriesGroupIPVersionParams as TimeseriesGroupIPVersionParams, type TimeseriesGroupProtocolParams as TimeseriesGroupProtocolParams, type TimeseriesGroupVectorParams as TimeseriesGroupVectorParams, type TimeseriesGroupVerticalParams as TimeseriesGroupVerticalParams, }; }