// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; import { isRequestOptions } from 'cloudflare/core'; import * as TimeseriesGroupsAPI from 'cloudflare/resources/radar/as112/timeseries-groups'; export class TimeseriesGroups extends APIResource { /** * Percentage distribution of DNS AS112 queries by DNSSEC support over time. */ dnssec( query?: TimeseriesGroupDNSSECParams, options?: Core.RequestOptions, ): Core.APIPromise; dnssec(options?: Core.RequestOptions): Core.APIPromise; dnssec( query: TimeseriesGroupDNSSECParams | Core.RequestOptions = {}, options?: Core.RequestOptions, ): Core.APIPromise { if (isRequestOptions(query)) { return this.dnssec({}, query); } return ( this._client.get('/radar/as112/timeseries_groups/dnssec', { query, ...options }) as Core.APIPromise<{ result: TimeseriesGroupDNSSECResponse; }> )._thenUnwrap((obj) => obj.result); } /** * Percentage distribution of AS112 DNS queries by EDNS support over time. */ edns( query?: TimeseriesGroupEdnsParams, options?: Core.RequestOptions, ): Core.APIPromise; edns(options?: Core.RequestOptions): Core.APIPromise; edns( query: TimeseriesGroupEdnsParams | Core.RequestOptions = {}, options?: Core.RequestOptions, ): Core.APIPromise { if (isRequestOptions(query)) { return this.edns({}, query); } return ( this._client.get('/radar/as112/timeseries_groups/edns', { query, ...options }) as Core.APIPromise<{ result: TimeseriesGroupEdnsResponse; }> )._thenUnwrap((obj) => obj.result); } /** * Percentage distribution of AS112 DNS queries 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/as112/timeseries_groups/ip_version', { query, ...options, }) as Core.APIPromise<{ result: TimeseriesGroupIPVersionResponse }> )._thenUnwrap((obj) => obj.result); } /** * Percentage distribution of AS112 dns requests classified per 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/as112/timeseries_groups/protocol', { query, ...options }) as Core.APIPromise<{ result: TimeseriesGroupProtocolResponse; }> )._thenUnwrap((obj) => obj.result); } /** * Percentage distribution of AS112 DNS queries by Query Type over time. */ queryType( query?: TimeseriesGroupQueryTypeParams, options?: Core.RequestOptions, ): Core.APIPromise; queryType(options?: Core.RequestOptions): Core.APIPromise; queryType( query: TimeseriesGroupQueryTypeParams | Core.RequestOptions = {}, options?: Core.RequestOptions, ): Core.APIPromise { if (isRequestOptions(query)) { return this.queryType({}, query); } return ( this._client.get('/radar/as112/timeseries_groups/query_type', { query, ...options, }) as Core.APIPromise<{ result: TimeseriesGroupQueryTypeResponse }> )._thenUnwrap((obj) => obj.result); } /** * Percentage distribution of AS112 dns requests classified per Response Codes over * time. */ responseCodes( query?: TimeseriesGroupResponseCodesParams, options?: Core.RequestOptions, ): Core.APIPromise; responseCodes(options?: Core.RequestOptions): Core.APIPromise; responseCodes( query: TimeseriesGroupResponseCodesParams | Core.RequestOptions = {}, options?: Core.RequestOptions, ): Core.APIPromise { if (isRequestOptions(query)) { return this.responseCodes({}, query); } return ( this._client.get('/radar/as112/timeseries_groups/response_codes', { query, ...options, }) as Core.APIPromise<{ result: TimeseriesGroupResponseCodesResponse }> )._thenUnwrap((obj) => obj.result); } } export interface TimeseriesGroupDNSSECResponse { meta: unknown; serie_0: TimeseriesGroupDNSSECResponse.Serie0; } export namespace TimeseriesGroupDNSSECResponse { export interface Serie0 { NOT_SUPPORTED: Array; SUPPORTED: Array; } } export interface TimeseriesGroupEdnsResponse { meta: unknown; serie_0: TimeseriesGroupEdnsResponse.Serie0; } export namespace TimeseriesGroupEdnsResponse { export interface Serie0 { NOT_SUPPORTED: Array; SUPPORTED: Array; } } export interface TimeseriesGroupIPVersionResponse { meta: unknown; serie_0: TimeseriesGroupIPVersionResponse.Serie0; } export namespace TimeseriesGroupIPVersionResponse { export interface Serie0 { IPv4: Array; IPv6: Array; } } export interface TimeseriesGroupProtocolResponse { meta: unknown; serie_0: TimeseriesGroupProtocolResponse.Serie0; } export namespace TimeseriesGroupProtocolResponse { export interface Serie0 { tcp: Array; udp: Array; } } export interface TimeseriesGroupQueryTypeResponse { meta: unknown; serie_0: TimeseriesGroupQueryTypeResponse.Serie0; } export namespace TimeseriesGroupQueryTypeResponse { export interface Serie0 { A: Array; AAAA: Array; PTR: Array; SOA: Array; SRV: Array; } } export interface TimeseriesGroupResponseCodesResponse { meta: unknown; serie_0: TimeseriesGroupResponseCodesResponse.Serie0; } export namespace TimeseriesGroupResponseCodesResponse { export interface Serie0 { NOERROR: Array; NXDOMAIN: Array; } } export interface TimeseriesGroupDNSSECParams { /** * 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'; /** * 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 interface TimeseriesGroupEdnsParams { /** * 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'; /** * 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 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'; /** * 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'; /** * 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 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'; /** * 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'; /** * 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 interface TimeseriesGroupQueryTypeParams { /** * 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'; /** * 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 interface TimeseriesGroupResponseCodesParams { /** * 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'; /** * 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 TimeseriesGroups { export import TimeseriesGroupDNSSECResponse = TimeseriesGroupsAPI.TimeseriesGroupDNSSECResponse; export import TimeseriesGroupEdnsResponse = TimeseriesGroupsAPI.TimeseriesGroupEdnsResponse; export import TimeseriesGroupIPVersionResponse = TimeseriesGroupsAPI.TimeseriesGroupIPVersionResponse; export import TimeseriesGroupProtocolResponse = TimeseriesGroupsAPI.TimeseriesGroupProtocolResponse; export import TimeseriesGroupQueryTypeResponse = TimeseriesGroupsAPI.TimeseriesGroupQueryTypeResponse; export import TimeseriesGroupResponseCodesResponse = TimeseriesGroupsAPI.TimeseriesGroupResponseCodesResponse; export import TimeseriesGroupDNSSECParams = TimeseriesGroupsAPI.TimeseriesGroupDNSSECParams; export import TimeseriesGroupEdnsParams = TimeseriesGroupsAPI.TimeseriesGroupEdnsParams; export import TimeseriesGroupIPVersionParams = TimeseriesGroupsAPI.TimeseriesGroupIPVersionParams; export import TimeseriesGroupProtocolParams = TimeseriesGroupsAPI.TimeseriesGroupProtocolParams; export import TimeseriesGroupQueryTypeParams = TimeseriesGroupsAPI.TimeseriesGroupQueryTypeParams; export import TimeseriesGroupResponseCodesParams = TimeseriesGroupsAPI.TimeseriesGroupResponseCodesParams; }