diff --git a/.stats.yml b/.stats.yml index cb1412e7ab..35e5522baf 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1 +1 @@ -configured_endpoints: 1288 +configured_endpoints: 1284 diff --git a/api.md b/api.md index beac4f5543..612722f454 100644 --- a/api.md +++ b/api.md @@ -1450,24 +1450,8 @@ Methods: ### Reports -Types: - -- DNSDNSAnalyticsAPIReport - -Methods: - -- client.dns.analytics.reports.get(identifier, { ...params }) -> DNSDNSAnalyticsAPIReport - #### Bytimes -Types: - -- DNSDNSAnalyticsAPIReportBytime - -Methods: - -- client.dns.analytics.reports.bytimes.get(identifier, { ...params }) -> DNSDNSAnalyticsAPIReportBytime - ## Firewall Types: @@ -1487,16 +1471,8 @@ Methods: #### Reports -Methods: - -- client.dns.firewall.analytics.reports.get(accountIdentifier, identifier, { ...params }) -> DNSDNSAnalyticsAPIReport - ##### Bytimes -Methods: - -- client.dns.firewall.analytics.reports.bytimes.get(accountIdentifier, identifier, { ...params }) -> DNSDNSAnalyticsAPIReportBytime - # DNSSEC Types: diff --git a/src/resources/dns/analytics/analytics.ts b/src/resources/dns/analytics/analytics.ts index 9649bf1de2..ac52da3b86 100644 --- a/src/resources/dns/analytics/analytics.ts +++ b/src/resources/dns/analytics/analytics.ts @@ -9,6 +9,4 @@ export class Analytics extends APIResource { export namespace Analytics { export import Reports = ReportsAPI.Reports; - export import DNSDNSAnalyticsAPIReport = ReportsAPI.DNSDNSAnalyticsAPIReport; - export import ReportGetParams = ReportsAPI.ReportGetParams; } diff --git a/src/resources/dns/analytics/index.ts b/src/resources/dns/analytics/index.ts index afb71b113f..efa3026fda 100644 --- a/src/resources/dns/analytics/index.ts +++ b/src/resources/dns/analytics/index.ts @@ -1,4 +1,4 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Analytics } from './analytics'; -export { DNSDNSAnalyticsAPIReport, ReportGetParams, Reports } from './reports/index'; +export { Reports } from './reports/index'; diff --git a/src/resources/dns/analytics/reports/bytimes.ts b/src/resources/dns/analytics/reports/bytimes.ts index 62153ed6ac..790827e6a3 100644 --- a/src/resources/dns/analytics/reports/bytimes.ts +++ b/src/resources/dns/analytics/reports/bytimes.ts @@ -1,208 +1,5 @@ // 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 BytimesAPI from 'cloudflare/resources/dns/analytics/reports/bytimes'; -export class Bytimes extends APIResource { - /** - * Retrieves a list of aggregate metrics grouped by time interval. - * - * See - * [Analytics API properties](https://developers.cloudflare.com/dns/reference/analytics-api-properties/) - * for detailed information about the available query parameters. - */ - get( - identifier: string, - query?: BytimeGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - get(identifier: string, options?: Core.RequestOptions): Core.APIPromise; - get( - identifier: string, - query: BytimeGetParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.get(identifier, {}, query); - } - return ( - this._client.get(`/zones/${identifier}/dns_analytics/report/bytime`, { - query, - ...options, - }) as Core.APIPromise<{ result: DNSDNSAnalyticsAPIReportBytime }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface DNSDNSAnalyticsAPIReportBytime { - /** - * Array with one row per combination of dimension values. - */ - data: Array; - - /** - * Number of seconds between current time and last processed event, in another - * words how many seconds of data could be missing. - */ - data_lag: number; - - /** - * Maximum results for each metric (object mapping metric names to values). - * Currently always an empty object. - */ - max: unknown; - - /** - * Minimum results for each metric (object mapping metric names to values). - * Currently always an empty object. - */ - min: unknown; - - query: DNSDNSAnalyticsAPIReportBytime.Query; - - /** - * Total number of rows in the result. - */ - rows: number; - - /** - * Array of time intervals in the response data. Each interval is represented as an - * array containing two values: the start time, and the end time. - */ - time_intervals: Array>; - - /** - * Total results for metrics across all data (object mapping metric names to - * values). - */ - totals: unknown; -} - -export namespace DNSDNSAnalyticsAPIReportBytime { - export interface Data { - /** - * Array of dimension values, representing the combination of dimension values - * corresponding to this row. - */ - dimensions: Array; - - /** - * Array with one item per requested metric. Each item is an array of values, - * broken down by time interval. - */ - metrics: Array>; - } - - export interface Query { - /** - * Array of dimension names. - */ - dimensions: Array; - - /** - * Limit number of returned metrics. - */ - limit: number; - - /** - * Array of metric names. - */ - metrics: Array; - - /** - * Start date and time of requesting data period in ISO 8601 format. - */ - since: string; - - /** - * Unit of time to group data by. - */ - time_delta: - | 'all' - | 'auto' - | 'year' - | 'quarter' - | 'month' - | 'week' - | 'day' - | 'hour' - | 'dekaminute' - | 'minute'; - - /** - * End date and time of requesting data period in ISO 8601 format. - */ - until: string; - - /** - * Segmentation filter in 'attribute operator value' format. - */ - filters?: string; - - /** - * Array of dimensions to sort by, where each dimension may be prefixed by - - * (descending) or + (ascending). - */ - sort?: Array; - } -} - -export interface BytimeGetParams { - /** - * A comma-separated list of dimensions to group results by. - */ - dimensions?: string; - - /** - * Segmentation filter in 'attribute operator value' format. - */ - filters?: string; - - /** - * Limit number of returned metrics. - */ - limit?: number; - - /** - * A comma-separated list of metrics to query. - */ - metrics?: string; - - /** - * Start date and time of requesting data period in ISO 8601 format. - */ - since?: string; - - /** - * A comma-separated list of dimensions to sort by, where each dimension may be - * prefixed by - (descending) or + (ascending). - */ - sort?: string; - - /** - * Unit of time to group data by. - */ - time_delta?: - | 'all' - | 'auto' - | 'year' - | 'quarter' - | 'month' - | 'week' - | 'day' - | 'hour' - | 'dekaminute' - | 'minute'; - - /** - * End date and time of requesting data period in ISO 8601 format. - */ - until?: string; -} - -export namespace Bytimes { - export import DNSDNSAnalyticsAPIReportBytime = BytimesAPI.DNSDNSAnalyticsAPIReportBytime; - export import BytimeGetParams = BytimesAPI.BytimeGetParams; -} +export class Bytimes extends APIResource {} diff --git a/src/resources/dns/analytics/reports/index.ts b/src/resources/dns/analytics/reports/index.ts index 257696865f..5a3a2c528e 100644 --- a/src/resources/dns/analytics/reports/index.ts +++ b/src/resources/dns/analytics/reports/index.ts @@ -1,4 +1,4 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { DNSDNSAnalyticsAPIReport, ReportGetParams, Reports } from './reports'; -export { DNSDNSAnalyticsAPIReportBytime, BytimeGetParams, Bytimes } from './bytimes'; +export { Bytimes } from './bytimes'; +export { Reports } from './reports'; diff --git a/src/resources/dns/analytics/reports/reports.ts b/src/resources/dns/analytics/reports/reports.ts index 03432a3cca..3c4c49335d 100644 --- a/src/resources/dns/analytics/reports/reports.ts +++ b/src/resources/dns/analytics/reports/reports.ts @@ -1,177 +1,12 @@ // 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 ReportsAPI from 'cloudflare/resources/dns/analytics/reports/reports'; import * as BytimesAPI from 'cloudflare/resources/dns/analytics/reports/bytimes'; export class Reports extends APIResource { bytimes: BytimesAPI.Bytimes = new BytimesAPI.Bytimes(this._client); - - /** - * Retrieves a list of summarised aggregate metrics over a given time period. - * - * See - * [Analytics API properties](https://developers.cloudflare.com/dns/reference/analytics-api-properties/) - * for detailed information about the available query parameters. - */ - get( - identifier: string, - query?: ReportGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - get(identifier: string, options?: Core.RequestOptions): Core.APIPromise; - get( - identifier: string, - query: ReportGetParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.get(identifier, {}, query); - } - return ( - this._client.get(`/zones/${identifier}/dns_analytics/report`, { - query, - ...options, - }) as Core.APIPromise<{ result: DNSDNSAnalyticsAPIReport }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface DNSDNSAnalyticsAPIReport { - /** - * Array with one row per combination of dimension values. - */ - data: Array; - - /** - * Number of seconds between current time and last processed event, in another - * words how many seconds of data could be missing. - */ - data_lag: number; - - /** - * Maximum results for each metric (object mapping metric names to values). - * Currently always an empty object. - */ - max: unknown; - - /** - * Minimum results for each metric (object mapping metric names to values). - * Currently always an empty object. - */ - min: unknown; - - query: DNSDNSAnalyticsAPIReport.Query; - - /** - * Total number of rows in the result. - */ - rows: number; - - /** - * Total results for metrics across all data (object mapping metric names to - * values). - */ - totals: unknown; -} - -export namespace DNSDNSAnalyticsAPIReport { - export interface Data { - /** - * Array of dimension values, representing the combination of dimension values - * corresponding to this row. - */ - dimensions: Array; - - /** - * Array with one item per requested metric. Each item is a single value. - */ - metrics: Array; - } - - export interface Query { - /** - * Array of dimension names. - */ - dimensions: Array; - - /** - * Limit number of returned metrics. - */ - limit: number; - - /** - * Array of metric names. - */ - metrics: Array; - - /** - * Start date and time of requesting data period in ISO 8601 format. - */ - since: string; - - /** - * End date and time of requesting data period in ISO 8601 format. - */ - until: string; - - /** - * Segmentation filter in 'attribute operator value' format. - */ - filters?: string; - - /** - * Array of dimensions to sort by, where each dimension may be prefixed by - - * (descending) or + (ascending). - */ - sort?: Array; - } -} - -export interface ReportGetParams { - /** - * A comma-separated list of dimensions to group results by. - */ - dimensions?: string; - - /** - * Segmentation filter in 'attribute operator value' format. - */ - filters?: string; - - /** - * Limit number of returned metrics. - */ - limit?: number; - - /** - * A comma-separated list of metrics to query. - */ - metrics?: string; - - /** - * Start date and time of requesting data period in ISO 8601 format. - */ - since?: string; - - /** - * A comma-separated list of dimensions to sort by, where each dimension may be - * prefixed by - (descending) or + (ascending). - */ - sort?: string; - - /** - * End date and time of requesting data period in ISO 8601 format. - */ - until?: string; } export namespace Reports { - export import DNSDNSAnalyticsAPIReport = ReportsAPI.DNSDNSAnalyticsAPIReport; - export import ReportGetParams = ReportsAPI.ReportGetParams; export import Bytimes = BytimesAPI.Bytimes; - export import DNSDNSAnalyticsAPIReportBytime = BytimesAPI.DNSDNSAnalyticsAPIReportBytime; - export import BytimeGetParams = BytimesAPI.BytimeGetParams; } diff --git a/src/resources/dns/firewall/analytics/analytics.ts b/src/resources/dns/firewall/analytics/analytics.ts index edcf3e2472..adf95efd79 100644 --- a/src/resources/dns/firewall/analytics/analytics.ts +++ b/src/resources/dns/firewall/analytics/analytics.ts @@ -9,5 +9,4 @@ export class Analytics extends APIResource { export namespace Analytics { export import Reports = ReportsAPI.Reports; - export import ReportGetParams = ReportsAPI.ReportGetParams; } diff --git a/src/resources/dns/firewall/analytics/index.ts b/src/resources/dns/firewall/analytics/index.ts index a0e1639cfa..efa3026fda 100644 --- a/src/resources/dns/firewall/analytics/index.ts +++ b/src/resources/dns/firewall/analytics/index.ts @@ -1,4 +1,4 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Analytics } from './analytics'; -export { ReportGetParams, Reports } from './reports/index'; +export { Reports } from './reports/index'; diff --git a/src/resources/dns/firewall/analytics/reports/bytimes.ts b/src/resources/dns/firewall/analytics/reports/bytimes.ts index c3cd840a58..790827e6a3 100644 --- a/src/resources/dns/firewall/analytics/reports/bytimes.ts +++ b/src/resources/dns/firewall/analytics/reports/bytimes.ts @@ -1,101 +1,5 @@ // 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 ReportsBytimesAPI from 'cloudflare/resources/dns/firewall/analytics/reports/bytimes'; -import * as BytimesAPI from 'cloudflare/resources/dns/analytics/reports/bytimes'; -export class Bytimes extends APIResource { - /** - * Retrieves a list of aggregate metrics grouped by time interval. - * - * See - * [Analytics API properties](https://developers.cloudflare.com/dns/reference/analytics-api-properties/) - * for detailed information about the available query parameters. - */ - get( - accountIdentifier: string, - identifier: string, - query?: BytimeGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - get( - accountIdentifier: string, - identifier: string, - options?: Core.RequestOptions, - ): Core.APIPromise; - get( - accountIdentifier: string, - identifier: string, - query: BytimeGetParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.get(accountIdentifier, identifier, {}, query); - } - return ( - this._client.get( - `/accounts/${accountIdentifier}/dns_firewall/${identifier}/dns_analytics/report/bytime`, - { query, ...options }, - ) as Core.APIPromise<{ result: BytimesAPI.DNSDNSAnalyticsAPIReportBytime }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface BytimeGetParams { - /** - * A comma-separated list of dimensions to group results by. - */ - dimensions?: string; - - /** - * Segmentation filter in 'attribute operator value' format. - */ - filters?: string; - - /** - * Limit number of returned metrics. - */ - limit?: number; - - /** - * A comma-separated list of metrics to query. - */ - metrics?: string; - - /** - * Start date and time of requesting data period in ISO 8601 format. - */ - since?: string; - - /** - * A comma-separated list of dimensions to sort by, where each dimension may be - * prefixed by - (descending) or + (ascending). - */ - sort?: string; - - /** - * Unit of time to group data by. - */ - time_delta?: - | 'all' - | 'auto' - | 'year' - | 'quarter' - | 'month' - | 'week' - | 'day' - | 'hour' - | 'dekaminute' - | 'minute'; - - /** - * End date and time of requesting data period in ISO 8601 format. - */ - until?: string; -} - -export namespace Bytimes { - export import BytimeGetParams = ReportsBytimesAPI.BytimeGetParams; -} +export class Bytimes extends APIResource {} diff --git a/src/resources/dns/firewall/analytics/reports/index.ts b/src/resources/dns/firewall/analytics/reports/index.ts index afad8ed204..5a3a2c528e 100644 --- a/src/resources/dns/firewall/analytics/reports/index.ts +++ b/src/resources/dns/firewall/analytics/reports/index.ts @@ -1,4 +1,4 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { BytimeGetParams, Bytimes } from './bytimes'; -export { ReportGetParams, Reports } from './reports'; +export { Bytimes } from './bytimes'; +export { Reports } from './reports'; diff --git a/src/resources/dns/firewall/analytics/reports/reports.ts b/src/resources/dns/firewall/analytics/reports/reports.ts index 3ce5ac8650..1944afca33 100644 --- a/src/resources/dns/firewall/analytics/reports/reports.ts +++ b/src/resources/dns/firewall/analytics/reports/reports.ts @@ -1,91 +1,12 @@ // 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 ReportsReportsAPI from 'cloudflare/resources/dns/firewall/analytics/reports/reports'; -import * as ReportsAPI from 'cloudflare/resources/dns/analytics/reports/reports'; import * as BytimesAPI from 'cloudflare/resources/dns/firewall/analytics/reports/bytimes'; export class Reports extends APIResource { bytimes: BytimesAPI.Bytimes = new BytimesAPI.Bytimes(this._client); - - /** - * Retrieves a list of summarised aggregate metrics over a given time period. - * - * See - * [Analytics API properties](https://developers.cloudflare.com/dns/reference/analytics-api-properties/) - * for detailed information about the available query parameters. - */ - get( - accountIdentifier: string, - identifier: string, - query?: ReportGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - get( - accountIdentifier: string, - identifier: string, - options?: Core.RequestOptions, - ): Core.APIPromise; - get( - accountIdentifier: string, - identifier: string, - query: ReportGetParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.get(accountIdentifier, identifier, {}, query); - } - return ( - this._client.get(`/accounts/${accountIdentifier}/dns_firewall/${identifier}/dns_analytics/report`, { - query, - ...options, - }) as Core.APIPromise<{ result: ReportsAPI.DNSDNSAnalyticsAPIReport }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface ReportGetParams { - /** - * A comma-separated list of dimensions to group results by. - */ - dimensions?: string; - - /** - * Segmentation filter in 'attribute operator value' format. - */ - filters?: string; - - /** - * Limit number of returned metrics. - */ - limit?: number; - - /** - * A comma-separated list of metrics to query. - */ - metrics?: string; - - /** - * Start date and time of requesting data period in ISO 8601 format. - */ - since?: string; - - /** - * A comma-separated list of dimensions to sort by, where each dimension may be - * prefixed by - (descending) or + (ascending). - */ - sort?: string; - - /** - * End date and time of requesting data period in ISO 8601 format. - */ - until?: string; } export namespace Reports { - export import ReportGetParams = ReportsReportsAPI.ReportGetParams; export import Bytimes = BytimesAPI.Bytimes; - export import BytimeGetParams = BytimesAPI.BytimeGetParams; } diff --git a/tests/api-resources/dns/analytics/reports/bytimes.test.ts b/tests/api-resources/dns/analytics/reports/bytimes.test.ts deleted file mode 100644 index 66774289b6..0000000000 --- a/tests/api-resources/dns/analytics/reports/bytimes.test.ts +++ /dev/null @@ -1,55 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource bytimes', () => { - // skipped: tests are disabled for the time being - test.skip('get', async () => { - const responsePromise = cloudflare.dns.analytics.reports.bytimes.get('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('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.dns.analytics.reports.bytimes.get('023e105f4ecef8ad9ca31a8372d0c353', { - 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.dns.analytics.reports.bytimes.get( - '023e105f4ecef8ad9ca31a8372d0c353', - { - dimensions: 'queryType', - filters: 'responseCode==NOERROR,queryType==A', - limit: 100, - metrics: 'queryCount,uncachedCount', - since: '2023-11-11T12:00:00Z', - sort: '+responseCode,-queryName', - time_delta: 'hour', - until: '2023-11-11T13:00:00Z', - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/dns/analytics/reports/reports.test.ts b/tests/api-resources/dns/analytics/reports/reports.test.ts deleted file mode 100644 index 703a4d567f..0000000000 --- a/tests/api-resources/dns/analytics/reports/reports.test.ts +++ /dev/null @@ -1,54 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource reports', () => { - // skipped: tests are disabled for the time being - test.skip('get', async () => { - const responsePromise = cloudflare.dns.analytics.reports.get('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('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.dns.analytics.reports.get('023e105f4ecef8ad9ca31a8372d0c353', { - 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.dns.analytics.reports.get( - '023e105f4ecef8ad9ca31a8372d0c353', - { - dimensions: 'queryType', - filters: 'responseCode==NOERROR,queryType==A', - limit: 100, - metrics: 'queryCount,uncachedCount', - since: '2023-11-11T12:00:00Z', - sort: '+responseCode,-queryName', - until: '2023-11-11T13:00:00Z', - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/dns/firewall/analytics/reports/bytimes.test.ts b/tests/api-resources/dns/firewall/analytics/reports/bytimes.test.ts deleted file mode 100644 index 91b46114eb..0000000000 --- a/tests/api-resources/dns/firewall/analytics/reports/bytimes.test.ts +++ /dev/null @@ -1,61 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource bytimes', () => { - // skipped: tests are disabled for the time being - test.skip('get', async () => { - const responsePromise = cloudflare.dns.firewall.analytics.reports.bytimes.get( - '023e105f4ecef8ad9ca31a8372d0c353', - '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('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.dns.firewall.analytics.reports.bytimes.get( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { 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.dns.firewall.analytics.reports.bytimes.get( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { - dimensions: 'queryType', - filters: 'responseCode==NOERROR,queryType==A', - limit: 100, - metrics: 'queryCount,uncachedCount', - since: '2023-11-11T12:00:00Z', - sort: '+responseCode,-queryName', - time_delta: 'hour', - until: '2023-11-11T13:00:00Z', - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/dns/firewall/analytics/reports/reports.test.ts b/tests/api-resources/dns/firewall/analytics/reports/reports.test.ts deleted file mode 100644 index 91467952b4..0000000000 --- a/tests/api-resources/dns/firewall/analytics/reports/reports.test.ts +++ /dev/null @@ -1,60 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const cloudflare = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource reports', () => { - // skipped: tests are disabled for the time being - test.skip('get', async () => { - const responsePromise = cloudflare.dns.firewall.analytics.reports.get( - '023e105f4ecef8ad9ca31a8372d0c353', - '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('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.dns.firewall.analytics.reports.get( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { 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.dns.firewall.analytics.reports.get( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { - dimensions: 'queryType', - filters: 'responseCode==NOERROR,queryType==A', - limit: 100, - metrics: 'queryCount,uncachedCount', - since: '2023-11-11T12:00:00Z', - sort: '+responseCode,-queryName', - until: '2023-11-11T13:00:00Z', - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -});