From 1605ea2a8e4c73f0c0d670a536bb311b5aa6b771 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 5 May 2026 14:24:14 +0000
Subject: [PATCH 01/73] feat: feat: add resource library endpoints inside zero
trust
* feat: add resource library endpoints inside zero trust
* fix: configure resource library endpoints as data sources only in terraform
* feat: add terraform resource names for zero trust resource library endpoints
* feat: restructure resource library endpoints to nest applications under subresources
* fix: standardize account_id parameter naming in resource library endpoints
* feat: add resource library endpoints inside zero trust
---
.stats.yml | 4 +-
scripts/detect-breaking-changes | 3 +
src/resources/zero-trust/api.md | 26 ++
src/resources/zero-trust/index.ts | 1 +
src/resources/zero-trust/resource-library.ts | 3 +
.../resource-library/applications.ts | 291 ++++++++++++++++++
.../zero-trust/resource-library/categories.ts | 140 +++++++++
.../zero-trust/resource-library/index.ts | 19 ++
.../resource-library/resource-library.ts | 51 +++
src/resources/zero-trust/zero-trust.ts | 6 +
.../resource-library/applications.test.ts | 56 ++++
.../resource-library/categories.test.ts | 54 ++++
12 files changed, 652 insertions(+), 2 deletions(-)
create mode 100644 src/resources/zero-trust/resource-library.ts
create mode 100644 src/resources/zero-trust/resource-library/applications.ts
create mode 100644 src/resources/zero-trust/resource-library/categories.ts
create mode 100644 src/resources/zero-trust/resource-library/index.ts
create mode 100644 src/resources/zero-trust/resource-library/resource-library.ts
create mode 100644 tests/api-resources/zero-trust/resource-library/applications.test.ts
create mode 100644 tests/api-resources/zero-trust/resource-library/categories.test.ts
diff --git a/.stats.yml b/.stats.yml
index ee8d50f22f..55ac9a83d0 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 2200
+configured_endpoints: 2204
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
openapi_spec_hash: e722ad1f58e3dfb3a928cf9890d48da4
-config_hash: ff549978909de2badc92845fea964f4b
+config_hash: 20574d7a53e0349a3337a121a46638d4
diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes
index ea70ca8b9a..3e4cc25513 100755
--- a/scripts/detect-breaking-changes
+++ b/scripts/detect-breaking-changes
@@ -577,6 +577,9 @@ TEST_PATHS=(
tests/api-resources/zero-trust/risk-scoring/summary.test.ts
tests/api-resources/zero-trust/risk-scoring/integrations/integrations.test.ts
tests/api-resources/zero-trust/risk-scoring/integrations/references.test.ts
+ tests/api-resources/zero-trust/resource-library/resource-library.test.ts
+ tests/api-resources/zero-trust/resource-library/applications.test.ts
+ tests/api-resources/zero-trust/resource-library/categories.test.ts
tests/api-resources/turnstile/turnstile.test.ts
tests/api-resources/turnstile/widgets.test.ts
tests/api-resources/connectivity/connectivity.test.ts
diff --git a/src/resources/zero-trust/api.md b/src/resources/zero-trust/api.md
index 885b2910e7..495a10ec2a 100644
--- a/src/resources/zero-trust/api.md
+++ b/src/resources/zero-trust/api.md
@@ -1738,3 +1738,29 @@ Types:
Methods:
- client.zeroTrust.riskScoring.integrations.references.get(referenceId, { ...params }) -> ReferenceGetResponse
+
+## ResourceLibrary
+
+### Applications
+
+Types:
+
+- ApplicationListResponse
+- ApplicationGetResponse
+
+Methods:
+
+- client.zeroTrust.resourceLibrary.applications.list({ ...params }) -> ApplicationListResponsesSinglePage
+- client.zeroTrust.resourceLibrary.applications.get(id, { ...params }) -> ApplicationGetResponse
+
+### Categories
+
+Types:
+
+- CategoryListResponse
+- CategoryGetResponse
+
+Methods:
+
+- client.zeroTrust.resourceLibrary.categories.list({ ...params }) -> CategoryListResponsesSinglePage
+- client.zeroTrust.resourceLibrary.categories.get(id, { ...params }) -> CategoryGetResponse
diff --git a/src/resources/zero-trust/index.ts b/src/resources/zero-trust/index.ts
index 4c4c69ca79..b4ac2a8739 100644
--- a/src/resources/zero-trust/index.ts
+++ b/src/resources/zero-trust/index.ts
@@ -58,6 +58,7 @@ export {
type OrganizationListParams,
type OrganizationRevokeUsersParams,
} from './organizations/index';
+export { ResourceLibrary } from './resource-library/index';
export {
RiskScoring,
type RiskScoringGetResponse,
diff --git a/src/resources/zero-trust/resource-library.ts b/src/resources/zero-trust/resource-library.ts
new file mode 100644
index 0000000000..5445725f53
--- /dev/null
+++ b/src/resources/zero-trust/resource-library.ts
@@ -0,0 +1,3 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+export * from './resource-library/index';
diff --git a/src/resources/zero-trust/resource-library/applications.ts b/src/resources/zero-trust/resource-library/applications.ts
new file mode 100644
index 0000000000..54bde713a9
--- /dev/null
+++ b/src/resources/zero-trust/resource-library/applications.ts
@@ -0,0 +1,291 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import { APIResource } from '../../../resource';
+import * as Core from '../../../core';
+import { SinglePage } from '../../../pagination';
+
+export class Applications extends APIResource {
+ /**
+ * List applications with different filters.
+ *
+ * @example
+ * ```ts
+ * // Automatically fetches more pages as needed.
+ * for await (const applicationListResponse of client.zeroTrust.resourceLibrary.applications.list(
+ * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
+ * )) {
+ * // ...
+ * }
+ * ```
+ */
+ list(
+ params: ApplicationListParams,
+ options?: Core.RequestOptions,
+ ): Core.PagePromise {
+ const { account_id, ...query } = params;
+ return this._client.getAPIList(
+ `/accounts/${account_id}/resource-library/applications`,
+ ApplicationListResponsesSinglePage,
+ { query, ...options },
+ );
+ }
+
+ /**
+ * Get application by ID.
+ *
+ * @example
+ * ```ts
+ * const application =
+ * await client.zeroTrust.resourceLibrary.applications.get(
+ * '0b63249c-95bf-4cc0-a7cc-d7faaaf1dac0',
+ * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
+ * );
+ * ```
+ */
+ get(
+ id: string,
+ params: ApplicationGetParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ const { account_id } = params;
+ return (
+ this._client.get(
+ `/accounts/${account_id}/resource-library/applications/${id}`,
+ options,
+ ) as Core.APIPromise<{ result: ApplicationGetResponse }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+}
+
+export class ApplicationListResponsesSinglePage extends SinglePage {}
+
+export interface ApplicationListResponse {
+ /**
+ * Returns the application ID.
+ */
+ id: string;
+
+ /**
+ * Confidence score for the application. Returns -1 when no score is available.
+ */
+ application_confidence_score: number;
+
+ /**
+ * Returns the application source.
+ */
+ application_source: string;
+
+ /**
+ * Returns the application type.
+ */
+ application_type: string;
+
+ /**
+ * Returns the application type description.
+ */
+ application_type_description: string;
+
+ /**
+ * Returns the application creation time.
+ */
+ created_at: string;
+
+ /**
+ * GenAI score for the application. Returns -1 when no score is available.
+ */
+ gen_ai_score: number;
+
+ /**
+ * Returns the list of hostnames for the application.
+ */
+ hostnames: Array;
+
+ /**
+ * Returns the human readable ID.
+ */
+ human_id: string;
+
+ /**
+ * Returns the list of IP subnets for the application.
+ */
+ ip_subnets: Array;
+
+ /**
+ * Returns the application name.
+ */
+ name: string;
+
+ /**
+ * Returns the list of port protocols for the application.
+ */
+ port_protocols: Array;
+
+ /**
+ * Returns the list of support domains for the application.
+ */
+ support_domains: Array;
+
+ /**
+ * Returns the application update time.
+ */
+ updated_at: string;
+
+ /**
+ * Returns the application version.
+ */
+ version: string;
+
+ /**
+ * Returns the score composition breakdown for the application.
+ */
+ application_score_composition?: unknown | null;
+
+ /**
+ * Returns the Intel API ID for the application.
+ */
+ intel_id?: number | null;
+}
+
+export interface ApplicationGetResponse {
+ /**
+ * Returns the application ID.
+ */
+ id: string;
+
+ /**
+ * Confidence score for the application. Returns -1 when no score is available.
+ */
+ application_confidence_score: number;
+
+ /**
+ * Returns the application source.
+ */
+ application_source: string;
+
+ /**
+ * Returns the application type.
+ */
+ application_type: string;
+
+ /**
+ * Returns the application type description.
+ */
+ application_type_description: string;
+
+ /**
+ * Returns the application creation time.
+ */
+ created_at: string;
+
+ /**
+ * GenAI score for the application. Returns -1 when no score is available.
+ */
+ gen_ai_score: number;
+
+ /**
+ * Returns the list of hostnames for the application.
+ */
+ hostnames: Array;
+
+ /**
+ * Returns the human readable ID.
+ */
+ human_id: string;
+
+ /**
+ * Returns the list of IP subnets for the application.
+ */
+ ip_subnets: Array;
+
+ /**
+ * Returns the application name.
+ */
+ name: string;
+
+ /**
+ * Returns the list of port protocols for the application.
+ */
+ port_protocols: Array;
+
+ /**
+ * Returns the list of support domains for the application.
+ */
+ support_domains: Array;
+
+ /**
+ * Returns the application update time.
+ */
+ updated_at: string;
+
+ /**
+ * Returns the application version.
+ */
+ version: string;
+
+ /**
+ * Returns the score composition breakdown for the application.
+ */
+ application_score_composition?: unknown | null;
+
+ /**
+ * Returns the Intel API ID for the application.
+ */
+ intel_id?: number | null;
+}
+
+export interface ApplicationListParams {
+ /**
+ * Path param: Account ID.
+ */
+ account_id: string;
+
+ /**
+ * Query param: Filter applications using key:value format. Supported filter keys:
+ *
+ * - name: Filter by application name (e.g., name:HR)
+ * - id: Filter by application ID (e.g., id:0b63249c-95bf-4cc0-a7cc-d7faaaf1dac0)
+ * - human_id: Filter by human-readable ID (e.g., human_id:HR)
+ * - hostname: Filter by hostname or support domain (e.g.,
+ * hostname:portal.example.com)
+ * - source: Filter by application source name (e.g., source:cloudflare)
+ * - ip_subnet: Filter by IP subnet using CIDR containment — returns applications
+ * where any stored subnet contains the search value (e.g., ip_subnet:10.0.1.5/32
+ * matches apps with 10.0.0.0/16)
+ * - intel_id: Filter by Intel API ID (e.g., intel_id:498). .
+ */
+ filter?: string;
+
+ /**
+ * Query param: Limit of number of results to return (max 250).
+ */
+ limit?: number;
+
+ /**
+ * Query param: Offset of results to return.
+ */
+ offset?: number;
+
+ /**
+ * Query param: Order by result by field name and order (e.g., name:asc).
+ */
+ order_by?: string;
+}
+
+export interface ApplicationGetParams {
+ /**
+ * Account ID.
+ */
+ account_id: string;
+}
+
+Applications.ApplicationListResponsesSinglePage = ApplicationListResponsesSinglePage;
+
+export declare namespace Applications {
+ export {
+ type ApplicationListResponse as ApplicationListResponse,
+ type ApplicationGetResponse as ApplicationGetResponse,
+ ApplicationListResponsesSinglePage as ApplicationListResponsesSinglePage,
+ type ApplicationListParams as ApplicationListParams,
+ type ApplicationGetParams as ApplicationGetParams,
+ };
+}
diff --git a/src/resources/zero-trust/resource-library/categories.ts b/src/resources/zero-trust/resource-library/categories.ts
new file mode 100644
index 0000000000..927c47df2b
--- /dev/null
+++ b/src/resources/zero-trust/resource-library/categories.ts
@@ -0,0 +1,140 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import { APIResource } from '../../../resource';
+import * as Core from '../../../core';
+import { SinglePage } from '../../../pagination';
+
+export class Categories extends APIResource {
+ /**
+ * List application categories.
+ *
+ * @example
+ * ```ts
+ * // Automatically fetches more pages as needed.
+ * for await (const categoryListResponse of client.zeroTrust.resourceLibrary.categories.list(
+ * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
+ * )) {
+ * // ...
+ * }
+ * ```
+ */
+ list(
+ params: CategoryListParams,
+ options?: Core.RequestOptions,
+ ): Core.PagePromise {
+ const { account_id, ...query } = params;
+ return this._client.getAPIList(
+ `/accounts/${account_id}/resource-library/categories`,
+ CategoryListResponsesSinglePage,
+ { query, ...options },
+ );
+ }
+
+ /**
+ * Get application category by ID.
+ *
+ * @example
+ * ```ts
+ * const category =
+ * await client.zeroTrust.resourceLibrary.categories.get(
+ * '0b63249c-95bf-4cc0-a7cc-d7faaaf1dac0',
+ * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
+ * );
+ * ```
+ */
+ get(
+ id: string,
+ params: CategoryGetParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ const { account_id } = params;
+ return (
+ this._client.get(
+ `/accounts/${account_id}/resource-library/categories/${id}`,
+ options,
+ ) as Core.APIPromise<{ result: CategoryGetResponse }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+}
+
+export class CategoryListResponsesSinglePage extends SinglePage {}
+
+export interface CategoryListResponse {
+ /**
+ * Returns the category ID.
+ */
+ id: string;
+
+ /**
+ * Returns the category creation time.
+ */
+ created_at: string;
+
+ /**
+ * Returns the category description.
+ */
+ description: string;
+
+ /**
+ * Returns the category name.
+ */
+ name: string;
+}
+
+export interface CategoryGetResponse {
+ /**
+ * Returns the category ID.
+ */
+ id: string;
+
+ /**
+ * Returns the category creation time.
+ */
+ created_at: string;
+
+ /**
+ * Returns the category description.
+ */
+ description: string;
+
+ /**
+ * Returns the category name.
+ */
+ name: string;
+}
+
+export interface CategoryListParams {
+ /**
+ * Path param: Account ID.
+ */
+ account_id: string;
+
+ /**
+ * Query param: Limit of number of results to return.
+ */
+ limit?: number;
+
+ /**
+ * Query param: Offset of results to return.
+ */
+ offset?: number;
+}
+
+export interface CategoryGetParams {
+ /**
+ * Account ID.
+ */
+ account_id: string;
+}
+
+Categories.CategoryListResponsesSinglePage = CategoryListResponsesSinglePage;
+
+export declare namespace Categories {
+ export {
+ type CategoryListResponse as CategoryListResponse,
+ type CategoryGetResponse as CategoryGetResponse,
+ CategoryListResponsesSinglePage as CategoryListResponsesSinglePage,
+ type CategoryListParams as CategoryListParams,
+ type CategoryGetParams as CategoryGetParams,
+ };
+}
diff --git a/src/resources/zero-trust/resource-library/index.ts b/src/resources/zero-trust/resource-library/index.ts
new file mode 100644
index 0000000000..0d0499ddde
--- /dev/null
+++ b/src/resources/zero-trust/resource-library/index.ts
@@ -0,0 +1,19 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+export {
+ ApplicationListResponsesSinglePage,
+ Applications,
+ type ApplicationListResponse,
+ type ApplicationGetResponse,
+ type ApplicationListParams,
+ type ApplicationGetParams,
+} from './applications';
+export {
+ CategoryListResponsesSinglePage,
+ Categories,
+ type CategoryListResponse,
+ type CategoryGetResponse,
+ type CategoryListParams,
+ type CategoryGetParams,
+} from './categories';
+export { ResourceLibrary } from './resource-library';
diff --git a/src/resources/zero-trust/resource-library/resource-library.ts b/src/resources/zero-trust/resource-library/resource-library.ts
new file mode 100644
index 0000000000..8303975072
--- /dev/null
+++ b/src/resources/zero-trust/resource-library/resource-library.ts
@@ -0,0 +1,51 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import { APIResource } from '../../../resource';
+import * as ApplicationsAPI from './applications';
+import {
+ ApplicationGetParams,
+ ApplicationGetResponse,
+ ApplicationListParams,
+ ApplicationListResponse,
+ ApplicationListResponsesSinglePage,
+ Applications,
+} from './applications';
+import * as CategoriesAPI from './categories';
+import {
+ Categories,
+ CategoryGetParams,
+ CategoryGetResponse,
+ CategoryListParams,
+ CategoryListResponse,
+ CategoryListResponsesSinglePage,
+} from './categories';
+
+export class ResourceLibrary extends APIResource {
+ applications: ApplicationsAPI.Applications = new ApplicationsAPI.Applications(this._client);
+ categories: CategoriesAPI.Categories = new CategoriesAPI.Categories(this._client);
+}
+
+ResourceLibrary.Applications = Applications;
+ResourceLibrary.ApplicationListResponsesSinglePage = ApplicationListResponsesSinglePage;
+ResourceLibrary.Categories = Categories;
+ResourceLibrary.CategoryListResponsesSinglePage = CategoryListResponsesSinglePage;
+
+export declare namespace ResourceLibrary {
+ export {
+ Applications as Applications,
+ type ApplicationListResponse as ApplicationListResponse,
+ type ApplicationGetResponse as ApplicationGetResponse,
+ ApplicationListResponsesSinglePage as ApplicationListResponsesSinglePage,
+ type ApplicationListParams as ApplicationListParams,
+ type ApplicationGetParams as ApplicationGetParams,
+ };
+
+ export {
+ Categories as Categories,
+ type CategoryListResponse as CategoryListResponse,
+ type CategoryGetResponse as CategoryGetResponse,
+ CategoryListResponsesSinglePage as CategoryListResponsesSinglePage,
+ type CategoryListParams as CategoryListParams,
+ type CategoryGetParams as CategoryGetParams,
+ };
+}
diff --git a/src/resources/zero-trust/zero-trust.ts b/src/resources/zero-trust/zero-trust.ts
index fd2a007279..725422769f 100644
--- a/src/resources/zero-trust/zero-trust.ts
+++ b/src/resources/zero-trust/zero-trust.ts
@@ -64,6 +64,8 @@ import {
OrganizationUpdateParams,
Organizations,
} from './organizations/organizations';
+import * as ResourceLibraryAPI from './resource-library/resource-library';
+import { ResourceLibrary } from './resource-library/resource-library';
import * as RiskScoringAPI from './risk-scoring/risk-scoring';
import {
RiskScoring,
@@ -97,6 +99,7 @@ export class ZeroTrust extends APIResource {
gateway: GatewayAPI.Gateway = new GatewayAPI.Gateway(this._client);
networks: NetworksAPI.Networks = new NetworksAPI.Networks(this._client);
riskScoring: RiskScoringAPI.RiskScoring = new RiskScoringAPI.RiskScoring(this._client);
+ resourceLibrary: ResourceLibraryAPI.ResourceLibrary = new ResourceLibraryAPI.ResourceLibrary(this._client);
}
ZeroTrust.Devices = Devices;
@@ -116,6 +119,7 @@ ZeroTrust.DLP = DLP;
ZeroTrust.Gateway = Gateway;
ZeroTrust.Networks = Networks;
ZeroTrust.RiskScoring = RiskScoring;
+ZeroTrust.ResourceLibrary = ResourceLibrary;
export declare namespace ZeroTrust {
export {
@@ -207,4 +211,6 @@ export declare namespace ZeroTrust {
type RiskScoringGetParams as RiskScoringGetParams,
type RiskScoringResetParams as RiskScoringResetParams,
};
+
+ export { ResourceLibrary as ResourceLibrary };
}
diff --git a/tests/api-resources/zero-trust/resource-library/applications.test.ts b/tests/api-resources/zero-trust/resource-library/applications.test.ts
new file mode 100644
index 0000000000..fed1d750ea
--- /dev/null
+++ b/tests/api-resources/zero-trust/resource-library/applications.test.ts
@@ -0,0 +1,56 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import Cloudflare from 'cloudflare';
+import { Response } from 'node-fetch';
+
+const client = new Cloudflare({
+ apiKey: '144c9defac04969c7bfad8efaa8ea194',
+ apiEmail: 'user@example.com',
+ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
+});
+
+describe('resource applications', () => {
+ test('list: only required params', async () => {
+ const responsePromise = client.zeroTrust.resourceLibrary.applications.list({
+ account_id: '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);
+ });
+
+ test('list: required and optional params', async () => {
+ const response = await client.zeroTrust.resourceLibrary.applications.list({
+ account_id: '023e105f4ecef8ad9ca31a8372d0c353',
+ filter: 'filter',
+ limit: 0,
+ offset: 0,
+ order_by: 'order_by',
+ });
+ });
+
+ test('get: only required params', async () => {
+ const responsePromise = client.zeroTrust.resourceLibrary.applications.get(
+ '0b63249c-95bf-4cc0-a7cc-d7faaaf1dac0',
+ { account_id: '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);
+ });
+
+ test('get: required and optional params', async () => {
+ const response = await client.zeroTrust.resourceLibrary.applications.get(
+ '0b63249c-95bf-4cc0-a7cc-d7faaaf1dac0',
+ { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
+ );
+ });
+});
diff --git a/tests/api-resources/zero-trust/resource-library/categories.test.ts b/tests/api-resources/zero-trust/resource-library/categories.test.ts
new file mode 100644
index 0000000000..ce969c1afb
--- /dev/null
+++ b/tests/api-resources/zero-trust/resource-library/categories.test.ts
@@ -0,0 +1,54 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import Cloudflare from 'cloudflare';
+import { Response } from 'node-fetch';
+
+const client = new Cloudflare({
+ apiKey: '144c9defac04969c7bfad8efaa8ea194',
+ apiEmail: 'user@example.com',
+ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
+});
+
+describe('resource categories', () => {
+ test('list: only required params', async () => {
+ const responsePromise = client.zeroTrust.resourceLibrary.categories.list({
+ account_id: '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);
+ });
+
+ test('list: required and optional params', async () => {
+ const response = await client.zeroTrust.resourceLibrary.categories.list({
+ account_id: '023e105f4ecef8ad9ca31a8372d0c353',
+ limit: 0,
+ offset: 0,
+ });
+ });
+
+ test('get: only required params', async () => {
+ const responsePromise = client.zeroTrust.resourceLibrary.categories.get(
+ '0b63249c-95bf-4cc0-a7cc-d7faaaf1dac0',
+ { account_id: '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);
+ });
+
+ test('get: required and optional params', async () => {
+ const response = await client.zeroTrust.resourceLibrary.categories.get(
+ '0b63249c-95bf-4cc0-a7cc-d7faaaf1dac0',
+ { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
+ );
+ });
+});
From 9ce391b44136632c1c0a933464ed6132b3943806 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 5 May 2026 14:31:46 +0000
Subject: [PATCH 02/73] chore(api): update composite API spec
---
.stats.yml | 2 +-
src/resources/aisearch/instances/instances.ts | 91 ++++++++++++++-----
.../namespaces/instances/instances.ts | 91 ++++++++++++++-----
.../aisearch/instances/instances.test.ts | 14 ++-
.../namespaces/instances/instances.test.ts | 14 ++-
5 files changed, 161 insertions(+), 51 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 55ac9a83d0..3c642fb30b 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 2204
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
-openapi_spec_hash: e722ad1f58e3dfb3a928cf9890d48da4
+openapi_spec_hash: 42dd4ac0ac3f5c00bbe80e26fed2fa51
config_hash: 20574d7a53e0349a3337a121a46638d4
diff --git a/src/resources/aisearch/instances/instances.ts b/src/resources/aisearch/instances/instances.ts
index f3f9a33ea8..3cc0f853ff 100644
--- a/src/resources/aisearch/instances/instances.ts
+++ b/src/resources/aisearch/instances/instances.ts
@@ -568,10 +568,16 @@ export namespace InstanceCreateResponse {
/**
* List of path-to-selector mappings for extracting specific content from crawled
* pages. Each entry pairs a URL glob pattern with a CSS selector. The first
- * matching path wins. Only the matched HTML fragment is stored and indexed.
+ * matching path wins. Only the matched HTML fragment is stored and indexed. Omit
+ * the field to disable content selection — empty arrays are rejected.
*/
content_selector?: Array;
+ /**
+ * Up to 5 custom HTTP headers sent with each crawl request. Names must be RFC-7230
+ * token characters (no spaces, colons, or control characters); values must be
+ * HTAB + printable ASCII (no CR/LF).
+ */
include_headers?: { [key: string]: string };
include_images?: boolean;
@@ -594,8 +600,9 @@ export namespace InstanceCreateResponse {
path: string;
/**
- * CSS selector to extract content from pages matching the path pattern. Supports
- * standard CSS selectors including class, ID, element, and attribute selectors.
+ * CSS selector to extract content from pages matching the path pattern. Must not
+ * contain disallowed characters (;, `, $, {, }, \). Must target a single element;
+ * if multiple elements match, the selector is ignored and the full page is used.
*/
selector: string;
}
@@ -955,10 +962,16 @@ export namespace InstanceUpdateResponse {
/**
* List of path-to-selector mappings for extracting specific content from crawled
* pages. Each entry pairs a URL glob pattern with a CSS selector. The first
- * matching path wins. Only the matched HTML fragment is stored and indexed.
+ * matching path wins. Only the matched HTML fragment is stored and indexed. Omit
+ * the field to disable content selection — empty arrays are rejected.
*/
content_selector?: Array;
+ /**
+ * Up to 5 custom HTTP headers sent with each crawl request. Names must be RFC-7230
+ * token characters (no spaces, colons, or control characters); values must be
+ * HTAB + printable ASCII (no CR/LF).
+ */
include_headers?: { [key: string]: string };
include_images?: boolean;
@@ -981,8 +994,9 @@ export namespace InstanceUpdateResponse {
path: string;
/**
- * CSS selector to extract content from pages matching the path pattern. Supports
- * standard CSS selectors including class, ID, element, and attribute selectors.
+ * CSS selector to extract content from pages matching the path pattern. Must not
+ * contain disallowed characters (;, `, $, {, }, \). Must target a single element;
+ * if multiple elements match, the selector is ignored and the full page is used.
*/
selector: string;
}
@@ -1342,10 +1356,16 @@ export namespace InstanceListResponse {
/**
* List of path-to-selector mappings for extracting specific content from crawled
* pages. Each entry pairs a URL glob pattern with a CSS selector. The first
- * matching path wins. Only the matched HTML fragment is stored and indexed.
+ * matching path wins. Only the matched HTML fragment is stored and indexed. Omit
+ * the field to disable content selection — empty arrays are rejected.
*/
content_selector?: Array;
+ /**
+ * Up to 5 custom HTTP headers sent with each crawl request. Names must be RFC-7230
+ * token characters (no spaces, colons, or control characters); values must be
+ * HTAB + printable ASCII (no CR/LF).
+ */
include_headers?: { [key: string]: string };
include_images?: boolean;
@@ -1368,8 +1388,9 @@ export namespace InstanceListResponse {
path: string;
/**
- * CSS selector to extract content from pages matching the path pattern. Supports
- * standard CSS selectors including class, ID, element, and attribute selectors.
+ * CSS selector to extract content from pages matching the path pattern. Must not
+ * contain disallowed characters (;, `, $, {, }, \). Must target a single element;
+ * if multiple elements match, the selector is ignored and the full page is used.
*/
selector: string;
}
@@ -1729,10 +1750,16 @@ export namespace InstanceDeleteResponse {
/**
* List of path-to-selector mappings for extracting specific content from crawled
* pages. Each entry pairs a URL glob pattern with a CSS selector. The first
- * matching path wins. Only the matched HTML fragment is stored and indexed.
+ * matching path wins. Only the matched HTML fragment is stored and indexed. Omit
+ * the field to disable content selection — empty arrays are rejected.
*/
content_selector?: Array;
+ /**
+ * Up to 5 custom HTTP headers sent with each crawl request. Names must be RFC-7230
+ * token characters (no spaces, colons, or control characters); values must be
+ * HTAB + printable ASCII (no CR/LF).
+ */
include_headers?: { [key: string]: string };
include_images?: boolean;
@@ -1755,8 +1782,9 @@ export namespace InstanceDeleteResponse {
path: string;
/**
- * CSS selector to extract content from pages matching the path pattern. Supports
- * standard CSS selectors including class, ID, element, and attribute selectors.
+ * CSS selector to extract content from pages matching the path pattern. Must not
+ * contain disallowed characters (;, `, $, {, }, \). Must target a single element;
+ * if multiple elements match, the selector is ignored and the full page is used.
*/
selector: string;
}
@@ -2186,10 +2214,16 @@ export namespace InstanceReadResponse {
/**
* List of path-to-selector mappings for extracting specific content from crawled
* pages. Each entry pairs a URL glob pattern with a CSS selector. The first
- * matching path wins. Only the matched HTML fragment is stored and indexed.
+ * matching path wins. Only the matched HTML fragment is stored and indexed. Omit
+ * the field to disable content selection — empty arrays are rejected.
*/
content_selector?: Array;
+ /**
+ * Up to 5 custom HTTP headers sent with each crawl request. Names must be RFC-7230
+ * token characters (no spaces, colons, or control characters); values must be
+ * HTAB + printable ASCII (no CR/LF).
+ */
include_headers?: { [key: string]: string };
include_images?: boolean;
@@ -2212,8 +2246,9 @@ export namespace InstanceReadResponse {
path: string;
/**
- * CSS selector to extract content from pages matching the path pattern. Supports
- * standard CSS selectors including class, ID, element, and attribute selectors.
+ * CSS selector to extract content from pages matching the path pattern. Must not
+ * contain disallowed characters (;, `, $, {, }, \). Must target a single element;
+ * if multiple elements match, the selector is ignored and the full page is used.
*/
selector: string;
}
@@ -2742,10 +2777,16 @@ export namespace InstanceCreateParams {
/**
* List of path-to-selector mappings for extracting specific content from crawled
* pages. Each entry pairs a URL glob pattern with a CSS selector. The first
- * matching path wins. Only the matched HTML fragment is stored and indexed.
+ * matching path wins. Only the matched HTML fragment is stored and indexed. Omit
+ * the field to disable content selection — empty arrays are rejected.
*/
content_selector?: Array;
+ /**
+ * Up to 5 custom HTTP headers sent with each crawl request. Names must be RFC-7230
+ * token characters (no spaces, colons, or control characters); values must be
+ * HTAB + printable ASCII (no CR/LF).
+ */
include_headers?: { [key: string]: string };
include_images?: boolean;
@@ -2768,8 +2809,9 @@ export namespace InstanceCreateParams {
path: string;
/**
- * CSS selector to extract content from pages matching the path pattern. Supports
- * standard CSS selectors including class, ID, element, and attribute selectors.
+ * CSS selector to extract content from pages matching the path pattern. Must not
+ * contain disallowed characters (;, `, $, {, }, \). Must target a single element;
+ * if multiple elements match, the selector is ignored and the full page is used.
*/
selector: string;
}
@@ -3228,10 +3270,16 @@ export namespace InstanceUpdateParams {
/**
* List of path-to-selector mappings for extracting specific content from crawled
* pages. Each entry pairs a URL glob pattern with a CSS selector. The first
- * matching path wins. Only the matched HTML fragment is stored and indexed.
+ * matching path wins. Only the matched HTML fragment is stored and indexed. Omit
+ * the field to disable content selection — empty arrays are rejected.
*/
content_selector?: Array;
+ /**
+ * Up to 5 custom HTTP headers sent with each crawl request. Names must be RFC-7230
+ * token characters (no spaces, colons, or control characters); values must be
+ * HTAB + printable ASCII (no CR/LF).
+ */
include_headers?: { [key: string]: string };
include_images?: boolean;
@@ -3254,8 +3302,9 @@ export namespace InstanceUpdateParams {
path: string;
/**
- * CSS selector to extract content from pages matching the path pattern. Supports
- * standard CSS selectors including class, ID, element, and attribute selectors.
+ * CSS selector to extract content from pages matching the path pattern. Must not
+ * contain disallowed characters (;, `, $, {, }, \). Must target a single element;
+ * if multiple elements match, the selector is ignored and the full page is used.
*/
selector: string;
}
diff --git a/src/resources/aisearch/namespaces/instances/instances.ts b/src/resources/aisearch/namespaces/instances/instances.ts
index fe5eaac0e1..222e627312 100644
--- a/src/resources/aisearch/namespaces/instances/instances.ts
+++ b/src/resources/aisearch/namespaces/instances/instances.ts
@@ -619,10 +619,16 @@ export namespace InstanceCreateResponse {
/**
* List of path-to-selector mappings for extracting specific content from crawled
* pages. Each entry pairs a URL glob pattern with a CSS selector. The first
- * matching path wins. Only the matched HTML fragment is stored and indexed.
+ * matching path wins. Only the matched HTML fragment is stored and indexed. Omit
+ * the field to disable content selection — empty arrays are rejected.
*/
content_selector?: Array;
+ /**
+ * Up to 5 custom HTTP headers sent with each crawl request. Names must be RFC-7230
+ * token characters (no spaces, colons, or control characters); values must be
+ * HTAB + printable ASCII (no CR/LF).
+ */
include_headers?: { [key: string]: string };
include_images?: boolean;
@@ -645,8 +651,9 @@ export namespace InstanceCreateResponse {
path: string;
/**
- * CSS selector to extract content from pages matching the path pattern. Supports
- * standard CSS selectors including class, ID, element, and attribute selectors.
+ * CSS selector to extract content from pages matching the path pattern. Must not
+ * contain disallowed characters (;, `, $, {, }, \). Must target a single element;
+ * if multiple elements match, the selector is ignored and the full page is used.
*/
selector: string;
}
@@ -1006,10 +1013,16 @@ export namespace InstanceUpdateResponse {
/**
* List of path-to-selector mappings for extracting specific content from crawled
* pages. Each entry pairs a URL glob pattern with a CSS selector. The first
- * matching path wins. Only the matched HTML fragment is stored and indexed.
+ * matching path wins. Only the matched HTML fragment is stored and indexed. Omit
+ * the field to disable content selection — empty arrays are rejected.
*/
content_selector?: Array;
+ /**
+ * Up to 5 custom HTTP headers sent with each crawl request. Names must be RFC-7230
+ * token characters (no spaces, colons, or control characters); values must be
+ * HTAB + printable ASCII (no CR/LF).
+ */
include_headers?: { [key: string]: string };
include_images?: boolean;
@@ -1032,8 +1045,9 @@ export namespace InstanceUpdateResponse {
path: string;
/**
- * CSS selector to extract content from pages matching the path pattern. Supports
- * standard CSS selectors including class, ID, element, and attribute selectors.
+ * CSS selector to extract content from pages matching the path pattern. Must not
+ * contain disallowed characters (;, `, $, {, }, \). Must target a single element;
+ * if multiple elements match, the selector is ignored and the full page is used.
*/
selector: string;
}
@@ -1393,10 +1407,16 @@ export namespace InstanceListResponse {
/**
* List of path-to-selector mappings for extracting specific content from crawled
* pages. Each entry pairs a URL glob pattern with a CSS selector. The first
- * matching path wins. Only the matched HTML fragment is stored and indexed.
+ * matching path wins. Only the matched HTML fragment is stored and indexed. Omit
+ * the field to disable content selection — empty arrays are rejected.
*/
content_selector?: Array;
+ /**
+ * Up to 5 custom HTTP headers sent with each crawl request. Names must be RFC-7230
+ * token characters (no spaces, colons, or control characters); values must be
+ * HTAB + printable ASCII (no CR/LF).
+ */
include_headers?: { [key: string]: string };
include_images?: boolean;
@@ -1419,8 +1439,9 @@ export namespace InstanceListResponse {
path: string;
/**
- * CSS selector to extract content from pages matching the path pattern. Supports
- * standard CSS selectors including class, ID, element, and attribute selectors.
+ * CSS selector to extract content from pages matching the path pattern. Must not
+ * contain disallowed characters (;, `, $, {, }, \). Must target a single element;
+ * if multiple elements match, the selector is ignored and the full page is used.
*/
selector: string;
}
@@ -1780,10 +1801,16 @@ export namespace InstanceDeleteResponse {
/**
* List of path-to-selector mappings for extracting specific content from crawled
* pages. Each entry pairs a URL glob pattern with a CSS selector. The first
- * matching path wins. Only the matched HTML fragment is stored and indexed.
+ * matching path wins. Only the matched HTML fragment is stored and indexed. Omit
+ * the field to disable content selection — empty arrays are rejected.
*/
content_selector?: Array;
+ /**
+ * Up to 5 custom HTTP headers sent with each crawl request. Names must be RFC-7230
+ * token characters (no spaces, colons, or control characters); values must be
+ * HTAB + printable ASCII (no CR/LF).
+ */
include_headers?: { [key: string]: string };
include_images?: boolean;
@@ -1806,8 +1833,9 @@ export namespace InstanceDeleteResponse {
path: string;
/**
- * CSS selector to extract content from pages matching the path pattern. Supports
- * standard CSS selectors including class, ID, element, and attribute selectors.
+ * CSS selector to extract content from pages matching the path pattern. Must not
+ * contain disallowed characters (;, `, $, {, }, \). Must target a single element;
+ * if multiple elements match, the selector is ignored and the full page is used.
*/
selector: string;
}
@@ -2237,10 +2265,16 @@ export namespace InstanceReadResponse {
/**
* List of path-to-selector mappings for extracting specific content from crawled
* pages. Each entry pairs a URL glob pattern with a CSS selector. The first
- * matching path wins. Only the matched HTML fragment is stored and indexed.
+ * matching path wins. Only the matched HTML fragment is stored and indexed. Omit
+ * the field to disable content selection — empty arrays are rejected.
*/
content_selector?: Array;
+ /**
+ * Up to 5 custom HTTP headers sent with each crawl request. Names must be RFC-7230
+ * token characters (no spaces, colons, or control characters); values must be
+ * HTAB + printable ASCII (no CR/LF).
+ */
include_headers?: { [key: string]: string };
include_images?: boolean;
@@ -2263,8 +2297,9 @@ export namespace InstanceReadResponse {
path: string;
/**
- * CSS selector to extract content from pages matching the path pattern. Supports
- * standard CSS selectors including class, ID, element, and attribute selectors.
+ * CSS selector to extract content from pages matching the path pattern. Must not
+ * contain disallowed characters (;, `, $, {, }, \). Must target a single element;
+ * if multiple elements match, the selector is ignored and the full page is used.
*/
selector: string;
}
@@ -2793,10 +2828,16 @@ export namespace InstanceCreateParams {
/**
* List of path-to-selector mappings for extracting specific content from crawled
* pages. Each entry pairs a URL glob pattern with a CSS selector. The first
- * matching path wins. Only the matched HTML fragment is stored and indexed.
+ * matching path wins. Only the matched HTML fragment is stored and indexed. Omit
+ * the field to disable content selection — empty arrays are rejected.
*/
content_selector?: Array;
+ /**
+ * Up to 5 custom HTTP headers sent with each crawl request. Names must be RFC-7230
+ * token characters (no spaces, colons, or control characters); values must be
+ * HTAB + printable ASCII (no CR/LF).
+ */
include_headers?: { [key: string]: string };
include_images?: boolean;
@@ -2819,8 +2860,9 @@ export namespace InstanceCreateParams {
path: string;
/**
- * CSS selector to extract content from pages matching the path pattern. Supports
- * standard CSS selectors including class, ID, element, and attribute selectors.
+ * CSS selector to extract content from pages matching the path pattern. Must not
+ * contain disallowed characters (;, `, $, {, }, \). Must target a single element;
+ * if multiple elements match, the selector is ignored and the full page is used.
*/
selector: string;
}
@@ -3279,10 +3321,16 @@ export namespace InstanceUpdateParams {
/**
* List of path-to-selector mappings for extracting specific content from crawled
* pages. Each entry pairs a URL glob pattern with a CSS selector. The first
- * matching path wins. Only the matched HTML fragment is stored and indexed.
+ * matching path wins. Only the matched HTML fragment is stored and indexed. Omit
+ * the field to disable content selection — empty arrays are rejected.
*/
content_selector?: Array;
+ /**
+ * Up to 5 custom HTTP headers sent with each crawl request. Names must be RFC-7230
+ * token characters (no spaces, colons, or control characters); values must be
+ * HTAB + printable ASCII (no CR/LF).
+ */
include_headers?: { [key: string]: string };
include_images?: boolean;
@@ -3305,8 +3353,9 @@ export namespace InstanceUpdateParams {
path: string;
/**
- * CSS selector to extract content from pages matching the path pattern. Supports
- * standard CSS selectors including class, ID, element, and attribute selectors.
+ * CSS selector to extract content from pages matching the path pattern. Must not
+ * contain disallowed characters (;, `, $, {, }, \). Must target a single element;
+ * if multiple elements match, the selector is ignored and the full page is used.
*/
selector: string;
}
diff --git a/tests/api-resources/aisearch/instances/instances.test.ts b/tests/api-resources/aisearch/instances/instances.test.ts
index 75f560baea..a34ec577d5 100644
--- a/tests/api-resources/aisearch/instances/instances.test.ts
+++ b/tests/api-resources/aisearch/instances/instances.test.ts
@@ -77,8 +77,11 @@ describe('resource instances', () => {
source: 'all',
},
parse_options: {
- content_selector: [{ path: '**/blog/**', selector: 'article .post-body' }],
- include_headers: { foo: 'string' },
+ content_selector: [
+ { path: '**/blog/**', selector: 'article div.post-body' },
+ { path: '**/docs/**', selector: 'main' },
+ ],
+ include_headers: { 'cache-control': 'no-cache, no-store' },
include_images: true,
specific_sitemaps: ['https://example.com/sitemap.xml', 'https://example.com/blog-sitemap.xml'],
use_browser_rendering: true,
@@ -161,8 +164,11 @@ describe('resource instances', () => {
source: 'all',
},
parse_options: {
- content_selector: [{ path: '**/blog/**', selector: 'article .post-body' }],
- include_headers: { foo: 'string' },
+ content_selector: [
+ { path: '**/blog/**', selector: 'article div.post-body' },
+ { path: '**/docs/**', selector: 'main' },
+ ],
+ include_headers: { 'cache-control': 'no-cache, no-store' },
include_images: true,
specific_sitemaps: ['https://example.com/sitemap.xml', 'https://example.com/blog-sitemap.xml'],
use_browser_rendering: true,
diff --git a/tests/api-resources/aisearch/namespaces/instances/instances.test.ts b/tests/api-resources/aisearch/namespaces/instances/instances.test.ts
index 5adf42db0d..b12d53e447 100644
--- a/tests/api-resources/aisearch/namespaces/instances/instances.test.ts
+++ b/tests/api-resources/aisearch/namespaces/instances/instances.test.ts
@@ -77,8 +77,11 @@ describe('resource instances', () => {
source: 'all',
},
parse_options: {
- content_selector: [{ path: '**/blog/**', selector: 'article .post-body' }],
- include_headers: { foo: 'string' },
+ content_selector: [
+ { path: '**/blog/**', selector: 'article div.post-body' },
+ { path: '**/docs/**', selector: 'main' },
+ ],
+ include_headers: { 'cache-control': 'no-cache, no-store' },
include_images: true,
specific_sitemaps: ['https://example.com/sitemap.xml', 'https://example.com/blog-sitemap.xml'],
use_browser_rendering: true,
@@ -161,8 +164,11 @@ describe('resource instances', () => {
source: 'all',
},
parse_options: {
- content_selector: [{ path: '**/blog/**', selector: 'article .post-body' }],
- include_headers: { foo: 'string' },
+ content_selector: [
+ { path: '**/blog/**', selector: 'article div.post-body' },
+ { path: '**/docs/**', selector: 'main' },
+ ],
+ include_headers: { 'cache-control': 'no-cache, no-store' },
include_images: true,
specific_sitemaps: ['https://example.com/sitemap.xml', 'https://example.com/blog-sitemap.xml'],
use_browser_rendering: true,
From 19cbc6a259d77bf8f4f3cb65f99cb9974b717b41 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 5 May 2026 14:39:59 +0000
Subject: [PATCH 03/73] feat: feat(load_balancer_monitor_group): promote
load_balancer_monitor_group config to main
* feat(load_balancers): promote monitor group Stainless config to main
Add monitor group references endpoint and set terraform resource name
to load_balancer_monitor_group. Cherry-picked from staging.
---
.stats.yml | 4 +-
scripts/detect-breaking-changes | 3 +-
src/resources/load-balancers/api.md | 24 +-
src/resources/load-balancers/index.ts | 2 +-
.../load-balancers/load-balancers.ts | 24 +-
.../load-balancers/monitor-groups.ts | 435 +----------------
.../load-balancers/monitor-groups/index.ts | 19 +
.../monitor-groups/monitor-groups.ts | 454 ++++++++++++++++++
.../monitor-groups/references.ts | 63 +++
.../monitor-groups.test.ts | 0
.../monitor-groups/references.test.ts | 33 ++
11 files changed, 604 insertions(+), 457 deletions(-)
create mode 100644 src/resources/load-balancers/monitor-groups/index.ts
create mode 100644 src/resources/load-balancers/monitor-groups/monitor-groups.ts
create mode 100644 src/resources/load-balancers/monitor-groups/references.ts
rename tests/api-resources/load-balancers/{ => monitor-groups}/monitor-groups.test.ts (100%)
create mode 100644 tests/api-resources/load-balancers/monitor-groups/references.test.ts
diff --git a/.stats.yml b/.stats.yml
index 3c642fb30b..0826ed7cbc 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 2204
+configured_endpoints: 2205
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
openapi_spec_hash: 42dd4ac0ac3f5c00bbe80e26fed2fa51
-config_hash: 20574d7a53e0349a3337a121a46638d4
+config_hash: 8ff9a61d85e7bdc4cb1a445d27d8173e
diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes
index 3e4cc25513..0a0c791c75 100755
--- a/scripts/detect-breaking-changes
+++ b/scripts/detect-breaking-changes
@@ -47,7 +47,8 @@ TEST_PATHS=(
tests/api-resources/load-balancers/monitors/monitors.test.ts
tests/api-resources/load-balancers/monitors/previews.test.ts
tests/api-resources/load-balancers/monitors/references.test.ts
- tests/api-resources/load-balancers/monitor-groups.test.ts
+ tests/api-resources/load-balancers/monitor-groups/monitor-groups.test.ts
+ tests/api-resources/load-balancers/monitor-groups/references.test.ts
tests/api-resources/load-balancers/pools/pools.test.ts
tests/api-resources/load-balancers/pools/health.test.ts
tests/api-resources/load-balancers/pools/references.test.ts
diff --git a/src/resources/load-balancers/api.md b/src/resources/load-balancers/api.md
index 569455403a..2d91342b90 100644
--- a/src/resources/load-balancers/api.md
+++ b/src/resources/load-balancers/api.md
@@ -70,16 +70,26 @@ Methods:
Types:
-- MonitorGroup
+- MonitorGroup
Methods:
-- client.loadBalancers.monitorGroups.create({ ...params }) -> MonitorGroup
-- client.loadBalancers.monitorGroups.update(monitorGroupId, { ...params }) -> MonitorGroup
-- client.loadBalancers.monitorGroups.list({ ...params }) -> MonitorGroupsSinglePage
-- client.loadBalancers.monitorGroups.delete(monitorGroupId, { ...params }) -> MonitorGroup
-- client.loadBalancers.monitorGroups.edit(monitorGroupId, { ...params }) -> MonitorGroup
-- client.loadBalancers.monitorGroups.get(monitorGroupId, { ...params }) -> MonitorGroup
+- client.loadBalancers.monitorGroups.create({ ...params }) -> MonitorGroup
+- client.loadBalancers.monitorGroups.update(monitorGroupId, { ...params }) -> MonitorGroup
+- client.loadBalancers.monitorGroups.list({ ...params }) -> MonitorGroupsSinglePage
+- client.loadBalancers.monitorGroups.delete(monitorGroupId, { ...params }) -> MonitorGroup
+- client.loadBalancers.monitorGroups.edit(monitorGroupId, { ...params }) -> MonitorGroup
+- client.loadBalancers.monitorGroups.get(monitorGroupId, { ...params }) -> MonitorGroup
+
+### References
+
+Types:
+
+- ReferenceGetResponse
+
+Methods:
+
+- client.loadBalancers.monitorGroups.references.get(monitorGroupId, { ...params }) -> ReferenceGetResponsesSinglePage
## Pools
diff --git a/src/resources/load-balancers/index.ts b/src/resources/load-balancers/index.ts
index 8758b53ed9..8d36b0c223 100644
--- a/src/resources/load-balancers/index.ts
+++ b/src/resources/load-balancers/index.ts
@@ -11,7 +11,7 @@ export {
type MonitorGroupDeleteParams,
type MonitorGroupEditParams,
type MonitorGroupGetParams,
-} from './monitor-groups';
+} from './monitor-groups/index';
export {
MonitorsSinglePage,
Monitors,
diff --git a/src/resources/load-balancers/load-balancers.ts b/src/resources/load-balancers/load-balancers.ts
index 73f57b5759..525cdb2394 100644
--- a/src/resources/load-balancers/load-balancers.ts
+++ b/src/resources/load-balancers/load-balancers.ts
@@ -3,18 +3,6 @@
import { APIResource } from '../../resource';
import * as Core from '../../core';
import * as LoadBalancersAPI from './load-balancers';
-import * as MonitorGroupsAPI from './monitor-groups';
-import {
- MonitorGroup,
- MonitorGroupCreateParams,
- MonitorGroupDeleteParams,
- MonitorGroupEditParams,
- MonitorGroupGetParams,
- MonitorGroupListParams,
- MonitorGroupUpdateParams,
- MonitorGroups,
- MonitorGroupsSinglePage,
-} from './monitor-groups';
import * as PreviewsAPI from './previews';
import { PreviewGetParams, PreviewGetResponse, Previews } from './previews';
import * as RegionsAPI from './regions';
@@ -26,6 +14,18 @@ import {
SearchListResponsesV4PagePagination,
Searches,
} from './searches';
+import * as MonitorGroupsAPI from './monitor-groups/monitor-groups';
+import {
+ MonitorGroup,
+ MonitorGroupCreateParams,
+ MonitorGroupDeleteParams,
+ MonitorGroupEditParams,
+ MonitorGroupGetParams,
+ MonitorGroupListParams,
+ MonitorGroupUpdateParams,
+ MonitorGroups,
+ MonitorGroupsSinglePage,
+} from './monitor-groups/monitor-groups';
import * as MonitorsAPI from './monitors/monitors';
import {
Monitor,
diff --git a/src/resources/load-balancers/monitor-groups.ts b/src/resources/load-balancers/monitor-groups.ts
index c818642b0f..1c11056182 100644
--- a/src/resources/load-balancers/monitor-groups.ts
+++ b/src/resources/load-balancers/monitor-groups.ts
@@ -1,436 +1,3 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { APIResource } from '../../resource';
-import * as Core from '../../core';
-import { SinglePage } from '../../pagination';
-
-export class MonitorGroups extends APIResource {
- /**
- * Create a new monitor group.
- *
- * @example
- * ```ts
- * const monitorGroup =
- * await client.loadBalancers.monitorGroups.create({
- * account_id: '023e105f4ecef8ad9ca31a8372d0c353',
- * id: 'id',
- * description: 'Primary datacenter monitors',
- * members: [
- * {
- * enabled: true,
- * monitor_id: 'monitor_id',
- * monitoring_only: false,
- * must_be_healthy: true,
- * },
- * ],
- * });
- * ```
- */
- create(params: MonitorGroupCreateParams, options?: Core.RequestOptions): Core.APIPromise {
- const { account_id, ...body } = params;
- return (
- this._client.post(`/accounts/${account_id}/load_balancers/monitor_groups`, {
- body,
- ...options,
- }) as Core.APIPromise<{ result: MonitorGroup }>
- )._thenUnwrap((obj) => obj.result);
- }
-
- /**
- * Modify a configured monitor group.
- *
- * @example
- * ```ts
- * const monitorGroup =
- * await client.loadBalancers.monitorGroups.update(
- * '17b5962d775c646f3f9725cbc7a53df4',
- * {
- * account_id: '023e105f4ecef8ad9ca31a8372d0c353',
- * id: 'id',
- * description: 'Primary datacenter monitors',
- * members: [
- * {
- * enabled: true,
- * monitor_id: 'monitor_id',
- * monitoring_only: false,
- * must_be_healthy: true,
- * },
- * ],
- * },
- * );
- * ```
- */
- update(
- monitorGroupId: string,
- params: MonitorGroupUpdateParams,
- options?: Core.RequestOptions,
- ): Core.APIPromise {
- const { account_id, ...body } = params;
- return (
- this._client.put(`/accounts/${account_id}/load_balancers/monitor_groups/${monitorGroupId}`, {
- body,
- ...options,
- }) as Core.APIPromise<{ result: MonitorGroup }>
- )._thenUnwrap((obj) => obj.result);
- }
-
- /**
- * List configured monitor groups.
- *
- * @example
- * ```ts
- * // Automatically fetches more pages as needed.
- * for await (const monitorGroup of client.loadBalancers.monitorGroups.list(
- * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
- * )) {
- * // ...
- * }
- * ```
- */
- list(
- params: MonitorGroupListParams,
- options?: Core.RequestOptions,
- ): Core.PagePromise {
- const { account_id } = params;
- return this._client.getAPIList(
- `/accounts/${account_id}/load_balancers/monitor_groups`,
- MonitorGroupsSinglePage,
- options,
- );
- }
-
- /**
- * Delete a configured monitor group.
- *
- * @example
- * ```ts
- * const monitorGroup =
- * await client.loadBalancers.monitorGroups.delete(
- * '17b5962d775c646f3f9725cbc7a53df4',
- * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
- * );
- * ```
- */
- delete(
- monitorGroupId: string,
- params: MonitorGroupDeleteParams,
- options?: Core.RequestOptions,
- ): Core.APIPromise {
- const { account_id } = params;
- return (
- this._client.delete(
- `/accounts/${account_id}/load_balancers/monitor_groups/${monitorGroupId}`,
- options,
- ) as Core.APIPromise<{ result: MonitorGroup }>
- )._thenUnwrap((obj) => obj.result);
- }
-
- /**
- * Apply changes to an existing monitor group, overwriting the supplied properties.
- *
- * @example
- * ```ts
- * const monitorGroup =
- * await client.loadBalancers.monitorGroups.edit(
- * '17b5962d775c646f3f9725cbc7a53df4',
- * {
- * account_id: '023e105f4ecef8ad9ca31a8372d0c353',
- * id: 'id',
- * description: 'Primary datacenter monitors',
- * members: [
- * {
- * enabled: true,
- * monitor_id: 'monitor_id',
- * monitoring_only: false,
- * must_be_healthy: true,
- * },
- * ],
- * },
- * );
- * ```
- */
- edit(
- monitorGroupId: string,
- params: MonitorGroupEditParams,
- options?: Core.RequestOptions,
- ): Core.APIPromise {
- const { account_id, ...body } = params;
- return (
- this._client.patch(`/accounts/${account_id}/load_balancers/monitor_groups/${monitorGroupId}`, {
- body,
- ...options,
- }) as Core.APIPromise<{ result: MonitorGroup }>
- )._thenUnwrap((obj) => obj.result);
- }
-
- /**
- * Fetch a single configured monitor group.
- *
- * @example
- * ```ts
- * const monitorGroup =
- * await client.loadBalancers.monitorGroups.get(
- * '17b5962d775c646f3f9725cbc7a53df4',
- * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
- * );
- * ```
- */
- get(
- monitorGroupId: string,
- params: MonitorGroupGetParams,
- options?: Core.RequestOptions,
- ): Core.APIPromise {
- const { account_id } = params;
- return (
- this._client.get(
- `/accounts/${account_id}/load_balancers/monitor_groups/${monitorGroupId}`,
- options,
- ) as Core.APIPromise<{ result: MonitorGroup }>
- )._thenUnwrap((obj) => obj.result);
- }
-}
-
-export class MonitorGroupsSinglePage extends SinglePage {}
-
-export interface MonitorGroup {
- /**
- * The ID of the Monitor Group to use for checking the health of origins within
- * this pool.
- */
- id: string;
-
- /**
- * A short description of the monitor group
- */
- description: string;
-
- /**
- * List of monitors in this group
- */
- members: Array;
-
- /**
- * The timestamp of when the monitor group was created
- */
- created_at?: string;
-
- /**
- * The timestamp of when the monitor group was last updated
- */
- updated_at?: string;
-}
-
-export namespace MonitorGroup {
- export interface Member {
- /**
- * Whether this monitor is enabled in the group
- */
- enabled: boolean;
-
- /**
- * The ID of the Monitor to use for checking the health of origins within this
- * pool.
- */
- monitor_id: string;
-
- /**
- * Whether this monitor is used for monitoring only (does not affect pool health)
- */
- monitoring_only: boolean;
-
- /**
- * Whether this monitor must be healthy for the pool to be considered healthy
- */
- must_be_healthy: boolean;
-
- /**
- * The timestamp of when the monitor was added to the group
- */
- created_at?: string;
-
- /**
- * The timestamp of when the monitor group member was last updated
- */
- updated_at?: string;
- }
-}
-
-export interface MonitorGroupCreateParams {
- /**
- * Path param: Identifier.
- */
- account_id: string;
-
- /**
- * Body param: The ID of the Monitor Group to use for checking the health of
- * origins within this pool.
- */
- id: string;
-
- /**
- * Body param: A short description of the monitor group
- */
- description: string;
-
- /**
- * Body param: List of monitors in this group
- */
- members: Array;
-}
-
-export namespace MonitorGroupCreateParams {
- export interface Member {
- /**
- * Whether this monitor is enabled in the group
- */
- enabled: boolean;
-
- /**
- * The ID of the Monitor to use for checking the health of origins within this
- * pool.
- */
- monitor_id: string;
-
- /**
- * Whether this monitor is used for monitoring only (does not affect pool health)
- */
- monitoring_only: boolean;
-
- /**
- * Whether this monitor must be healthy for the pool to be considered healthy
- */
- must_be_healthy: boolean;
- }
-}
-
-export interface MonitorGroupUpdateParams {
- /**
- * Path param: Identifier.
- */
- account_id: string;
-
- /**
- * Body param: The ID of the Monitor Group to use for checking the health of
- * origins within this pool.
- */
- id: string;
-
- /**
- * Body param: A short description of the monitor group
- */
- description: string;
-
- /**
- * Body param: List of monitors in this group
- */
- members: Array;
-}
-
-export namespace MonitorGroupUpdateParams {
- export interface Member {
- /**
- * Whether this monitor is enabled in the group
- */
- enabled: boolean;
-
- /**
- * The ID of the Monitor to use for checking the health of origins within this
- * pool.
- */
- monitor_id: string;
-
- /**
- * Whether this monitor is used for monitoring only (does not affect pool health)
- */
- monitoring_only: boolean;
-
- /**
- * Whether this monitor must be healthy for the pool to be considered healthy
- */
- must_be_healthy: boolean;
- }
-}
-
-export interface MonitorGroupListParams {
- /**
- * Identifier.
- */
- account_id: string;
-}
-
-export interface MonitorGroupDeleteParams {
- /**
- * Identifier.
- */
- account_id: string;
-}
-
-export interface MonitorGroupEditParams {
- /**
- * Path param: Identifier.
- */
- account_id: string;
-
- /**
- * Body param: The ID of the Monitor Group to use for checking the health of
- * origins within this pool.
- */
- id: string;
-
- /**
- * Body param: A short description of the monitor group
- */
- description: string;
-
- /**
- * Body param: List of monitors in this group
- */
- members: Array;
-}
-
-export namespace MonitorGroupEditParams {
- export interface Member {
- /**
- * Whether this monitor is enabled in the group
- */
- enabled: boolean;
-
- /**
- * The ID of the Monitor to use for checking the health of origins within this
- * pool.
- */
- monitor_id: string;
-
- /**
- * Whether this monitor is used for monitoring only (does not affect pool health)
- */
- monitoring_only: boolean;
-
- /**
- * Whether this monitor must be healthy for the pool to be considered healthy
- */
- must_be_healthy: boolean;
- }
-}
-
-export interface MonitorGroupGetParams {
- /**
- * Identifier.
- */
- account_id: string;
-}
-
-MonitorGroups.MonitorGroupsSinglePage = MonitorGroupsSinglePage;
-
-export declare namespace MonitorGroups {
- export {
- type MonitorGroup as MonitorGroup,
- MonitorGroupsSinglePage as MonitorGroupsSinglePage,
- type MonitorGroupCreateParams as MonitorGroupCreateParams,
- type MonitorGroupUpdateParams as MonitorGroupUpdateParams,
- type MonitorGroupListParams as MonitorGroupListParams,
- type MonitorGroupDeleteParams as MonitorGroupDeleteParams,
- type MonitorGroupEditParams as MonitorGroupEditParams,
- type MonitorGroupGetParams as MonitorGroupGetParams,
- };
-}
+export * from './monitor-groups/index';
diff --git a/src/resources/load-balancers/monitor-groups/index.ts b/src/resources/load-balancers/monitor-groups/index.ts
new file mode 100644
index 0000000000..ff06afc659
--- /dev/null
+++ b/src/resources/load-balancers/monitor-groups/index.ts
@@ -0,0 +1,19 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+export {
+ MonitorGroupsSinglePage,
+ MonitorGroups,
+ type MonitorGroup,
+ type MonitorGroupCreateParams,
+ type MonitorGroupUpdateParams,
+ type MonitorGroupListParams,
+ type MonitorGroupDeleteParams,
+ type MonitorGroupEditParams,
+ type MonitorGroupGetParams,
+} from './monitor-groups';
+export {
+ ReferenceGetResponsesSinglePage,
+ References,
+ type ReferenceGetResponse,
+ type ReferenceGetParams,
+} from './references';
diff --git a/src/resources/load-balancers/monitor-groups/monitor-groups.ts b/src/resources/load-balancers/monitor-groups/monitor-groups.ts
new file mode 100644
index 0000000000..0c74989ebc
--- /dev/null
+++ b/src/resources/load-balancers/monitor-groups/monitor-groups.ts
@@ -0,0 +1,454 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import { APIResource } from '../../../resource';
+import * as Core from '../../../core';
+import * as ReferencesAPI from './references';
+import {
+ ReferenceGetParams,
+ ReferenceGetResponse,
+ ReferenceGetResponsesSinglePage,
+ References,
+} from './references';
+import { SinglePage } from '../../../pagination';
+
+export class MonitorGroups extends APIResource {
+ references: ReferencesAPI.References = new ReferencesAPI.References(this._client);
+
+ /**
+ * Create a new monitor group.
+ *
+ * @example
+ * ```ts
+ * const monitorGroup =
+ * await client.loadBalancers.monitorGroups.create({
+ * account_id: '023e105f4ecef8ad9ca31a8372d0c353',
+ * id: 'id',
+ * description: 'Primary datacenter monitors',
+ * members: [
+ * {
+ * enabled: true,
+ * monitor_id: 'monitor_id',
+ * monitoring_only: false,
+ * must_be_healthy: true,
+ * },
+ * ],
+ * });
+ * ```
+ */
+ create(params: MonitorGroupCreateParams, options?: Core.RequestOptions): Core.APIPromise {
+ const { account_id, ...body } = params;
+ return (
+ this._client.post(`/accounts/${account_id}/load_balancers/monitor_groups`, {
+ body,
+ ...options,
+ }) as Core.APIPromise<{ result: MonitorGroup }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+
+ /**
+ * Modify a configured monitor group.
+ *
+ * @example
+ * ```ts
+ * const monitorGroup =
+ * await client.loadBalancers.monitorGroups.update(
+ * '17b5962d775c646f3f9725cbc7a53df4',
+ * {
+ * account_id: '023e105f4ecef8ad9ca31a8372d0c353',
+ * id: 'id',
+ * description: 'Primary datacenter monitors',
+ * members: [
+ * {
+ * enabled: true,
+ * monitor_id: 'monitor_id',
+ * monitoring_only: false,
+ * must_be_healthy: true,
+ * },
+ * ],
+ * },
+ * );
+ * ```
+ */
+ update(
+ monitorGroupId: string,
+ params: MonitorGroupUpdateParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ const { account_id, ...body } = params;
+ return (
+ this._client.put(`/accounts/${account_id}/load_balancers/monitor_groups/${monitorGroupId}`, {
+ body,
+ ...options,
+ }) as Core.APIPromise<{ result: MonitorGroup }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+
+ /**
+ * List configured monitor groups.
+ *
+ * @example
+ * ```ts
+ * // Automatically fetches more pages as needed.
+ * for await (const monitorGroup of client.loadBalancers.monitorGroups.list(
+ * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
+ * )) {
+ * // ...
+ * }
+ * ```
+ */
+ list(
+ params: MonitorGroupListParams,
+ options?: Core.RequestOptions,
+ ): Core.PagePromise {
+ const { account_id } = params;
+ return this._client.getAPIList(
+ `/accounts/${account_id}/load_balancers/monitor_groups`,
+ MonitorGroupsSinglePage,
+ options,
+ );
+ }
+
+ /**
+ * Delete a configured monitor group.
+ *
+ * @example
+ * ```ts
+ * const monitorGroup =
+ * await client.loadBalancers.monitorGroups.delete(
+ * '17b5962d775c646f3f9725cbc7a53df4',
+ * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
+ * );
+ * ```
+ */
+ delete(
+ monitorGroupId: string,
+ params: MonitorGroupDeleteParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ const { account_id } = params;
+ return (
+ this._client.delete(
+ `/accounts/${account_id}/load_balancers/monitor_groups/${monitorGroupId}`,
+ options,
+ ) as Core.APIPromise<{ result: MonitorGroup }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+
+ /**
+ * Apply changes to an existing monitor group, overwriting the supplied properties.
+ *
+ * @example
+ * ```ts
+ * const monitorGroup =
+ * await client.loadBalancers.monitorGroups.edit(
+ * '17b5962d775c646f3f9725cbc7a53df4',
+ * {
+ * account_id: '023e105f4ecef8ad9ca31a8372d0c353',
+ * id: 'id',
+ * description: 'Primary datacenter monitors',
+ * members: [
+ * {
+ * enabled: true,
+ * monitor_id: 'monitor_id',
+ * monitoring_only: false,
+ * must_be_healthy: true,
+ * },
+ * ],
+ * },
+ * );
+ * ```
+ */
+ edit(
+ monitorGroupId: string,
+ params: MonitorGroupEditParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ const { account_id, ...body } = params;
+ return (
+ this._client.patch(`/accounts/${account_id}/load_balancers/monitor_groups/${monitorGroupId}`, {
+ body,
+ ...options,
+ }) as Core.APIPromise<{ result: MonitorGroup }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+
+ /**
+ * Fetch a single configured monitor group.
+ *
+ * @example
+ * ```ts
+ * const monitorGroup =
+ * await client.loadBalancers.monitorGroups.get(
+ * '17b5962d775c646f3f9725cbc7a53df4',
+ * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
+ * );
+ * ```
+ */
+ get(
+ monitorGroupId: string,
+ params: MonitorGroupGetParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ const { account_id } = params;
+ return (
+ this._client.get(
+ `/accounts/${account_id}/load_balancers/monitor_groups/${monitorGroupId}`,
+ options,
+ ) as Core.APIPromise<{ result: MonitorGroup }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+}
+
+export class MonitorGroupsSinglePage extends SinglePage {}
+
+export interface MonitorGroup {
+ /**
+ * The ID of the Monitor Group to use for checking the health of origins within
+ * this pool.
+ */
+ id: string;
+
+ /**
+ * A short description of the monitor group
+ */
+ description: string;
+
+ /**
+ * List of monitors in this group
+ */
+ members: Array;
+
+ /**
+ * The timestamp of when the monitor group was created
+ */
+ created_at?: string;
+
+ /**
+ * The timestamp of when the monitor group was last updated
+ */
+ updated_at?: string;
+}
+
+export namespace MonitorGroup {
+ export interface Member {
+ /**
+ * Whether this monitor is enabled in the group
+ */
+ enabled: boolean;
+
+ /**
+ * The ID of the Monitor to use for checking the health of origins within this
+ * pool.
+ */
+ monitor_id: string;
+
+ /**
+ * Whether this monitor is used for monitoring only (does not affect pool health)
+ */
+ monitoring_only: boolean;
+
+ /**
+ * Whether this monitor must be healthy for the pool to be considered healthy
+ */
+ must_be_healthy: boolean;
+
+ /**
+ * The timestamp of when the monitor was added to the group
+ */
+ created_at?: string;
+
+ /**
+ * The timestamp of when the monitor group member was last updated
+ */
+ updated_at?: string;
+ }
+}
+
+export interface MonitorGroupCreateParams {
+ /**
+ * Path param: Identifier.
+ */
+ account_id: string;
+
+ /**
+ * Body param: The ID of the Monitor Group to use for checking the health of
+ * origins within this pool.
+ */
+ id: string;
+
+ /**
+ * Body param: A short description of the monitor group
+ */
+ description: string;
+
+ /**
+ * Body param: List of monitors in this group
+ */
+ members: Array;
+}
+
+export namespace MonitorGroupCreateParams {
+ export interface Member {
+ /**
+ * Whether this monitor is enabled in the group
+ */
+ enabled: boolean;
+
+ /**
+ * The ID of the Monitor to use for checking the health of origins within this
+ * pool.
+ */
+ monitor_id: string;
+
+ /**
+ * Whether this monitor is used for monitoring only (does not affect pool health)
+ */
+ monitoring_only: boolean;
+
+ /**
+ * Whether this monitor must be healthy for the pool to be considered healthy
+ */
+ must_be_healthy: boolean;
+ }
+}
+
+export interface MonitorGroupUpdateParams {
+ /**
+ * Path param: Identifier.
+ */
+ account_id: string;
+
+ /**
+ * Body param: The ID of the Monitor Group to use for checking the health of
+ * origins within this pool.
+ */
+ id: string;
+
+ /**
+ * Body param: A short description of the monitor group
+ */
+ description: string;
+
+ /**
+ * Body param: List of monitors in this group
+ */
+ members: Array;
+}
+
+export namespace MonitorGroupUpdateParams {
+ export interface Member {
+ /**
+ * Whether this monitor is enabled in the group
+ */
+ enabled: boolean;
+
+ /**
+ * The ID of the Monitor to use for checking the health of origins within this
+ * pool.
+ */
+ monitor_id: string;
+
+ /**
+ * Whether this monitor is used for monitoring only (does not affect pool health)
+ */
+ monitoring_only: boolean;
+
+ /**
+ * Whether this monitor must be healthy for the pool to be considered healthy
+ */
+ must_be_healthy: boolean;
+ }
+}
+
+export interface MonitorGroupListParams {
+ /**
+ * Identifier.
+ */
+ account_id: string;
+}
+
+export interface MonitorGroupDeleteParams {
+ /**
+ * Identifier.
+ */
+ account_id: string;
+}
+
+export interface MonitorGroupEditParams {
+ /**
+ * Path param: Identifier.
+ */
+ account_id: string;
+
+ /**
+ * Body param: The ID of the Monitor Group to use for checking the health of
+ * origins within this pool.
+ */
+ id: string;
+
+ /**
+ * Body param: A short description of the monitor group
+ */
+ description: string;
+
+ /**
+ * Body param: List of monitors in this group
+ */
+ members: Array;
+}
+
+export namespace MonitorGroupEditParams {
+ export interface Member {
+ /**
+ * Whether this monitor is enabled in the group
+ */
+ enabled: boolean;
+
+ /**
+ * The ID of the Monitor to use for checking the health of origins within this
+ * pool.
+ */
+ monitor_id: string;
+
+ /**
+ * Whether this monitor is used for monitoring only (does not affect pool health)
+ */
+ monitoring_only: boolean;
+
+ /**
+ * Whether this monitor must be healthy for the pool to be considered healthy
+ */
+ must_be_healthy: boolean;
+ }
+}
+
+export interface MonitorGroupGetParams {
+ /**
+ * Identifier.
+ */
+ account_id: string;
+}
+
+MonitorGroups.MonitorGroupsSinglePage = MonitorGroupsSinglePage;
+MonitorGroups.References = References;
+MonitorGroups.ReferenceGetResponsesSinglePage = ReferenceGetResponsesSinglePage;
+
+export declare namespace MonitorGroups {
+ export {
+ type MonitorGroup as MonitorGroup,
+ MonitorGroupsSinglePage as MonitorGroupsSinglePage,
+ type MonitorGroupCreateParams as MonitorGroupCreateParams,
+ type MonitorGroupUpdateParams as MonitorGroupUpdateParams,
+ type MonitorGroupListParams as MonitorGroupListParams,
+ type MonitorGroupDeleteParams as MonitorGroupDeleteParams,
+ type MonitorGroupEditParams as MonitorGroupEditParams,
+ type MonitorGroupGetParams as MonitorGroupGetParams,
+ };
+
+ export {
+ References as References,
+ type ReferenceGetResponse as ReferenceGetResponse,
+ ReferenceGetResponsesSinglePage as ReferenceGetResponsesSinglePage,
+ type ReferenceGetParams as ReferenceGetParams,
+ };
+}
diff --git a/src/resources/load-balancers/monitor-groups/references.ts b/src/resources/load-balancers/monitor-groups/references.ts
new file mode 100644
index 0000000000..ad711a7b60
--- /dev/null
+++ b/src/resources/load-balancers/monitor-groups/references.ts
@@ -0,0 +1,63 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import { APIResource } from '../../../resource';
+import * as Core from '../../../core';
+import { SinglePage } from '../../../pagination';
+
+export class References extends APIResource {
+ /**
+ * Get the list of resources that reference the provided monitor group.
+ *
+ * @example
+ * ```ts
+ * // Automatically fetches more pages as needed.
+ * for await (const referenceGetResponse of client.loadBalancers.monitorGroups.references.get(
+ * 'f1aba936b94213e5b8dca0c0dbf1f9cc',
+ * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
+ * )) {
+ * // ...
+ * }
+ * ```
+ */
+ get(
+ monitorGroupId: string,
+ params: ReferenceGetParams,
+ options?: Core.RequestOptions,
+ ): Core.PagePromise {
+ const { account_id } = params;
+ return this._client.getAPIList(
+ `/accounts/${account_id}/load_balancers/monitor_groups/${monitorGroupId}/references`,
+ ReferenceGetResponsesSinglePage,
+ options,
+ );
+ }
+}
+
+export class ReferenceGetResponsesSinglePage extends SinglePage {}
+
+export interface ReferenceGetResponse {
+ reference_type?: '*' | 'referral' | 'referrer';
+
+ resource_id?: string;
+
+ resource_name?: string;
+
+ resource_type?: string;
+}
+
+export interface ReferenceGetParams {
+ /**
+ * Identifier.
+ */
+ account_id: string;
+}
+
+References.ReferenceGetResponsesSinglePage = ReferenceGetResponsesSinglePage;
+
+export declare namespace References {
+ export {
+ type ReferenceGetResponse as ReferenceGetResponse,
+ ReferenceGetResponsesSinglePage as ReferenceGetResponsesSinglePage,
+ type ReferenceGetParams as ReferenceGetParams,
+ };
+}
diff --git a/tests/api-resources/load-balancers/monitor-groups.test.ts b/tests/api-resources/load-balancers/monitor-groups/monitor-groups.test.ts
similarity index 100%
rename from tests/api-resources/load-balancers/monitor-groups.test.ts
rename to tests/api-resources/load-balancers/monitor-groups/monitor-groups.test.ts
diff --git a/tests/api-resources/load-balancers/monitor-groups/references.test.ts b/tests/api-resources/load-balancers/monitor-groups/references.test.ts
new file mode 100644
index 0000000000..0d26b84c9d
--- /dev/null
+++ b/tests/api-resources/load-balancers/monitor-groups/references.test.ts
@@ -0,0 +1,33 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import Cloudflare from 'cloudflare';
+import { Response } from 'node-fetch';
+
+const client = new Cloudflare({
+ apiKey: '144c9defac04969c7bfad8efaa8ea194',
+ apiEmail: 'user@example.com',
+ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
+});
+
+describe('resource references', () => {
+ test('get: only required params', async () => {
+ const responsePromise = client.loadBalancers.monitorGroups.references.get(
+ 'f1aba936b94213e5b8dca0c0dbf1f9cc',
+ { account_id: '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);
+ });
+
+ test('get: required and optional params', async () => {
+ const response = await client.loadBalancers.monitorGroups.references.get(
+ 'f1aba936b94213e5b8dca0c0dbf1f9cc',
+ { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
+ );
+ });
+});
From de557495278405da2bdc668c3f4d147bae979d0f Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 5 May 2026 15:20:27 +0000
Subject: [PATCH 04/73] codegen metadata
---
.stats.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index 0826ed7cbc..e1e29097db 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 2205
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
openapi_spec_hash: 42dd4ac0ac3f5c00bbe80e26fed2fa51
-config_hash: 8ff9a61d85e7bdc4cb1a445d27d8173e
+config_hash: 33ec2cdb453b26c2d3b3a8447bff4595
From ea27501d42b2943164a6e9e740c1bbd12ccdffe8 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 5 May 2026 16:22:33 +0000
Subject: [PATCH 05/73] feat: feat(cache): Update OPCR config to v2 endpoints
(CACHE-13523)
* feat(cache): Update OPCR config to v2 endpoints (CACHE-13523)
Promote OPCR (origin public cloud region) Stainless config from staging to main:
- v2 endpoints under /origin/cloud_regions (PUT-only, no POST), with
upsert + ImportState support via id_path_param + id_property.
- Deprecated v1 methods (/cache/origin_cloud_regions/*) retained as
*_v1 with deprecated annotation; skipped for all SDK/Terraform
targets so only the docs site consumes them. v1 was never published
to SDKs/Terraform historically, and v1 endpoints remain functional
during the deprecation period.
- Resource model points to cache-rules_origin_cloud_region_v2_entry.
Combines staging-branch commits 7e22620f (MR 762) and 1c1ece32 (MR 795).
---
.stats.yml | 4 +-
src/resources/cache/api.md | 21 +-
src/resources/cache/cache.ts | 25 +-
src/resources/cache/index.ts | 12 +-
src/resources/cache/origin-cloud-regions.ts | 534 ++++++------------
.../cache/origin-cloud-regions.test.ts | 55 +-
6 files changed, 223 insertions(+), 428 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index e1e29097db..0d7a1867ad 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 2205
+configured_endpoints: 2204
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
openapi_spec_hash: 42dd4ac0ac3f5c00bbe80e26fed2fa51
-config_hash: 33ec2cdb453b26c2d3b3a8447bff4595
+config_hash: 0c33107d28fc9d1d5726d8ac8459421a
diff --git a/src/resources/cache/api.md b/src/resources/cache/api.md
index e732450dc3..2887704bcc 100644
--- a/src/resources/cache/api.md
+++ b/src/resources/cache/api.md
@@ -74,22 +74,17 @@ Methods:
Types:
- OriginCloudRegion
-- OriginCloudRegionCreateResponse
-- OriginCloudRegionListResponse
- OriginCloudRegionDeleteResponse
- OriginCloudRegionBulkDeleteResponse
-- OriginCloudRegionBulkEditResponse
-- OriginCloudRegionEditResponse
-- OriginCloudRegionGetResponse
+- OriginCloudRegionBulkUpdateResponse
- OriginCloudRegionSupportedRegionsResponse
Methods:
-- client.cache.originCloudRegions.create({ ...params }) -> OriginCloudRegionCreateResponse
-- client.cache.originCloudRegions.list({ ...params }) -> OriginCloudRegionListResponse
-- client.cache.originCloudRegions.delete(originIP, { ...params }) -> OriginCloudRegionDeleteResponse
-- client.cache.originCloudRegions.bulkDelete({ ...params }) -> OriginCloudRegionBulkDeleteResponse
-- client.cache.originCloudRegions.bulkEdit([ ...body ]) -> OriginCloudRegionBulkEditResponse
-- client.cache.originCloudRegions.edit({ ...params }) -> OriginCloudRegionEditResponse
-- client.cache.originCloudRegions.get(originIP, { ...params }) -> OriginCloudRegionGetResponse
-- client.cache.originCloudRegions.supportedRegions({ ...params }) -> OriginCloudRegionSupportedRegionsResponse
+- client.cache.originCloudRegions.update(originIP, { ...params }) -> OriginCloudRegion
+- client.cache.originCloudRegions.list({ ...params }) -> OriginCloudRegionsV4PagePaginationArray
+- client.cache.originCloudRegions.delete(originIP, { ...params }) -> OriginCloudRegionDeleteResponse
+- client.cache.originCloudRegions.bulkDelete({ ...params }) -> OriginCloudRegionBulkDeleteResponse
+- client.cache.originCloudRegions.bulkUpdate([ ...body ]) -> OriginCloudRegionBulkUpdateResponse
+- client.cache.originCloudRegions.get(originIP, { ...params }) -> OriginCloudRegion
+- client.cache.originCloudRegions.supportedRegions({ ...params }) -> OriginCloudRegionSupportedRegionsResponse
diff --git a/src/resources/cache/cache.ts b/src/resources/cache/cache.ts
index b88a2e31d5..78109bfc0b 100644
--- a/src/resources/cache/cache.ts
+++ b/src/resources/cache/cache.ts
@@ -22,21 +22,17 @@ import {
OriginCloudRegion,
OriginCloudRegionBulkDeleteParams,
OriginCloudRegionBulkDeleteResponse,
- OriginCloudRegionBulkEditParams,
- OriginCloudRegionBulkEditResponse,
- OriginCloudRegionCreateParams,
- OriginCloudRegionCreateResponse,
+ OriginCloudRegionBulkUpdateParams,
+ OriginCloudRegionBulkUpdateResponse,
OriginCloudRegionDeleteParams,
OriginCloudRegionDeleteResponse,
- OriginCloudRegionEditParams,
- OriginCloudRegionEditResponse,
OriginCloudRegionGetParams,
- OriginCloudRegionGetResponse,
OriginCloudRegionListParams,
- OriginCloudRegionListResponse,
OriginCloudRegionSupportedRegionsParams,
OriginCloudRegionSupportedRegionsResponse,
+ OriginCloudRegionUpdateParams,
OriginCloudRegions,
+ OriginCloudRegionsV4PagePaginationArray,
} from './origin-cloud-regions';
import * as RegionalTieredCacheAPI from './regional-tiered-cache';
import {
@@ -268,6 +264,7 @@ Cache.SmartTieredCache = SmartTieredCache;
Cache.Variants = Variants;
Cache.RegionalTieredCacheResource = RegionalTieredCacheResource;
Cache.OriginCloudRegions = OriginCloudRegions;
+Cache.OriginCloudRegionsV4PagePaginationArray = OriginCloudRegionsV4PagePaginationArray;
export declare namespace Cache {
export { type CachePurgeResponse as CachePurgeResponse, type CachePurgeParams as CachePurgeParams };
@@ -320,20 +317,16 @@ export declare namespace Cache {
export {
OriginCloudRegions as OriginCloudRegions,
type OriginCloudRegion as OriginCloudRegion,
- type OriginCloudRegionCreateResponse as OriginCloudRegionCreateResponse,
- type OriginCloudRegionListResponse as OriginCloudRegionListResponse,
type OriginCloudRegionDeleteResponse as OriginCloudRegionDeleteResponse,
type OriginCloudRegionBulkDeleteResponse as OriginCloudRegionBulkDeleteResponse,
- type OriginCloudRegionBulkEditResponse as OriginCloudRegionBulkEditResponse,
- type OriginCloudRegionEditResponse as OriginCloudRegionEditResponse,
- type OriginCloudRegionGetResponse as OriginCloudRegionGetResponse,
+ type OriginCloudRegionBulkUpdateResponse as OriginCloudRegionBulkUpdateResponse,
type OriginCloudRegionSupportedRegionsResponse as OriginCloudRegionSupportedRegionsResponse,
- type OriginCloudRegionCreateParams as OriginCloudRegionCreateParams,
+ OriginCloudRegionsV4PagePaginationArray as OriginCloudRegionsV4PagePaginationArray,
+ type OriginCloudRegionUpdateParams as OriginCloudRegionUpdateParams,
type OriginCloudRegionListParams as OriginCloudRegionListParams,
type OriginCloudRegionDeleteParams as OriginCloudRegionDeleteParams,
type OriginCloudRegionBulkDeleteParams as OriginCloudRegionBulkDeleteParams,
- type OriginCloudRegionBulkEditParams as OriginCloudRegionBulkEditParams,
- type OriginCloudRegionEditParams as OriginCloudRegionEditParams,
+ type OriginCloudRegionBulkUpdateParams as OriginCloudRegionBulkUpdateParams,
type OriginCloudRegionGetParams as OriginCloudRegionGetParams,
type OriginCloudRegionSupportedRegionsParams as OriginCloudRegionSupportedRegionsParams,
};
diff --git a/src/resources/cache/index.ts b/src/resources/cache/index.ts
index 33310961fc..f10ef06193 100644
--- a/src/resources/cache/index.ts
+++ b/src/resources/cache/index.ts
@@ -16,22 +16,18 @@ export {
type CacheReserveStatusParams,
} from './cache-reserve';
export {
+ OriginCloudRegionsV4PagePaginationArray,
OriginCloudRegions,
type OriginCloudRegion,
- type OriginCloudRegionCreateResponse,
- type OriginCloudRegionListResponse,
type OriginCloudRegionDeleteResponse,
type OriginCloudRegionBulkDeleteResponse,
- type OriginCloudRegionBulkEditResponse,
- type OriginCloudRegionEditResponse,
- type OriginCloudRegionGetResponse,
+ type OriginCloudRegionBulkUpdateResponse,
type OriginCloudRegionSupportedRegionsResponse,
- type OriginCloudRegionCreateParams,
+ type OriginCloudRegionUpdateParams,
type OriginCloudRegionListParams,
type OriginCloudRegionDeleteParams,
type OriginCloudRegionBulkDeleteParams,
- type OriginCloudRegionBulkEditParams,
- type OriginCloudRegionEditParams,
+ type OriginCloudRegionBulkUpdateParams,
type OriginCloudRegionGetParams,
type OriginCloudRegionSupportedRegionsParams,
} from './origin-cloud-regions';
diff --git a/src/resources/cache/origin-cloud-regions.ts b/src/resources/cache/origin-cloud-regions.ts
index afa70055ab..284eb69404 100644
--- a/src/resources/cache/origin-cloud-regions.ts
+++ b/src/resources/cache/origin-cloud-regions.ts
@@ -2,71 +2,81 @@
import { APIResource } from '../../resource';
import * as Core from '../../core';
+import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../pagination';
export class OriginCloudRegions extends APIResource {
/**
- * Adds a single IP-to-cloud-region mapping for the zone. The IP must be a valid
- * IPv4 or IPv6 address and is normalized to canonical form before storage (RFC
- * 5952 for IPv6). Returns 400 (code 1145) if a mapping for that IP already exists
- * — use PATCH to update an existing entry. The vendor and region are validated
- * against the list from
- * `GET /zones/{zone_id}/cache/origin_cloud_regions/supported_regions`.
+ * Creates a new IP-to-cloud-region mapping or replaces the existing mapping for
+ * the specified IP. PUT is idempotent — calling it repeatedly with the same body
+ * produces the same result. The IP path parameter is normalized to canonical form
+ * (RFC 5952 for IPv6) before storage. The vendor and region are validated against
+ * the list from `GET /zones/{zone_id}/origin/cloud_regions/supported_regions`.
+ * Returns 400 if the `origin_ip` in the body does not match the URL path
+ * parameter. Returns 403 (code 1164) when the zone has reached the limit of 3,500
+ * IP mappings.
*
* @example
* ```ts
* const originCloudRegion =
- * await client.cache.originCloudRegions.create({
- * zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
- * ip: '192.0.2.1',
- * region: 'us-east-1',
- * vendor: 'aws',
- * });
+ * await client.cache.originCloudRegions.update(
+ * '192.0.2.1',
+ * {
+ * zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
+ * origin_ip: '192.0.2.1',
+ * region: 'us-east-1',
+ * vendor: 'aws',
+ * },
+ * );
* ```
*/
- create(
- params: OriginCloudRegionCreateParams,
+ update(
+ originIP: string,
+ params: OriginCloudRegionUpdateParams,
options?: Core.RequestOptions,
- ): Core.APIPromise {
+ ): Core.APIPromise {
const { zone_id, ...body } = params;
return (
- this._client.post(`/zones/${zone_id}/cache/origin_cloud_regions`, {
+ this._client.put(`/zones/${zone_id}/origin/cloud_regions/${originIP}`, {
body,
...options,
- }) as Core.APIPromise<{ result: OriginCloudRegionCreateResponse }>
+ }) as Core.APIPromise<{ result: OriginCloudRegion }>
)._thenUnwrap((obj) => obj.result);
}
/**
- * Returns all IP-to-cloud-region mappings configured for the zone. Each mapping
- * tells Cloudflare which cloud vendor and region hosts the origin at that IP,
- * enabling the edge to route via the nearest Tiered Cache upper-tier co-located
- * with that cloud provider. Returns an empty array when no mappings exist.
+ * Returns all IP-to-cloud-region mappings configured for the zone with pagination
+ * support. Each mapping tells Cloudflare which cloud vendor and region hosts the
+ * origin at that IP, enabling the edge to route via the nearest Tiered Cache
+ * upper-tier co-located with that cloud provider. Returns an empty array when no
+ * mappings exist.
*
* @example
* ```ts
- * const originCloudRegions =
- * await client.cache.originCloudRegions.list({
- * zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
- * });
+ * // Automatically fetches more pages as needed.
+ * for await (const originCloudRegion of client.cache.originCloudRegions.list(
+ * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
+ * )) {
+ * // ...
+ * }
* ```
*/
list(
params: OriginCloudRegionListParams,
options?: Core.RequestOptions,
- ): Core.APIPromise {
- const { zone_id } = params;
- return (
- this._client.get(`/zones/${zone_id}/cache/origin_cloud_regions`, options) as Core.APIPromise<{
- result: OriginCloudRegionListResponse;
- }>
- )._thenUnwrap((obj) => obj.result);
+ ): Core.PagePromise {
+ const { zone_id, ...query } = params;
+ return this._client.getAPIList(
+ `/zones/${zone_id}/origin/cloud_regions`,
+ OriginCloudRegionsV4PagePaginationArray,
+ { query, ...options },
+ );
}
/**
* Removes the cloud region mapping for a single origin IP address. The IP path
- * parameter is normalized before lookup. Returns the deleted entry on success.
- * Returns 404 (code 1163) if no mapping exists for the specified IP. When the last
- * mapping for the zone is removed the underlying rule record is also deleted.
+ * parameter is normalized before lookup. Returns the deleted IP on success.
+ * Returns 404 if no mapping exists for the specified IP. When the last mapping for
+ * the zone is removed the underlying rule record is also deleted.
*
* @example
* ```ts
@@ -84,10 +94,9 @@ export class OriginCloudRegions extends APIResource {
): Core.APIPromise {
const { zone_id } = params;
return (
- this._client.delete(
- `/zones/${zone_id}/cache/origin_cloud_regions/${originIP}`,
- options,
- ) as Core.APIPromise<{ result: OriginCloudRegionDeleteResponse }>
+ this._client.delete(`/zones/${zone_id}/origin/cloud_regions/${originIP}`, options) as Core.APIPromise<{
+ result: OriginCloudRegionDeleteResponse;
+ }>
)._thenUnwrap((obj) => obj.result);
}
@@ -111,32 +120,34 @@ export class OriginCloudRegions extends APIResource {
): Core.APIPromise {
const { zone_id } = params;
return (
- this._client.delete(`/zones/${zone_id}/cache/origin_cloud_regions/batch`, options) as Core.APIPromise<{
+ this._client.delete(`/zones/${zone_id}/origin/cloud_regions/batch`, options) as Core.APIPromise<{
result: OriginCloudRegionBulkDeleteResponse;
}>
)._thenUnwrap((obj) => obj.result);
}
/**
- * Adds or updates up to 100 IP-to-cloud-region mappings in a single request. Each
- * item is validated independently — valid items are applied and invalid items are
- * returned in the `failed` array. The vendor and region for every item are
- * validated against the list from
- * `GET /zones/{zone_id}/cache/origin_cloud_regions/supported_regions`.
+ * Upserts up to 100 IP-to-cloud-region mappings in a single request. Items in the
+ * request body are created or replaced; mappings not included in the request body
+ * are preserved unchanged (this is a merge operation, not a full collection
+ * replacement). Each item is validated independently — valid items are applied and
+ * invalid items are returned in the `failed` array. The vendor and region for
+ * every item are validated against the list from
+ * `GET /zones/{zone_id}/origin/cloud_regions/supported_regions`.
*
* @example
* ```ts
* const response =
- * await client.cache.originCloudRegions.bulkEdit({
+ * await client.cache.originCloudRegions.bulkUpdate({
* zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
* body: [
* {
- * ip: '192.0.2.1',
+ * origin_ip: '192.0.2.1',
* region: 'us-east-1',
* vendor: 'aws',
* },
* {
- * ip: '2001:db8::1',
+ * origin_ip: '2001:db8::1',
* region: 'us-central1',
* vendor: 'gcp',
* },
@@ -144,55 +155,23 @@ export class OriginCloudRegions extends APIResource {
* });
* ```
*/
- bulkEdit(
- params: OriginCloudRegionBulkEditParams,
+ bulkUpdate(
+ params: OriginCloudRegionBulkUpdateParams,
options?: Core.RequestOptions,
- ): Core.APIPromise {
+ ): Core.APIPromise {
const { zone_id, body } = params;
return (
- this._client.patch(`/zones/${zone_id}/cache/origin_cloud_regions/batch`, {
+ this._client.put(`/zones/${zone_id}/origin/cloud_regions/batch`, {
body: body,
...options,
- }) as Core.APIPromise<{ result: OriginCloudRegionBulkEditResponse }>
- )._thenUnwrap((obj) => obj.result);
- }
-
- /**
- * Adds or updates a single IP-to-cloud-region mapping for the zone. Unlike POST,
- * this operation is idempotent — if a mapping for the IP already exists it is
- * overwritten. Returns the complete updated list of all mappings for the zone.
- * Returns 403 (code 1164) when the zone has reached the limit of 3,500 IP
- * mappings.
- *
- * @example
- * ```ts
- * const response = await client.cache.originCloudRegions.edit(
- * {
- * zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
- * ip: '2001:db8::1',
- * region: 'us-central1',
- * vendor: 'gcp',
- * },
- * );
- * ```
- */
- edit(
- params: OriginCloudRegionEditParams,
- options?: Core.RequestOptions,
- ): Core.APIPromise {
- const { zone_id, ...body } = params;
- return (
- this._client.patch(`/zones/${zone_id}/cache/origin_cloud_regions`, {
- body,
- ...options,
- }) as Core.APIPromise<{ result: OriginCloudRegionEditResponse }>
+ }) as Core.APIPromise<{ result: OriginCloudRegionBulkUpdateResponse }>
)._thenUnwrap((obj) => obj.result);
}
/**
* Returns the cloud region mapping for a single origin IP address. The IP path
- * parameter is normalized before lookup (RFC 5952 for IPv6). Returns 404
- * (code 1142) if the zone has no mappings or if the specified IP has no mapping.
+ * parameter is normalized before lookup (RFC 5952 for IPv6). Returns 404 if the
+ * zone has no mappings or if the specified IP has no mapping.
*
* @example
* ```ts
@@ -206,13 +185,12 @@ export class OriginCloudRegions extends APIResource {
originIP: string,
params: OriginCloudRegionGetParams,
options?: Core.RequestOptions,
- ): Core.APIPromise {
+ ): Core.APIPromise {
const { zone_id } = params;
return (
- this._client.get(
- `/zones/${zone_id}/cache/origin_cloud_regions/${originIP}`,
- options,
- ) as Core.APIPromise<{ result: OriginCloudRegionGetResponse }>
+ this._client.get(`/zones/${zone_id}/origin/cloud_regions/${originIP}`, options) as Core.APIPromise<{
+ result: OriginCloudRegion;
+ }>
)._thenUnwrap((obj) => obj.result);
}
@@ -237,21 +215,24 @@ export class OriginCloudRegions extends APIResource {
const { zone_id } = params;
return (
this._client.get(
- `/zones/${zone_id}/cache/origin_cloud_regions/supported_regions`,
+ `/zones/${zone_id}/origin/cloud_regions/supported_regions`,
options,
) as Core.APIPromise<{ result: OriginCloudRegionSupportedRegionsResponse }>
)._thenUnwrap((obj) => obj.result);
}
}
+export class OriginCloudRegionsV4PagePaginationArray extends V4PagePaginationArray {}
+
/**
* A single origin IP-to-cloud-region mapping.
*/
export interface OriginCloudRegion {
/**
- * The origin IP address (IPv4 or IPv6, canonicalized).
+ * The origin IP address (IPv4 or IPv6). Normalized to canonical form (RFC 5952 for
+ * IPv6).
*/
- 'origin-ip': string;
+ origin_ip: string;
/**
* Cloud vendor region identifier.
@@ -270,279 +251,155 @@ export interface OriginCloudRegion {
}
/**
- * Response result for a single origin cloud region mapping.
+ * Response result for a delete operation. Identifies the deleted mapping.
*/
-export interface OriginCloudRegionCreateResponse {
- id: 'origin_public_cloud_region';
-
- /**
- * Whether the setting can be modified by the current user.
- */
- editable: boolean;
-
- /**
- * A single origin IP-to-cloud-region mapping.
- */
- value: OriginCloudRegion;
-
+export interface OriginCloudRegionDeleteResponse {
/**
- * Time the mapping was last modified.
+ * The origin IP address whose mapping was deleted.
*/
- modified_on?: string;
+ origin_ip: string;
}
/**
- * Response result for a list of origin cloud region mappings.
+ * Response result for a batch origin cloud region operation.
*/
-export interface OriginCloudRegionListResponse {
- id: 'origin_public_cloud_region';
-
+export interface OriginCloudRegionBulkDeleteResponse {
/**
- * Whether the setting can be modified by the current user.
+ * Items that could not be applied, with error details.
*/
- editable: boolean;
-
- value: Array;
+ failed: Array;
/**
- * Time the mapping set was last modified. Null when no mappings exist.
+ * Items that were successfully applied.
*/
- modified_on?: string | null;
+ succeeded: Array;
}
-/**
- * Response result for a single origin cloud region mapping.
- */
-export interface OriginCloudRegionDeleteResponse {
- id: 'origin_public_cloud_region';
-
- /**
- * Whether the setting can be modified by the current user.
- */
- editable: boolean;
-
- /**
- * A single origin IP-to-cloud-region mapping.
- */
- value: OriginCloudRegion;
-
+export namespace OriginCloudRegionBulkDeleteResponse {
/**
- * Time the mapping was last modified.
+ * Result for a single item in a batch operation.
*/
- modified_on?: string;
-}
+ export interface Failed {
+ /**
+ * The origin IP address for this item.
+ */
+ origin_ip: string;
-/**
- * Response result for a batch origin cloud region operation.
- */
-export interface OriginCloudRegionBulkDeleteResponse {
- id: 'origin_public_cloud_region';
+ /**
+ * Error message explaining why the item failed. Present only on failed items.
+ */
+ error?: string;
- /**
- * Whether the setting can be modified by the current user.
- */
- editable: boolean;
+ /**
+ * Cloud vendor region identifier. Present on succeeded items (the new value for
+ * upsert, the deleted value for delete).
+ */
+ region?: string;
- value: OriginCloudRegionBulkDeleteResponse.Value;
+ /**
+ * Cloud vendor identifier. Present on succeeded items (the new value for upsert,
+ * the deleted value for delete).
+ */
+ vendor?: string;
+ }
/**
- * Time the mapping set was last modified. Null when no items were successfully
- * applied.
+ * Result for a single item in a batch operation.
*/
- modified_on?: string | null;
-}
-
-export namespace OriginCloudRegionBulkDeleteResponse {
- export interface Value {
+ export interface Succeeded {
/**
- * Items that could not be applied, with error details.
+ * The origin IP address for this item.
*/
- failed: Array;
+ origin_ip: string;
/**
- * Items that were successfully applied.
+ * Error message explaining why the item failed. Present only on failed items.
*/
- succeeded: Array;
- }
+ error?: string;
- export namespace Value {
/**
- * Result for a single item in a batch operation.
+ * Cloud vendor region identifier. Present on succeeded items (the new value for
+ * upsert, the deleted value for delete).
*/
- export interface Failed {
- /**
- * The origin IP address for this item.
- */
- 'origin-ip': string;
-
- /**
- * Error message explaining why the item failed. Present only on failed items.
- */
- error?: string;
-
- /**
- * Cloud vendor region identifier. Present on succeeded items for patch operations.
- */
- region?: string;
-
- /**
- * Cloud vendor identifier. Present on succeeded items for patch operations.
- */
- vendor?: string;
- }
+ region?: string;
/**
- * Result for a single item in a batch operation.
+ * Cloud vendor identifier. Present on succeeded items (the new value for upsert,
+ * the deleted value for delete).
*/
- export interface Succeeded {
- /**
- * The origin IP address for this item.
- */
- 'origin-ip': string;
-
- /**
- * Error message explaining why the item failed. Present only on failed items.
- */
- error?: string;
-
- /**
- * Cloud vendor region identifier. Present on succeeded items for patch operations.
- */
- region?: string;
-
- /**
- * Cloud vendor identifier. Present on succeeded items for patch operations.
- */
- vendor?: string;
- }
+ vendor?: string;
}
}
/**
* Response result for a batch origin cloud region operation.
*/
-export interface OriginCloudRegionBulkEditResponse {
- id: 'origin_public_cloud_region';
-
+export interface OriginCloudRegionBulkUpdateResponse {
/**
- * Whether the setting can be modified by the current user.
+ * Items that could not be applied, with error details.
*/
- editable: boolean;
-
- value: OriginCloudRegionBulkEditResponse.Value;
+ failed: Array;
/**
- * Time the mapping set was last modified. Null when no items were successfully
- * applied.
+ * Items that were successfully applied.
*/
- modified_on?: string | null;
+ succeeded: Array;
}
-export namespace OriginCloudRegionBulkEditResponse {
- export interface Value {
+export namespace OriginCloudRegionBulkUpdateResponse {
+ /**
+ * Result for a single item in a batch operation.
+ */
+ export interface Failed {
/**
- * Items that could not be applied, with error details.
+ * The origin IP address for this item.
*/
- failed: Array;
+ origin_ip: string;
/**
- * Items that were successfully applied.
+ * Error message explaining why the item failed. Present only on failed items.
*/
- succeeded: Array;
- }
+ error?: string;
- export namespace Value {
/**
- * Result for a single item in a batch operation.
+ * Cloud vendor region identifier. Present on succeeded items (the new value for
+ * upsert, the deleted value for delete).
*/
- export interface Failed {
- /**
- * The origin IP address for this item.
- */
- 'origin-ip': string;
-
- /**
- * Error message explaining why the item failed. Present only on failed items.
- */
- error?: string;
-
- /**
- * Cloud vendor region identifier. Present on succeeded items for patch operations.
- */
- region?: string;
-
- /**
- * Cloud vendor identifier. Present on succeeded items for patch operations.
- */
- vendor?: string;
- }
+ region?: string;
/**
- * Result for a single item in a batch operation.
+ * Cloud vendor identifier. Present on succeeded items (the new value for upsert,
+ * the deleted value for delete).
*/
- export interface Succeeded {
- /**
- * The origin IP address for this item.
- */
- 'origin-ip': string;
-
- /**
- * Error message explaining why the item failed. Present only on failed items.
- */
- error?: string;
-
- /**
- * Cloud vendor region identifier. Present on succeeded items for patch operations.
- */
- region?: string;
-
- /**
- * Cloud vendor identifier. Present on succeeded items for patch operations.
- */
- vendor?: string;
- }
+ vendor?: string;
}
-}
-
-/**
- * Response result for a list of origin cloud region mappings.
- */
-export interface OriginCloudRegionEditResponse {
- id: 'origin_public_cloud_region';
/**
- * Whether the setting can be modified by the current user.
+ * Result for a single item in a batch operation.
*/
- editable: boolean;
-
- value: Array;
-
- /**
- * Time the mapping set was last modified. Null when no mappings exist.
- */
- modified_on?: string | null;
-}
-
-/**
- * Response result for a single origin cloud region mapping.
- */
-export interface OriginCloudRegionGetResponse {
- id: 'origin_public_cloud_region';
+ export interface Succeeded {
+ /**
+ * The origin IP address for this item.
+ */
+ origin_ip: string;
- /**
- * Whether the setting can be modified by the current user.
- */
- editable: boolean;
+ /**
+ * Error message explaining why the item failed. Present only on failed items.
+ */
+ error?: string;
- /**
- * A single origin IP-to-cloud-region mapping.
- */
- value: OriginCloudRegion;
+ /**
+ * Cloud vendor region identifier. Present on succeeded items (the new value for
+ * upsert, the deleted value for delete).
+ */
+ region?: string;
- /**
- * Time the mapping was last modified.
- */
- modified_on?: string;
+ /**
+ * Cloud vendor identifier. Present on succeeded items (the new value for upsert,
+ * the deleted value for delete).
+ */
+ vendor?: string;
+ }
}
/**
@@ -582,17 +439,19 @@ export namespace OriginCloudRegionSupportedRegionsResponse {
}
}
-export interface OriginCloudRegionCreateParams {
+export interface OriginCloudRegionUpdateParams {
/**
* Path param: Identifier.
*/
zone_id: string;
/**
- * Body param: Origin IP address (IPv4 or IPv6). Normalized to canonical form
- * before storage (RFC 5952 for IPv6).
+ * Body param: Origin IP address (IPv4 or IPv6). For the single PUT endpoint
+ * (`PUT /origin/cloud_regions/{origin_ip}`), this field must match the path
+ * parameter or the request will be rejected with a 400 error. For the batch PUT
+ * endpoint, this field identifies which mapping to upsert.
*/
- ip: string;
+ origin_ip: string;
/**
* Body param: Cloud vendor region identifier. Must be a valid region for the
@@ -607,9 +466,9 @@ export interface OriginCloudRegionCreateParams {
vendor: 'aws' | 'azure' | 'gcp' | 'oci';
}
-export interface OriginCloudRegionListParams {
+export interface OriginCloudRegionListParams extends V4PagePaginationArrayParams {
/**
- * Identifier.
+ * Path param: Identifier.
*/
zone_id: string;
}
@@ -628,7 +487,7 @@ export interface OriginCloudRegionBulkDeleteParams {
zone_id: string;
}
-export interface OriginCloudRegionBulkEditParams {
+export interface OriginCloudRegionBulkUpdateParams {
/**
* Path param: Identifier.
*/
@@ -637,19 +496,21 @@ export interface OriginCloudRegionBulkEditParams {
/**
* Body param
*/
- body: Array;
+ body: Array;
}
-export namespace OriginCloudRegionBulkEditParams {
+export namespace OriginCloudRegionBulkUpdateParams {
/**
- * Request body for creating or updating an origin cloud region mapping.
+ * Request body for creating or replacing an origin cloud region mapping.
*/
export interface Body {
/**
- * Origin IP address (IPv4 or IPv6). Normalized to canonical form before storage
- * (RFC 5952 for IPv6).
+ * Origin IP address (IPv4 or IPv6). For the single PUT endpoint
+ * (`PUT /origin/cloud_regions/{origin_ip}`), this field must match the path
+ * parameter or the request will be rejected with a 400 error. For the batch PUT
+ * endpoint, this field identifies which mapping to upsert.
*/
- ip: string;
+ origin_ip: string;
/**
* Cloud vendor region identifier. Must be a valid region for the specified vendor
@@ -664,31 +525,6 @@ export namespace OriginCloudRegionBulkEditParams {
}
}
-export interface OriginCloudRegionEditParams {
- /**
- * Path param: Identifier.
- */
- zone_id: string;
-
- /**
- * Body param: Origin IP address (IPv4 or IPv6). Normalized to canonical form
- * before storage (RFC 5952 for IPv6).
- */
- ip: string;
-
- /**
- * Body param: Cloud vendor region identifier. Must be a valid region for the
- * specified vendor as returned by the supported_regions endpoint.
- */
- region: string;
-
- /**
- * Body param: Cloud vendor hosting the origin. Must be one of the supported
- * vendors.
- */
- vendor: 'aws' | 'azure' | 'gcp' | 'oci';
-}
-
export interface OriginCloudRegionGetParams {
/**
* Identifier.
@@ -703,23 +539,21 @@ export interface OriginCloudRegionSupportedRegionsParams {
zone_id: string;
}
+OriginCloudRegions.OriginCloudRegionsV4PagePaginationArray = OriginCloudRegionsV4PagePaginationArray;
+
export declare namespace OriginCloudRegions {
export {
type OriginCloudRegion as OriginCloudRegion,
- type OriginCloudRegionCreateResponse as OriginCloudRegionCreateResponse,
- type OriginCloudRegionListResponse as OriginCloudRegionListResponse,
type OriginCloudRegionDeleteResponse as OriginCloudRegionDeleteResponse,
type OriginCloudRegionBulkDeleteResponse as OriginCloudRegionBulkDeleteResponse,
- type OriginCloudRegionBulkEditResponse as OriginCloudRegionBulkEditResponse,
- type OriginCloudRegionEditResponse as OriginCloudRegionEditResponse,
- type OriginCloudRegionGetResponse as OriginCloudRegionGetResponse,
+ type OriginCloudRegionBulkUpdateResponse as OriginCloudRegionBulkUpdateResponse,
type OriginCloudRegionSupportedRegionsResponse as OriginCloudRegionSupportedRegionsResponse,
- type OriginCloudRegionCreateParams as OriginCloudRegionCreateParams,
+ OriginCloudRegionsV4PagePaginationArray as OriginCloudRegionsV4PagePaginationArray,
+ type OriginCloudRegionUpdateParams as OriginCloudRegionUpdateParams,
type OriginCloudRegionListParams as OriginCloudRegionListParams,
type OriginCloudRegionDeleteParams as OriginCloudRegionDeleteParams,
type OriginCloudRegionBulkDeleteParams as OriginCloudRegionBulkDeleteParams,
- type OriginCloudRegionBulkEditParams as OriginCloudRegionBulkEditParams,
- type OriginCloudRegionEditParams as OriginCloudRegionEditParams,
+ type OriginCloudRegionBulkUpdateParams as OriginCloudRegionBulkUpdateParams,
type OriginCloudRegionGetParams as OriginCloudRegionGetParams,
type OriginCloudRegionSupportedRegionsParams as OriginCloudRegionSupportedRegionsParams,
};
diff --git a/tests/api-resources/cache/origin-cloud-regions.test.ts b/tests/api-resources/cache/origin-cloud-regions.test.ts
index b6fdffa650..4e9739877b 100644
--- a/tests/api-resources/cache/origin-cloud-regions.test.ts
+++ b/tests/api-resources/cache/origin-cloud-regions.test.ts
@@ -10,10 +10,10 @@ const client = new Cloudflare({
});
describe('resource originCloudRegions', () => {
- test('create: only required params', async () => {
- const responsePromise = client.cache.originCloudRegions.create({
+ test('update: only required params', async () => {
+ const responsePromise = client.cache.originCloudRegions.update('192.0.2.1', {
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
- ip: '192.0.2.1',
+ origin_ip: '192.0.2.1',
region: 'us-east-1',
vendor: 'aws',
});
@@ -26,10 +26,10 @@ describe('resource originCloudRegions', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});
- test('create: required and optional params', async () => {
- const response = await client.cache.originCloudRegions.create({
+ test('update: required and optional params', async () => {
+ const response = await client.cache.originCloudRegions.update('192.0.2.1', {
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
- ip: '192.0.2.1',
+ origin_ip: '192.0.2.1',
region: 'us-east-1',
vendor: 'aws',
});
@@ -51,6 +51,8 @@ describe('resource originCloudRegions', () => {
test('list: required and optional params', async () => {
const response = await client.cache.originCloudRegions.list({
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
+ page: 1,
+ per_page: 1,
});
});
@@ -92,17 +94,17 @@ describe('resource originCloudRegions', () => {
});
});
- test('bulkEdit: only required params', async () => {
- const responsePromise = client.cache.originCloudRegions.bulkEdit({
+ test('bulkUpdate: only required params', async () => {
+ const responsePromise = client.cache.originCloudRegions.bulkUpdate({
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
body: [
{
- ip: '192.0.2.1',
+ origin_ip: '192.0.2.1',
region: 'us-east-1',
vendor: 'aws',
},
{
- ip: '2001:db8::1',
+ origin_ip: '2001:db8::1',
region: 'us-central1',
vendor: 'gcp',
},
@@ -117,17 +119,17 @@ describe('resource originCloudRegions', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});
- test('bulkEdit: required and optional params', async () => {
- const response = await client.cache.originCloudRegions.bulkEdit({
+ test('bulkUpdate: required and optional params', async () => {
+ const response = await client.cache.originCloudRegions.bulkUpdate({
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
body: [
{
- ip: '192.0.2.1',
+ origin_ip: '192.0.2.1',
region: 'us-east-1',
vendor: 'aws',
},
{
- ip: '2001:db8::1',
+ origin_ip: '2001:db8::1',
region: 'us-central1',
vendor: 'gcp',
},
@@ -135,31 +137,6 @@ describe('resource originCloudRegions', () => {
});
});
- test('edit: only required params', async () => {
- const responsePromise = client.cache.originCloudRegions.edit({
- zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
- ip: '2001:db8::1',
- region: 'us-central1',
- vendor: 'gcp',
- });
- 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);
- });
-
- test('edit: required and optional params', async () => {
- const response = await client.cache.originCloudRegions.edit({
- zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
- ip: '2001:db8::1',
- region: 'us-central1',
- vendor: 'gcp',
- });
- });
-
test('get: only required params', async () => {
const responsePromise = client.cache.originCloudRegions.get('192.0.2.1', {
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
From 2704fcdfc250a227d8bc17406f1289d4a54e43b5 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 5 May 2026 16:30:26 +0000
Subject: [PATCH 06/73] chore(api): update composite API spec
---
.stats.yml | 2 +-
src/resources/resource-sharing/resource-sharing.ts | 8 ++++++++
.../resource-sharing/resource-sharing.test.ts | 1 +
3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index 0d7a1867ad..95721e9a13 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 2204
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
-openapi_spec_hash: 42dd4ac0ac3f5c00bbe80e26fed2fa51
+openapi_spec_hash: 1cb07cbc59f51be4843f63ea4357d7f2
config_hash: 0c33107d28fc9d1d5726d8ac8459421a
diff --git a/src/resources/resource-sharing/resource-sharing.ts b/src/resources/resource-sharing/resource-sharing.ts
index f6691eadcf..54d64a6227 100644
--- a/src/resources/resource-sharing/resource-sharing.ts
+++ b/src/resources/resource-sharing/resource-sharing.ts
@@ -938,6 +938,14 @@ export interface ResourceSharingListParams extends V4PagePaginationArrayParams {
*/
status?: 'active' | 'deleting' | 'deleted';
+ /**
+ * Query param: Filter shares by tag. Each value is either `key=value` (matches
+ * shares whose tags contain that key/value pair) or `key` alone (matches shares
+ * that have any value for that key). May be repeated; multiple `tag` parameters
+ * are ANDed together. Maximum 20 `tag` parameters per request.
+ */
+ tag?: Array;
+
/**
* Query param: Filter shares by target_type.
*/
diff --git a/tests/api-resources/resource-sharing/resource-sharing.test.ts b/tests/api-resources/resource-sharing/resource-sharing.test.ts
index f295e59b82..79d0cc8d72 100644
--- a/tests/api-resources/resource-sharing/resource-sharing.test.ts
+++ b/tests/api-resources/resource-sharing/resource-sharing.test.ts
@@ -98,6 +98,7 @@ describe('resource resourceSharing', () => {
per_page: 20,
resource_types: ['custom-ruleset'],
status: 'active',
+ tag: ['env=production'],
target_type: 'account',
});
});
From a25246e8d3e6dc4d2fef99efbe0ecb3a84a15165 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 5 May 2026 17:08:48 +0000
Subject: [PATCH 07/73] chore(api): update composite API spec
---
.stats.yml | 2 +-
src/resources/user/user.ts | 14 ++++++++++++--
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 95721e9a13..c8c80a20fe 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 2204
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
-openapi_spec_hash: 1cb07cbc59f51be4843f63ea4357d7f2
+openapi_spec_hash: 43b3282cc17b94e7729c724d6a3c67ae
config_hash: 0c33107d28fc9d1d5726d8ac8459421a
diff --git a/src/resources/user/user.ts b/src/resources/user/user.ts
index 836bf78b22..cc3e67bba2 100644
--- a/src/resources/user/user.ts
+++ b/src/resources/user/user.ts
@@ -76,7 +76,12 @@ export interface UserEditResponse {
/**
* Identifier of the user.
*/
- id?: string;
+ id: string;
+
+ /**
+ * Current email address of the user.
+ */
+ email: string;
/**
* Lists the betas that the user is participating in.
@@ -147,7 +152,12 @@ export interface UserGetResponse {
/**
* Identifier of the user.
*/
- id?: string;
+ id: string;
+
+ /**
+ * Current email address of the user.
+ */
+ email: string;
/**
* Lists the betas that the user is participating in.
From dfc4b172fd218a4a85acf8218fec12ad6cca6711 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 5 May 2026 21:21:32 +0000
Subject: [PATCH 08/73] feat: feat(cache): add create (POST) method for
smart_tiered_cache
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* feat(cache): add create (POST) method for smart_tiered_cache
Add the missing create method to smart_tiered_cache subresource.
The POST endpoint for tiered_cache_smart_topology_enable was already
in the api-gateway but missing from the Stainless config.
Removes the internal-only endpoints (cache_limit_rate,
cache_reserve_jurisdiction, class_of_service) from the original
APIX-592 MR — these have no api-gateway routes and are not
customer-facing.
Closes CACHE-13445
---
.stats.yml | 4 +-
src/resources/cache/api.md | 2 +
src/resources/cache/cache.ts | 4 ++
src/resources/cache/index.ts | 2 +
src/resources/cache/smart-tiered-cache.ts | 66 +++++++++++++++++++
.../cache/smart-tiered-cache.test.ts | 21 ++++++
6 files changed, 97 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index c8c80a20fe..5be486d5dd 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 2204
+configured_endpoints: 2205
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
openapi_spec_hash: 43b3282cc17b94e7729c724d6a3c67ae
-config_hash: 0c33107d28fc9d1d5726d8ac8459421a
+config_hash: 25d6458459b0af390a57abd94fb34218
diff --git a/src/resources/cache/api.md b/src/resources/cache/api.md
index 2887704bcc..14e19f79a7 100644
--- a/src/resources/cache/api.md
+++ b/src/resources/cache/api.md
@@ -31,12 +31,14 @@ Methods:
Types:
+- SmartTieredCacheCreateResponse
- SmartTieredCacheDeleteResponse
- SmartTieredCacheEditResponse
- SmartTieredCacheGetResponse
Methods:
+- client.cache.smartTieredCache.create({ ...params }) -> SmartTieredCacheCreateResponse
- client.cache.smartTieredCache.delete({ ...params }) -> SmartTieredCacheDeleteResponse
- client.cache.smartTieredCache.edit({ ...params }) -> SmartTieredCacheEditResponse
- client.cache.smartTieredCache.get({ ...params }) -> SmartTieredCacheGetResponse
diff --git a/src/resources/cache/cache.ts b/src/resources/cache/cache.ts
index 78109bfc0b..9b81afbac2 100644
--- a/src/resources/cache/cache.ts
+++ b/src/resources/cache/cache.ts
@@ -46,6 +46,8 @@ import {
import * as SmartTieredCacheAPI from './smart-tiered-cache';
import {
SmartTieredCache,
+ SmartTieredCacheCreateParams,
+ SmartTieredCacheCreateResponse,
SmartTieredCacheDeleteParams,
SmartTieredCacheDeleteResponse,
SmartTieredCacheEditParams,
@@ -286,9 +288,11 @@ export declare namespace Cache {
export {
SmartTieredCache as SmartTieredCache,
+ type SmartTieredCacheCreateResponse as SmartTieredCacheCreateResponse,
type SmartTieredCacheDeleteResponse as SmartTieredCacheDeleteResponse,
type SmartTieredCacheEditResponse as SmartTieredCacheEditResponse,
type SmartTieredCacheGetResponse as SmartTieredCacheGetResponse,
+ type SmartTieredCacheCreateParams as SmartTieredCacheCreateParams,
type SmartTieredCacheDeleteParams as SmartTieredCacheDeleteParams,
type SmartTieredCacheEditParams as SmartTieredCacheEditParams,
type SmartTieredCacheGetParams as SmartTieredCacheGetParams,
diff --git a/src/resources/cache/index.ts b/src/resources/cache/index.ts
index f10ef06193..adb610c246 100644
--- a/src/resources/cache/index.ts
+++ b/src/resources/cache/index.ts
@@ -41,9 +41,11 @@ export {
} from './regional-tiered-cache';
export {
SmartTieredCache,
+ type SmartTieredCacheCreateResponse,
type SmartTieredCacheDeleteResponse,
type SmartTieredCacheEditResponse,
type SmartTieredCacheGetResponse,
+ type SmartTieredCacheCreateParams,
type SmartTieredCacheDeleteParams,
type SmartTieredCacheEditParams,
type SmartTieredCacheGetParams,
diff --git a/src/resources/cache/smart-tiered-cache.ts b/src/resources/cache/smart-tiered-cache.ts
index 0acc9f466a..b445aaad66 100644
--- a/src/resources/cache/smart-tiered-cache.ts
+++ b/src/resources/cache/smart-tiered-cache.ts
@@ -4,6 +4,36 @@ import { APIResource } from '../../resource';
import * as Core from '../../core';
export class SmartTieredCache extends APIResource {
+ /**
+ * Smart Tiered Cache dynamically selects the single closest upper tier for each of
+ * your website's origins with no configuration required, using our in-house
+ * performance and routing data. Cloudflare collects latency data for each request
+ * to an origin, and uses the latency data to determine how well any upper-tier
+ * data center is connected with an origin. As a result, Cloudflare can select the
+ * data center with the lowest latency to be the upper-tier for an origin.
+ *
+ * @example
+ * ```ts
+ * const smartTieredCache =
+ * await client.cache.smartTieredCache.create({
+ * zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
+ * value: 'on',
+ * });
+ * ```
+ */
+ create(
+ params: SmartTieredCacheCreateParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ const { zone_id, ...body } = params;
+ return (
+ this._client.post(`/zones/${zone_id}/cache/tiered_cache_smart_topology_enable`, {
+ body,
+ ...options,
+ }) as Core.APIPromise<{ result: SmartTieredCacheCreateResponse }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+
/**
* Smart Tiered Cache dynamically selects the single closest upper tier for each of
* your website’s origins with no configuration required, using our in-house
@@ -92,6 +122,28 @@ export class SmartTieredCache extends APIResource {
}
}
+export interface SmartTieredCacheCreateResponse {
+ /**
+ * The identifier of the caching setting.
+ */
+ id: 'tiered_cache_smart_topology_enable';
+
+ /**
+ * Whether the setting is editable.
+ */
+ editable: boolean;
+
+ /**
+ * Value of the Smart Tiered Cache zone setting.
+ */
+ value: 'on' | 'off';
+
+ /**
+ * Last time this setting was modified.
+ */
+ modified_on?: string | null;
+}
+
export interface SmartTieredCacheDeleteResponse {
/**
* The identifier of the caching setting.
@@ -153,6 +205,18 @@ export interface SmartTieredCacheGetResponse {
modified_on?: string | null;
}
+export interface SmartTieredCacheCreateParams {
+ /**
+ * Path param: Identifier.
+ */
+ zone_id: string;
+
+ /**
+ * Body param: Enable or disable the Smart Tiered Cache.
+ */
+ value: 'on' | 'off';
+}
+
export interface SmartTieredCacheDeleteParams {
/**
* Identifier.
@@ -181,9 +245,11 @@ export interface SmartTieredCacheGetParams {
export declare namespace SmartTieredCache {
export {
+ type SmartTieredCacheCreateResponse as SmartTieredCacheCreateResponse,
type SmartTieredCacheDeleteResponse as SmartTieredCacheDeleteResponse,
type SmartTieredCacheEditResponse as SmartTieredCacheEditResponse,
type SmartTieredCacheGetResponse as SmartTieredCacheGetResponse,
+ type SmartTieredCacheCreateParams as SmartTieredCacheCreateParams,
type SmartTieredCacheDeleteParams as SmartTieredCacheDeleteParams,
type SmartTieredCacheEditParams as SmartTieredCacheEditParams,
type SmartTieredCacheGetParams as SmartTieredCacheGetParams,
diff --git a/tests/api-resources/cache/smart-tiered-cache.test.ts b/tests/api-resources/cache/smart-tiered-cache.test.ts
index b1409dc28a..df25a0d0cd 100644
--- a/tests/api-resources/cache/smart-tiered-cache.test.ts
+++ b/tests/api-resources/cache/smart-tiered-cache.test.ts
@@ -10,6 +10,27 @@ const client = new Cloudflare({
});
describe('resource smartTieredCache', () => {
+ test('create: only required params', async () => {
+ const responsePromise = client.cache.smartTieredCache.create({
+ zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
+ value: 'on',
+ });
+ 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);
+ });
+
+ test('create: required and optional params', async () => {
+ const response = await client.cache.smartTieredCache.create({
+ zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
+ value: 'on',
+ });
+ });
+
test('delete: only required params', async () => {
const responsePromise = client.cache.smartTieredCache.delete({
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
From 4dc290b7251ae7101d5b3306436dd43ad6666a7b Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 5 May 2026 21:31:25 +0000
Subject: [PATCH 09/73] codegen metadata
---
.stats.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index 5be486d5dd..f58eeaf15c 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 2205
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
openapi_spec_hash: 43b3282cc17b94e7729c724d6a3c67ae
-config_hash: 25d6458459b0af390a57abd94fb34218
+config_hash: 738e0c7378ea7821d530b044c332db9e
From 987ce04936267bb3df4d4fc03c26a101339cb190 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 5 May 2026 21:39:29 +0000
Subject: [PATCH 10/73] feat: feat(radar): add BGP RPKI ROAs timeseries and BGP
IPs top ASes endpoints
* feat(radar): add BGP RPKI ROAs timeseries and BGP IPs top ASes endpoints
- Add /radar/bgp/rpki/roas/timeseries
- Add /radar/bgp/ips/top/ases
RADAR-7051
---
.stats.yml | 4 +-
scripts/detect-breaking-changes | 4 +-
src/resources/radar/api.md | 24 +-
src/resources/radar/bgp/bgp.ts | 4 +-
src/resources/radar/bgp/index.ts | 2 +-
src/resources/radar/bgp/ips.ts | 286 +----------------
src/resources/radar/bgp/ips/index.ts | 4 +
src/resources/radar/bgp/ips/ips.ts | 295 ++++++++++++++++++
src/resources/radar/bgp/ips/top.ts | 84 +++++
src/resources/radar/bgp/rpki/index.ts | 1 +
src/resources/radar/bgp/rpki/roas.ts | 120 +++++++
src/resources/radar/bgp/rpki/rpki.ts | 10 +
.../radar/bgp/{ => ips}/ips.test.ts | 0
tests/api-resources/radar/bgp/ips/top.test.ts | 46 +++
.../api-resources/radar/bgp/rpki/roas.test.ts | 48 +++
15 files changed, 639 insertions(+), 293 deletions(-)
create mode 100644 src/resources/radar/bgp/ips/index.ts
create mode 100644 src/resources/radar/bgp/ips/ips.ts
create mode 100644 src/resources/radar/bgp/ips/top.ts
create mode 100644 src/resources/radar/bgp/rpki/roas.ts
rename tests/api-resources/radar/bgp/{ => ips}/ips.test.ts (100%)
create mode 100644 tests/api-resources/radar/bgp/ips/top.test.ts
create mode 100644 tests/api-resources/radar/bgp/rpki/roas.test.ts
diff --git a/.stats.yml b/.stats.yml
index f58eeaf15c..abff5e52b7 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 2205
+configured_endpoints: 2207
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
openapi_spec_hash: 43b3282cc17b94e7729c724d6a3c67ae
-config_hash: 738e0c7378ea7821d530b044c332db9e
+config_hash: 82bd9683d33d942855962bb7dc595067
diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes
index 0a0c791c75..2c9955e3e1 100755
--- a/scripts/detect-breaking-changes
+++ b/scripts/detect-breaking-changes
@@ -627,9 +627,11 @@ TEST_PATHS=(
tests/api-resources/radar/bgp/hijacks/hijacks.test.ts
tests/api-resources/radar/bgp/hijacks/events.test.ts
tests/api-resources/radar/bgp/routes.test.ts
- tests/api-resources/radar/bgp/ips.test.ts
+ tests/api-resources/radar/bgp/ips/ips.test.ts
+ tests/api-resources/radar/bgp/ips/top.test.ts
tests/api-resources/radar/bgp/rpki/rpki.test.ts
tests/api-resources/radar/bgp/rpki/aspa.test.ts
+ tests/api-resources/radar/bgp/rpki/roas.test.ts
tests/api-resources/radar/bots/bots.test.ts
tests/api-resources/radar/bots/web-crawlers.test.ts
tests/api-resources/radar/datasets.test.ts
diff --git a/src/resources/radar/api.md b/src/resources/radar/api.md
index 45c83dd511..495cf7521d 100644
--- a/src/resources/radar/api.md
+++ b/src/resources/radar/api.md
@@ -250,11 +250,21 @@ Methods:
Types:
-- IPTimeseriesResponse
+- IPTimeseriesResponse
Methods:
-- client.radar.bgp.ips.timeseries({ ...params }) -> IPTimeseriesResponse
+- client.radar.bgp.ips.timeseries({ ...params }) -> IPTimeseriesResponse
+
+#### Top
+
+Types:
+
+- TopAsesResponse
+
+Methods:
+
+- client.radar.bgp.ips.top.ases({ ...params }) -> TopAsesResponse
### RPKI
@@ -272,6 +282,16 @@ Methods:
- client.radar.bgp.rpki.aspa.snapshot({ ...params }) -> ASPASnapshotResponse
- client.radar.bgp.rpki.aspa.timeseries({ ...params }) -> ASPATimeseriesResponse
+#### Roas
+
+Types:
+
+- RoaTimeseriesResponse
+
+Methods:
+
+- client.radar.bgp.rpki.roas.timeseries({ ...params }) -> RoaTimeseriesResponse
+
## Bots
Types:
diff --git a/src/resources/radar/bgp/bgp.ts b/src/resources/radar/bgp/bgp.ts
index 4166d818fb..63edf9133f 100644
--- a/src/resources/radar/bgp/bgp.ts
+++ b/src/resources/radar/bgp/bgp.ts
@@ -3,8 +3,6 @@
import { APIResource } from '../../../resource';
import { isRequestOptions } from '../../../core';
import * as Core from '../../../core';
-import * as IPsAPI from './ips';
-import { IPTimeseriesParams, IPTimeseriesResponse, IPs } from './ips';
import * as RoutesAPI from './routes';
import {
RouteAsesParams,
@@ -21,6 +19,8 @@ import {
} from './routes';
import * as HijacksAPI from './hijacks/hijacks';
import { Hijacks } from './hijacks/hijacks';
+import * as IPsAPI from './ips/ips';
+import { IPTimeseriesParams, IPTimeseriesResponse, IPs } from './ips/ips';
import * as LeaksAPI from './leaks/leaks';
import { Leaks } from './leaks/leaks';
import * as RPKIAPI from './rpki/rpki';
diff --git a/src/resources/radar/bgp/index.ts b/src/resources/radar/bgp/index.ts
index ba86e6033a..e958cefdc0 100644
--- a/src/resources/radar/bgp/index.ts
+++ b/src/resources/radar/bgp/index.ts
@@ -2,7 +2,7 @@
export { BGP, type BGPTimeseriesResponse, type BGPTimeseriesParams } from './bgp';
export { Hijacks } from './hijacks/index';
-export { IPs, type IPTimeseriesResponse, type IPTimeseriesParams } from './ips';
+export { IPs, type IPTimeseriesResponse, type IPTimeseriesParams } from './ips/index';
export { Leaks } from './leaks/index';
export { RPKI } from './rpki/index';
export {
diff --git a/src/resources/radar/bgp/ips.ts b/src/resources/radar/bgp/ips.ts
index 9146957338..33d0c49764 100644
--- a/src/resources/radar/bgp/ips.ts
+++ b/src/resources/radar/bgp/ips.ts
@@ -1,287 +1,3 @@
// 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 IPs extends APIResource {
- /**
- * Retrieves time series data for the announced IP space count, represented as the
- * number of IPv4 /24s and IPv6 /48s, for a given ASN.
- *
- * @example
- * ```ts
- * const response = await client.radar.bgp.ips.timeseries();
- * ```
- */
- timeseries(
- query?: IPTimeseriesParams,
- options?: Core.RequestOptions,
- ): Core.APIPromise;
- timeseries(options?: Core.RequestOptions): Core.APIPromise;
- timeseries(
- query: IPTimeseriesParams | Core.RequestOptions = {},
- options?: Core.RequestOptions,
- ): Core.APIPromise {
- if (isRequestOptions(query)) {
- return this.timeseries({}, query);
- }
- return (
- this._client.get('/radar/bgp/ips/timeseries', { query, ...options }) as Core.APIPromise<{
- result: IPTimeseriesResponse;
- }>
- )._thenUnwrap((obj) => obj.result);
- }
-}
-
-export interface IPTimeseriesResponse {
- /**
- * Metadata for the results.
- */
- meta: IPTimeseriesResponse.Meta;
-
- serie_0: IPTimeseriesResponse.Serie0;
-}
-
-export namespace IPTimeseriesResponse {
- /**
- * Metadata for the results.
- */
- export interface Meta {
- /**
- * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals).
- * Refer to
- * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- */
- aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH';
-
- confidenceInfo: Meta.ConfidenceInfo;
-
- dateRange: Array;
-
- /**
- * Timestamp of the last dataset update.
- */
- lastUpdated: string;
-
- /**
- * Normalization method applied to the results. Refer to
- * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
- */
- normalization:
- | 'PERCENTAGE'
- | 'MIN0_MAX'
- | 'MIN_MAX'
- | 'RAW_VALUES'
- | 'PERCENTAGE_CHANGE'
- | 'ROLLING_AVERAGE'
- | 'OVERLAPPED_PERCENTAGE'
- | 'RATIO';
-
- /**
- * Measurement units for the results.
- */
- units: Array;
-
- delay?: Meta.Delay;
- }
-
- export namespace Meta {
- export interface ConfidenceInfo {
- annotations: Array;
-
- /**
- * Provides an indication of how much confidence Cloudflare has in the data.
- */
- level: number;
- }
-
- export namespace ConfidenceInfo {
- /**
- * Annotation associated with the result (e.g. outage or other type of event).
- */
- export interface Annotation {
- /**
- * Data source for annotations.
- */
- dataSource:
- | 'ALL'
- | 'AI_BOTS'
- | 'AI_GATEWAY'
- | 'BGP'
- | 'BOTS'
- | 'CONNECTION_ANOMALY'
- | 'CT'
- | 'DNS'
- | 'DNS_MAGNITUDE'
- | 'DNS_AS112'
- | 'DOS'
- | 'EMAIL_ROUTING'
- | 'EMAIL_SECURITY'
- | 'FW'
- | 'FW_PG'
- | 'HTTP'
- | 'HTTP_CONTROL'
- | 'HTTP_CRAWLER_REFERER'
- | 'HTTP_ORIGINS'
- | 'IQI'
- | 'LEAKED_CREDENTIALS'
- | 'NET'
- | 'ROBOTS_TXT'
- | 'SPEED'
- | 'WORKERS_AI';
-
- description: string;
-
- endDate: string;
-
- /**
- * Event type for annotations.
- */
- eventType: 'EVENT' | 'GENERAL' | 'OUTAGE' | 'PARTIAL_PROJECTION' | 'PIPELINE' | 'TRAFFIC_ANOMALY';
-
- /**
- * Whether event is a single point in time or a time range.
- */
- isInstantaneous: boolean;
-
- linkedUrl: string;
-
- startDate: string;
- }
- }
-
- export interface DateRange {
- /**
- * Adjusted end of date range.
- */
- endTime: string;
-
- /**
- * Adjusted start of date range.
- */
- startTime: string;
- }
-
- export interface Unit {
- name: string;
-
- value: string;
- }
-
- export interface Delay {
- asn_data: Delay.ASNData;
-
- country_data: Delay.CountryData;
-
- healthy: boolean;
-
- nowTs: number;
- }
-
- export namespace Delay {
- export interface ASNData {
- delaySecs: number;
-
- delayStr: string;
-
- healthy: boolean;
-
- latest: ASNData.Latest;
- }
-
- export namespace ASNData {
- export interface Latest {
- entries_count: number;
-
- path: string;
-
- timestamp: number;
- }
- }
-
- export interface CountryData {
- delaySecs: number;
-
- delayStr: string;
-
- healthy: boolean;
-
- latest: CountryData.Latest;
- }
-
- export namespace CountryData {
- export interface Latest {
- count: number;
-
- timestamp: number;
- }
- }
- }
- }
-
- export interface Serie0 {
- ipv4: Array;
-
- ipv6: Array;
-
- timestamps: Array;
- }
-}
-
-export interface IPTimeseriesParams {
- /**
- * Filters results by Autonomous System. Specify one or more Autonomous System
- * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs 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;
-
- /**
- * Filters results by 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;
-
- /**
- * Format in which results will be returned.
- */
- format?: 'JSON' | 'CSV';
-
- /**
- * Includes data delay meta information.
- */
- includeDelay?: boolean;
-
- /**
- * Filters results by IP version (Ipv4 vs. IPv6).
- */
- ipVersion?: Array<'IPv4' | 'IPv6'>;
-
- /**
- * Filters results by location. Specify a comma-separated list of alpha-2 location
- * codes.
- */
- location?: Array;
-
- /**
- * Array of names used to label the series in the response.
- */
- name?: Array;
-}
-
-export declare namespace IPs {
- export { type IPTimeseriesResponse as IPTimeseriesResponse, type IPTimeseriesParams as IPTimeseriesParams };
-}
+export * from './ips/index';
diff --git a/src/resources/radar/bgp/ips/index.ts b/src/resources/radar/bgp/ips/index.ts
new file mode 100644
index 0000000000..b8ca47dbc8
--- /dev/null
+++ b/src/resources/radar/bgp/ips/index.ts
@@ -0,0 +1,4 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+export { IPs, type IPTimeseriesResponse, type IPTimeseriesParams } from './ips';
+export { Top, type TopAsesResponse, type TopAsesParams } from './top';
diff --git a/src/resources/radar/bgp/ips/ips.ts b/src/resources/radar/bgp/ips/ips.ts
new file mode 100644
index 0000000000..954d5a4b4b
--- /dev/null
+++ b/src/resources/radar/bgp/ips/ips.ts
@@ -0,0 +1,295 @@
+// 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';
+import * as TopAPI from './top';
+import { Top, TopAsesParams, TopAsesResponse } from './top';
+
+export class IPs extends APIResource {
+ top: TopAPI.Top = new TopAPI.Top(this._client);
+
+ /**
+ * Retrieves time series data for the announced IP space count, represented as the
+ * number of IPv4 /24s and IPv6 /48s, for a given ASN.
+ *
+ * @example
+ * ```ts
+ * const response = await client.radar.bgp.ips.timeseries();
+ * ```
+ */
+ timeseries(
+ query?: IPTimeseriesParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise;
+ timeseries(options?: Core.RequestOptions): Core.APIPromise;
+ timeseries(
+ query: IPTimeseriesParams | Core.RequestOptions = {},
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ if (isRequestOptions(query)) {
+ return this.timeseries({}, query);
+ }
+ return (
+ this._client.get('/radar/bgp/ips/timeseries', { query, ...options }) as Core.APIPromise<{
+ result: IPTimeseriesResponse;
+ }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+}
+
+export interface IPTimeseriesResponse {
+ /**
+ * Metadata for the results.
+ */
+ meta: IPTimeseriesResponse.Meta;
+
+ serie_0: IPTimeseriesResponse.Serie0;
+}
+
+export namespace IPTimeseriesResponse {
+ /**
+ * Metadata for the results.
+ */
+ export interface Meta {
+ /**
+ * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals).
+ * Refer to
+ * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ */
+ aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH';
+
+ confidenceInfo: Meta.ConfidenceInfo;
+
+ dateRange: Array;
+
+ /**
+ * Timestamp of the last dataset update.
+ */
+ lastUpdated: string;
+
+ /**
+ * Normalization method applied to the results. Refer to
+ * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
+ */
+ normalization:
+ | 'PERCENTAGE'
+ | 'MIN0_MAX'
+ | 'MIN_MAX'
+ | 'RAW_VALUES'
+ | 'PERCENTAGE_CHANGE'
+ | 'ROLLING_AVERAGE'
+ | 'OVERLAPPED_PERCENTAGE'
+ | 'RATIO';
+
+ /**
+ * Measurement units for the results.
+ */
+ units: Array;
+
+ delay?: Meta.Delay;
+ }
+
+ export namespace Meta {
+ export interface ConfidenceInfo {
+ annotations: Array;
+
+ /**
+ * Provides an indication of how much confidence Cloudflare has in the data.
+ */
+ level: number;
+ }
+
+ export namespace ConfidenceInfo {
+ /**
+ * Annotation associated with the result (e.g. outage or other type of event).
+ */
+ export interface Annotation {
+ /**
+ * Data source for annotations.
+ */
+ dataSource:
+ | 'ALL'
+ | 'AI_BOTS'
+ | 'AI_GATEWAY'
+ | 'BGP'
+ | 'BOTS'
+ | 'CONNECTION_ANOMALY'
+ | 'CT'
+ | 'DNS'
+ | 'DNS_MAGNITUDE'
+ | 'DNS_AS112'
+ | 'DOS'
+ | 'EMAIL_ROUTING'
+ | 'EMAIL_SECURITY'
+ | 'FW'
+ | 'FW_PG'
+ | 'HTTP'
+ | 'HTTP_CONTROL'
+ | 'HTTP_CRAWLER_REFERER'
+ | 'HTTP_ORIGINS'
+ | 'IQI'
+ | 'LEAKED_CREDENTIALS'
+ | 'NET'
+ | 'ROBOTS_TXT'
+ | 'SPEED'
+ | 'WORKERS_AI';
+
+ description: string;
+
+ endDate: string;
+
+ /**
+ * Event type for annotations.
+ */
+ eventType: 'EVENT' | 'GENERAL' | 'OUTAGE' | 'PARTIAL_PROJECTION' | 'PIPELINE' | 'TRAFFIC_ANOMALY';
+
+ /**
+ * Whether event is a single point in time or a time range.
+ */
+ isInstantaneous: boolean;
+
+ linkedUrl: string;
+
+ startDate: string;
+ }
+ }
+
+ export interface DateRange {
+ /**
+ * Adjusted end of date range.
+ */
+ endTime: string;
+
+ /**
+ * Adjusted start of date range.
+ */
+ startTime: string;
+ }
+
+ export interface Unit {
+ name: string;
+
+ value: string;
+ }
+
+ export interface Delay {
+ asn_data: Delay.ASNData;
+
+ country_data: Delay.CountryData;
+
+ healthy: boolean;
+
+ nowTs: number;
+ }
+
+ export namespace Delay {
+ export interface ASNData {
+ delaySecs: number;
+
+ delayStr: string;
+
+ healthy: boolean;
+
+ latest: ASNData.Latest;
+ }
+
+ export namespace ASNData {
+ export interface Latest {
+ entries_count: number;
+
+ path: string;
+
+ timestamp: number;
+ }
+ }
+
+ export interface CountryData {
+ delaySecs: number;
+
+ delayStr: string;
+
+ healthy: boolean;
+
+ latest: CountryData.Latest;
+ }
+
+ export namespace CountryData {
+ export interface Latest {
+ count: number;
+
+ timestamp: number;
+ }
+ }
+ }
+ }
+
+ export interface Serie0 {
+ ipv4: Array;
+
+ ipv6: Array;
+
+ timestamps: Array;
+ }
+}
+
+export interface IPTimeseriesParams {
+ /**
+ * Filters results by Autonomous System. Specify one or more Autonomous System
+ * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs 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;
+
+ /**
+ * Filters results by 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;
+
+ /**
+ * Format in which results will be returned.
+ */
+ format?: 'JSON' | 'CSV';
+
+ /**
+ * Includes data delay meta information.
+ */
+ includeDelay?: boolean;
+
+ /**
+ * Filters results by IP version (Ipv4 vs. IPv6).
+ */
+ ipVersion?: Array<'IPv4' | 'IPv6'>;
+
+ /**
+ * Filters results by location. Specify a comma-separated list of alpha-2 location
+ * codes.
+ */
+ location?: Array;
+
+ /**
+ * Array of names used to label the series in the response.
+ */
+ name?: Array;
+}
+
+IPs.Top = Top;
+
+export declare namespace IPs {
+ export { type IPTimeseriesResponse as IPTimeseriesResponse, type IPTimeseriesParams as IPTimeseriesParams };
+
+ export { Top as Top, type TopAsesResponse as TopAsesResponse, type TopAsesParams as TopAsesParams };
+}
diff --git a/src/resources/radar/bgp/ips/top.ts b/src/resources/radar/bgp/ips/top.ts
new file mode 100644
index 0000000000..8c8df3ae44
--- /dev/null
+++ b/src/resources/radar/bgp/ips/top.ts
@@ -0,0 +1,84 @@
+// 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 Top extends APIResource {
+ /**
+ * Returns the top-N autonomous systems by announced IP space at the nearest 8-hour
+ * RIB boundary at or before the requested date. The snapped boundary is returned
+ * as `anchor_ts`.
+ *
+ * @example
+ * ```ts
+ * const response = await client.radar.bgp.ips.top.ases();
+ * ```
+ */
+ ases(query?: TopAsesParams, options?: Core.RequestOptions): Core.APIPromise;
+ ases(options?: Core.RequestOptions): Core.APIPromise;
+ ases(
+ query: TopAsesParams | Core.RequestOptions = {},
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ if (isRequestOptions(query)) {
+ return this.ases({}, query);
+ }
+ return (
+ this._client.get('/radar/bgp/ips/top/ases', { query, ...options }) as Core.APIPromise<{
+ result: TopAsesResponse;
+ }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+}
+
+export interface TopAsesResponse {
+ anchorTs: string;
+
+ asns: Array;
+
+ country: string | null;
+
+ metric: string;
+}
+
+export namespace TopAsesResponse {
+ export interface ASN {
+ asn: number;
+
+ v4_24s: number;
+
+ v6_48s: number;
+ }
+}
+
+export interface TopAsesParams {
+ /**
+ * Optional ISO 3166-1 alpha-2 country filter. Omit for global top-N.
+ */
+ country?: string;
+
+ /**
+ * Filters results by the specified datetime (ISO 8601).
+ */
+ date?: string;
+
+ /**
+ * Format in which results will be returned.
+ */
+ format?: 'JSON' | 'CSV';
+
+ /**
+ * Limits the number of objects returned in the response.
+ */
+ limit?: number;
+
+ /**
+ * Ranking metric: IPv4 /24 count or IPv6 /48 count.
+ */
+ metric?: 'v4_24s' | 'v6_48s';
+}
+
+export declare namespace Top {
+ export { type TopAsesResponse as TopAsesResponse, type TopAsesParams as TopAsesParams };
+}
diff --git a/src/resources/radar/bgp/rpki/index.ts b/src/resources/radar/bgp/rpki/index.ts
index 342fcc7277..51480f3d22 100644
--- a/src/resources/radar/bgp/rpki/index.ts
+++ b/src/resources/radar/bgp/rpki/index.ts
@@ -10,3 +10,4 @@ export {
type ASPATimeseriesParams,
} from './aspa';
export { RPKI } from './rpki';
+export { Roas, type RoaTimeseriesResponse, type RoaTimeseriesParams } from './roas';
diff --git a/src/resources/radar/bgp/rpki/roas.ts b/src/resources/radar/bgp/rpki/roas.ts
new file mode 100644
index 0000000000..634c00377c
--- /dev/null
+++ b/src/resources/radar/bgp/rpki/roas.ts
@@ -0,0 +1,120 @@
+// 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 Roas extends APIResource {
+ /**
+ * Retrieves RPKI ROA (Route Origin Authorization) validation ratios over time.
+ * Returns the selected metric as a time series. Supports filtering by ASN or
+ * location (country code) — multiple values of the same filter type produce one
+ * series per value. If no ASN or location is specified, returns the global
+ * aggregate.
+ *
+ * @example
+ * ```ts
+ * const response =
+ * await client.radar.bgp.rpki.roas.timeseries();
+ * ```
+ */
+ timeseries(
+ query?: RoaTimeseriesParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise;
+ timeseries(options?: Core.RequestOptions): Core.APIPromise;
+ timeseries(
+ query: RoaTimeseriesParams | Core.RequestOptions = {},
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ if (isRequestOptions(query)) {
+ return this.timeseries({}, query);
+ }
+ return (
+ this._client.get('/radar/bgp/rpki/roas/timeseries', { query, ...options }) as Core.APIPromise<{
+ result: RoaTimeseriesResponse;
+ }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+}
+
+export interface RoaTimeseriesResponse {
+ meta: RoaTimeseriesResponse.Meta;
+
+ serie_0: RoaTimeseriesResponse.Serie0;
+}
+
+export namespace RoaTimeseriesResponse {
+ export interface Meta {
+ /**
+ * Timestamp of the underlying data.
+ */
+ dataTime: string;
+
+ /**
+ * Timestamp when the query was executed.
+ */
+ queryTime: string;
+ }
+
+ export interface Serie0 {
+ timestamps: Array;
+
+ values: Array;
+ }
+}
+
+export interface RoaTimeseriesParams {
+ /**
+ * Filters results by Autonomous System Number. Specify one or more ASNs. Multiple
+ * values generate one series per ASN.
+ */
+ asn?: Array;
+
+ /**
+ * End of the date range (inclusive).
+ */
+ dateEnd?: string;
+
+ /**
+ * Start of the date range (inclusive).
+ */
+ dateStart?: string;
+
+ /**
+ * Format in which results will be returned.
+ */
+ format?: 'JSON' | 'CSV';
+
+ /**
+ * Filters results by location. Specify a comma-separated list of alpha-2 location
+ * codes.
+ */
+ location?: Array;
+
+ /**
+ * Which RPKI ROA validation metric to return. validPfxsRatio = ratio of RPKI-valid
+ * prefixes (IPv4+IPv6 combined). validPfxsV4Ratio / validPfxsV6Ratio = same, split
+ * by IP version. validIpsRatio = ratio of RPKI-valid address space (IPv4 /24s +
+ * IPv6 /48s). validIpsV4Ratio / validIpsV6Ratio = same, split by IP version.
+ */
+ metric?:
+ | 'validPfxsRatio'
+ | 'validPfxsV4Ratio'
+ | 'validPfxsV6Ratio'
+ | 'validIpsRatio'
+ | 'validIpsV4Ratio'
+ | 'validIpsV6Ratio';
+
+ /**
+ * Array of names used to label the series in the response.
+ */
+ name?: Array;
+}
+
+export declare namespace Roas {
+ export {
+ type RoaTimeseriesResponse as RoaTimeseriesResponse,
+ type RoaTimeseriesParams as RoaTimeseriesParams,
+ };
+}
diff --git a/src/resources/radar/bgp/rpki/rpki.ts b/src/resources/radar/bgp/rpki/rpki.ts
index e5f7f9c4e0..f9680107b5 100644
--- a/src/resources/radar/bgp/rpki/rpki.ts
+++ b/src/resources/radar/bgp/rpki/rpki.ts
@@ -11,12 +11,16 @@ import {
ASPATimeseriesParams,
ASPATimeseriesResponse,
} from './aspa';
+import * as RoasAPI from './roas';
+import { RoaTimeseriesParams, RoaTimeseriesResponse, Roas } from './roas';
export class RPKI extends APIResource {
aspa: ASPAAPI.ASPA = new ASPAAPI.ASPA(this._client);
+ roas: RoasAPI.Roas = new RoasAPI.Roas(this._client);
}
RPKI.ASPA = ASPA;
+RPKI.Roas = Roas;
export declare namespace RPKI {
export {
@@ -28,4 +32,10 @@ export declare namespace RPKI {
type ASPASnapshotParams as ASPASnapshotParams,
type ASPATimeseriesParams as ASPATimeseriesParams,
};
+
+ export {
+ Roas as Roas,
+ type RoaTimeseriesResponse as RoaTimeseriesResponse,
+ type RoaTimeseriesParams as RoaTimeseriesParams,
+ };
}
diff --git a/tests/api-resources/radar/bgp/ips.test.ts b/tests/api-resources/radar/bgp/ips/ips.test.ts
similarity index 100%
rename from tests/api-resources/radar/bgp/ips.test.ts
rename to tests/api-resources/radar/bgp/ips/ips.test.ts
diff --git a/tests/api-resources/radar/bgp/ips/top.test.ts b/tests/api-resources/radar/bgp/ips/top.test.ts
new file mode 100644
index 0000000000..f7394d63d4
--- /dev/null
+++ b/tests/api-resources/radar/bgp/ips/top.test.ts
@@ -0,0 +1,46 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import Cloudflare from 'cloudflare';
+import { Response } from 'node-fetch';
+
+const client = new Cloudflare({
+ apiKey: '144c9defac04969c7bfad8efaa8ea194',
+ apiEmail: 'user@example.com',
+ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
+});
+
+describe('resource top', () => {
+ test('ases', async () => {
+ const responsePromise = client.radar.bgp.ips.top.ases();
+ 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);
+ });
+
+ test('ases: 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(client.radar.bgp.ips.top.ases({ path: '/_stainless_unknown_path' })).rejects.toThrow(
+ Cloudflare.NotFoundError,
+ );
+ });
+
+ test('ases: 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(
+ client.radar.bgp.ips.top.ases(
+ {
+ country: 'US',
+ date: '2024-09-19T00:00:00Z',
+ format: 'JSON',
+ limit: 5,
+ metric: 'v4_24s',
+ },
+ { path: '/_stainless_unknown_path' },
+ ),
+ ).rejects.toThrow(Cloudflare.NotFoundError);
+ });
+});
diff --git a/tests/api-resources/radar/bgp/rpki/roas.test.ts b/tests/api-resources/radar/bgp/rpki/roas.test.ts
new file mode 100644
index 0000000000..70fb0b43e7
--- /dev/null
+++ b/tests/api-resources/radar/bgp/rpki/roas.test.ts
@@ -0,0 +1,48 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import Cloudflare from 'cloudflare';
+import { Response } from 'node-fetch';
+
+const client = new Cloudflare({
+ apiKey: '144c9defac04969c7bfad8efaa8ea194',
+ apiEmail: 'user@example.com',
+ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
+});
+
+describe('resource roas', () => {
+ test('timeseries', async () => {
+ const responsePromise = client.radar.bgp.rpki.roas.timeseries();
+ 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);
+ });
+
+ test('timeseries: 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(client.radar.bgp.rpki.roas.timeseries({ path: '/_stainless_unknown_path' })).rejects.toThrow(
+ Cloudflare.NotFoundError,
+ );
+ });
+
+ test('timeseries: 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(
+ client.radar.bgp.rpki.roas.timeseries(
+ {
+ asn: ['string'],
+ dateEnd: '2023-09-01T11:41:33.782Z',
+ dateStart: '2023-09-01T11:41:33.782Z',
+ format: 'JSON',
+ location: ['string'],
+ metric: 'validPfxsRatio',
+ name: ['main_series'],
+ },
+ { path: '/_stainless_unknown_path' },
+ ),
+ ).rejects.toThrow(Cloudflare.NotFoundError);
+ });
+});
From 887ca8c3ce39302a3a41ce91f57e20c3674acc96 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 5 May 2026 21:44:55 +0000
Subject: [PATCH 11/73] codegen metadata
---
.stats.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index abff5e52b7..cc241adb91 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 2207
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
openapi_spec_hash: 43b3282cc17b94e7729c724d6a3c67ae
-config_hash: 82bd9683d33d942855962bb7dc595067
+config_hash: e84ce27865a87048dfceb774cac9c0fd
From 956d874b30a5c45372f1e0835fcc66f5cbba537d Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 5 May 2026 23:37:48 +0000
Subject: [PATCH 12/73] chore(api): update composite API spec
---
.stats.yml | 2 +-
.../monitor-groups/monitor-groups.ts | 25 ++-----------------
.../resource-sharing/resource-sharing.ts | 19 +++++++++-----
src/resources/resource-sharing/resources.ts | 21 ++++++++++------
.../monitor-groups/monitor-groups.test.ts | 6 -----
5 files changed, 30 insertions(+), 43 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index cc241adb91..49516dea71 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 2207
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
-openapi_spec_hash: 43b3282cc17b94e7729c724d6a3c67ae
+openapi_spec_hash: 512888090352626a0937b97e77f93c6c
config_hash: e84ce27865a87048dfceb774cac9c0fd
diff --git a/src/resources/load-balancers/monitor-groups/monitor-groups.ts b/src/resources/load-balancers/monitor-groups/monitor-groups.ts
index 0c74989ebc..79117bf5b3 100644
--- a/src/resources/load-balancers/monitor-groups/monitor-groups.ts
+++ b/src/resources/load-balancers/monitor-groups/monitor-groups.ts
@@ -22,7 +22,6 @@ export class MonitorGroups extends APIResource {
* const monitorGroup =
* await client.loadBalancers.monitorGroups.create({
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
- * id: 'id',
* description: 'Primary datacenter monitors',
* members: [
* {
@@ -55,7 +54,6 @@ export class MonitorGroups extends APIResource {
* '17b5962d775c646f3f9725cbc7a53df4',
* {
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
- * id: 'id',
* description: 'Primary datacenter monitors',
* members: [
* {
@@ -144,7 +142,6 @@ export class MonitorGroups extends APIResource {
* '17b5962d775c646f3f9725cbc7a53df4',
* {
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
- * id: 'id',
* description: 'Primary datacenter monitors',
* members: [
* {
@@ -221,12 +218,12 @@ export interface MonitorGroup {
/**
* The timestamp of when the monitor group was created
*/
- created_at?: string;
+ created_on?: string;
/**
* The timestamp of when the monitor group was last updated
*/
- updated_at?: string;
+ modified_on?: string;
}
export namespace MonitorGroup {
@@ -270,12 +267,6 @@ export interface MonitorGroupCreateParams {
*/
account_id: string;
- /**
- * Body param: The ID of the Monitor Group to use for checking the health of
- * origins within this pool.
- */
- id: string;
-
/**
* Body param: A short description of the monitor group
*/
@@ -318,12 +309,6 @@ export interface MonitorGroupUpdateParams {
*/
account_id: string;
- /**
- * Body param: The ID of the Monitor Group to use for checking the health of
- * origins within this pool.
- */
- id: string;
-
/**
* Body param: A short description of the monitor group
*/
@@ -380,12 +365,6 @@ export interface MonitorGroupEditParams {
*/
account_id: string;
- /**
- * Body param: The ID of the Monitor Group to use for checking the health of
- * origins within this pool.
- */
- id: string;
-
/**
* Body param: A short description of the monitor group
*/
diff --git a/src/resources/resource-sharing/resource-sharing.ts b/src/resources/resource-sharing/resource-sharing.ts
index 54d64a6227..419f3b97b5 100644
--- a/src/resources/resource-sharing/resource-sharing.ts
+++ b/src/resources/resource-sharing/resource-sharing.ts
@@ -291,7 +291,8 @@ export namespace ResourceSharingCreateResponse {
| 'gateway-policy'
| 'gateway-destination-ip'
| 'gateway-block-page-settings'
- | 'gateway-extended-email-matching';
+ | 'gateway-extended-email-matching'
+ | 'idp-federation-grant';
/**
* Resource Version.
@@ -418,7 +419,8 @@ export namespace ResourceSharingUpdateResponse {
| 'gateway-policy'
| 'gateway-destination-ip'
| 'gateway-block-page-settings'
- | 'gateway-extended-email-matching';
+ | 'gateway-extended-email-matching'
+ | 'idp-federation-grant';
/**
* Resource Version.
@@ -545,7 +547,8 @@ export namespace ResourceSharingListResponse {
| 'gateway-policy'
| 'gateway-destination-ip'
| 'gateway-block-page-settings'
- | 'gateway-extended-email-matching';
+ | 'gateway-extended-email-matching'
+ | 'idp-federation-grant';
/**
* Resource Version.
@@ -672,7 +675,8 @@ export namespace ResourceSharingDeleteResponse {
| 'gateway-policy'
| 'gateway-destination-ip'
| 'gateway-block-page-settings'
- | 'gateway-extended-email-matching';
+ | 'gateway-extended-email-matching'
+ | 'idp-federation-grant';
/**
* Resource Version.
@@ -799,7 +803,8 @@ export namespace ResourceSharingGetResponse {
| 'gateway-policy'
| 'gateway-destination-ip'
| 'gateway-block-page-settings'
- | 'gateway-extended-email-matching';
+ | 'gateway-extended-email-matching'
+ | 'idp-federation-grant';
/**
* Resource Version.
@@ -875,7 +880,8 @@ export namespace ResourceSharingCreateParams {
| 'gateway-policy'
| 'gateway-destination-ip'
| 'gateway-block-page-settings'
- | 'gateway-extended-email-matching';
+ | 'gateway-extended-email-matching'
+ | 'idp-federation-grant';
}
}
@@ -931,6 +937,7 @@ export interface ResourceSharingListParams extends V4PagePaginationArrayParams {
| 'gateway-destination-ip'
| 'gateway-block-page-settings'
| 'gateway-extended-email-matching'
+ | 'idp-federation-grant'
>;
/**
diff --git a/src/resources/resource-sharing/resources.ts b/src/resources/resource-sharing/resources.ts
index 8ad7ee265e..22b54abff7 100644
--- a/src/resources/resource-sharing/resources.ts
+++ b/src/resources/resource-sharing/resources.ts
@@ -195,7 +195,8 @@ export interface ResourceCreateResponse {
| 'gateway-policy'
| 'gateway-destination-ip'
| 'gateway-block-page-settings'
- | 'gateway-extended-email-matching';
+ | 'gateway-extended-email-matching'
+ | 'idp-federation-grant';
/**
* Resource Version.
@@ -247,7 +248,8 @@ export interface ResourceUpdateResponse {
| 'gateway-policy'
| 'gateway-destination-ip'
| 'gateway-block-page-settings'
- | 'gateway-extended-email-matching';
+ | 'gateway-extended-email-matching'
+ | 'idp-federation-grant';
/**
* Resource Version.
@@ -299,7 +301,8 @@ export interface ResourceListResponse {
| 'gateway-policy'
| 'gateway-destination-ip'
| 'gateway-block-page-settings'
- | 'gateway-extended-email-matching';
+ | 'gateway-extended-email-matching'
+ | 'idp-federation-grant';
/**
* Resource Version.
@@ -351,7 +354,8 @@ export interface ResourceDeleteResponse {
| 'gateway-policy'
| 'gateway-destination-ip'
| 'gateway-block-page-settings'
- | 'gateway-extended-email-matching';
+ | 'gateway-extended-email-matching'
+ | 'idp-federation-grant';
/**
* Resource Version.
@@ -403,7 +407,8 @@ export interface ResourceGetResponse {
| 'gateway-policy'
| 'gateway-destination-ip'
| 'gateway-block-page-settings'
- | 'gateway-extended-email-matching';
+ | 'gateway-extended-email-matching'
+ | 'idp-federation-grant';
/**
* Resource Version.
@@ -445,7 +450,8 @@ export interface ResourceCreateParams {
| 'gateway-policy'
| 'gateway-destination-ip'
| 'gateway-block-page-settings'
- | 'gateway-extended-email-matching';
+ | 'gateway-extended-email-matching'
+ | 'idp-federation-grant';
}
export interface ResourceUpdateParams {
@@ -474,7 +480,8 @@ export interface ResourceListParams extends V4PagePaginationArrayParams {
| 'gateway-policy'
| 'gateway-destination-ip'
| 'gateway-block-page-settings'
- | 'gateway-extended-email-matching';
+ | 'gateway-extended-email-matching'
+ | 'idp-federation-grant';
/**
* Query param: Filter share resources by status.
diff --git a/tests/api-resources/load-balancers/monitor-groups/monitor-groups.test.ts b/tests/api-resources/load-balancers/monitor-groups/monitor-groups.test.ts
index f987edb7db..80a375dd05 100644
--- a/tests/api-resources/load-balancers/monitor-groups/monitor-groups.test.ts
+++ b/tests/api-resources/load-balancers/monitor-groups/monitor-groups.test.ts
@@ -13,7 +13,6 @@ describe('resource monitorGroups', () => {
test('create: only required params', async () => {
const responsePromise = client.loadBalancers.monitorGroups.create({
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
- id: 'id',
description: 'Primary datacenter monitors',
members: [
{
@@ -36,7 +35,6 @@ describe('resource monitorGroups', () => {
test('create: required and optional params', async () => {
const response = await client.loadBalancers.monitorGroups.create({
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
- id: 'id',
description: 'Primary datacenter monitors',
members: [
{
@@ -52,7 +50,6 @@ describe('resource monitorGroups', () => {
test('update: only required params', async () => {
const responsePromise = client.loadBalancers.monitorGroups.update('17b5962d775c646f3f9725cbc7a53df4', {
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
- id: 'id',
description: 'Primary datacenter monitors',
members: [
{
@@ -75,7 +72,6 @@ describe('resource monitorGroups', () => {
test('update: required and optional params', async () => {
const response = await client.loadBalancers.monitorGroups.update('17b5962d775c646f3f9725cbc7a53df4', {
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
- id: 'id',
description: 'Primary datacenter monitors',
members: [
{
@@ -129,7 +125,6 @@ describe('resource monitorGroups', () => {
test('edit: only required params', async () => {
const responsePromise = client.loadBalancers.monitorGroups.edit('17b5962d775c646f3f9725cbc7a53df4', {
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
- id: 'id',
description: 'Primary datacenter monitors',
members: [
{
@@ -152,7 +147,6 @@ describe('resource monitorGroups', () => {
test('edit: required and optional params', async () => {
const response = await client.loadBalancers.monitorGroups.edit('17b5962d775c646f3f9725cbc7a53df4', {
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
- id: 'id',
description: 'Primary datacenter monitors',
members: [
{
From 1360ad8f734fe8a082dcc0437005c461a8ecb7fb Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 6 May 2026 14:53:12 +0000
Subject: [PATCH 13/73] chore(api): update composite API spec
---
.stats.yml | 2 +-
.../threat-events/threat-events.ts | 2 +-
src/resources/url-scanner/scans.ts | 58 +++++++++++++++++++
.../resource-library/applications.ts | 28 ++++++++-
.../resource-library/applications.test.ts | 1 +
5 files changed, 87 insertions(+), 4 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 49516dea71..bcc369c880 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 2207
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
-openapi_spec_hash: 512888090352626a0937b97e77f93c6c
+openapi_spec_hash: 080c9cae915329f859d49062622da2f7
config_hash: e84ce27865a87048dfceb774cac9c0fd
diff --git a/src/resources/cloudforce-one/threat-events/threat-events.ts b/src/resources/cloudforce-one/threat-events/threat-events.ts
index 7ac5d28d50..6a66aaa727 100644
--- a/src/resources/cloudforce-one/threat-events/threat-events.ts
+++ b/src/resources/cloudforce-one/threat-events/threat-events.ts
@@ -638,7 +638,7 @@ export interface ThreatEventListParams {
/**
* Query param
*/
- format?: 'json' | 'stix2';
+ format?: 'json' | 'stix2' | 'taxii';
/**
* Query param
diff --git a/src/resources/url-scanner/scans.ts b/src/resources/url-scanner/scans.ts
index 73337a0ba4..71ab0f4f45 100644
--- a/src/resources/url-scanner/scans.ts
+++ b/src/resources/url-scanner/scans.ts
@@ -1058,6 +1058,8 @@ export namespace ScanGetResponse {
ap2: Commerce.Ap2;
+ mpp: Commerce.Mpp;
+
ucp: Commerce.Ucp;
x402: Commerce.X402;
@@ -1176,6 +1178,62 @@ export namespace ScanGetResponse {
}
}
+ export interface Mpp {
+ status: string;
+
+ details?: unknown;
+
+ durationMs?: number;
+
+ evidence?: Array;
+
+ message?: string;
+ }
+
+ export namespace Mpp {
+ export interface Evidence {
+ action: string;
+
+ label: string;
+
+ finding?: Evidence.Finding;
+
+ request?: Evidence.Request;
+
+ response?: Evidence.Response;
+ }
+
+ export namespace Evidence {
+ export interface Finding {
+ outcome: string;
+
+ summary: string;
+ }
+
+ export interface Request {
+ method: string;
+
+ url: string;
+
+ headers?: unknown;
+ }
+
+ export interface Response {
+ status: number;
+
+ statusText: string;
+
+ bodyPreview?: string;
+
+ bodySize?: number;
+
+ headers?: unknown;
+
+ redirectedTo?: string;
+ }
+ }
+ }
+
export interface Ucp {
status: string;
diff --git a/src/resources/zero-trust/resource-library/applications.ts b/src/resources/zero-trust/resource-library/applications.ts
index 54bde713a9..896a0109c4 100644
--- a/src/resources/zero-trust/resource-library/applications.ts
+++ b/src/resources/zero-trust/resource-library/applications.ts
@@ -125,6 +125,11 @@ export interface ApplicationListResponse {
*/
support_domains: Array;
+ /**
+ * Cloudflare products that support this application.
+ */
+ supported: Array<'GATEWAY' | 'ACCESS' | 'CASB'>;
+
/**
* Returns the application update time.
*/
@@ -212,6 +217,11 @@ export interface ApplicationGetResponse {
*/
support_domains: Array;
+ /**
+ * Cloudflare products that support this application.
+ */
+ supported: Array<'GATEWAY' | 'ACCESS' | 'CASB'>;
+
/**
* Returns the application update time.
*/
@@ -251,7 +261,13 @@ export interface ApplicationListParams {
* - ip_subnet: Filter by IP subnet using CIDR containment — returns applications
* where any stored subnet contains the search value (e.g., ip_subnet:10.0.1.5/32
* matches apps with 10.0.0.0/16)
- * - intel_id: Filter by Intel API ID (e.g., intel_id:498). .
+ * - intel_id: Filter by Intel API ID (e.g., intel_id:498). also supports multiple
+ * values (e.g., intel_id:498,1001)
+ * - category_id: Filter by category ID (e.g.,
+ * category_id:37f8ec03-8766-49d4-9a15-369b044c842c).
+ * - category_name: Filter by category name (e.g., category_name:HR).
+ * - supported: Filter by supported Cloudflare product (e.g., supported:ACCESS).
+ * Values: GATEWAY, ACCESS, CASB. .
*/
filter?: string;
@@ -266,9 +282,17 @@ export interface ApplicationListParams {
offset?: number;
/**
- * Query param: Order by result by field name and order (e.g., name:asc).
+ * Query param: Order results by field name and direction (e.g., name:asc). Ignored
+ * when search is provided; results are ranked by relevance instead.
*/
order_by?: string;
+
+ /**
+ * Query param: Fuzzy search across application name and hostnames. Results are
+ * ranked by relevance. Must be between 2 and 200 characters. Can be combined with
+ * filter parameters.
+ */
+ search?: string;
}
export interface ApplicationGetParams {
diff --git a/tests/api-resources/zero-trust/resource-library/applications.test.ts b/tests/api-resources/zero-trust/resource-library/applications.test.ts
index fed1d750ea..4c761b8dd6 100644
--- a/tests/api-resources/zero-trust/resource-library/applications.test.ts
+++ b/tests/api-resources/zero-trust/resource-library/applications.test.ts
@@ -30,6 +30,7 @@ describe('resource applications', () => {
limit: 0,
offset: 0,
order_by: 'order_by',
+ search: 'xx',
});
});
From b38db1f70792ba59fb98a2d8ac37cda7ebf367d0 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 6 May 2026 16:14:25 +0000
Subject: [PATCH 14/73] feat: feat(ai_gateway): add billing endpoints for
credit balance, usage, invoices,...
* feat(ai_gateway): add billing endpoints for credit balance, usage, invoices, topup, and spending limits
---
.stats.yml | 4 +-
scripts/detect-breaking-changes | 4 +
src/resources/ai-gateway/ai-gateway.ts | 26 ++
src/resources/ai-gateway/api.md | 56 +++
src/resources/ai-gateway/billing.ts | 3 +
src/resources/ai-gateway/billing/billing.ts | 363 ++++++++++++++++++
src/resources/ai-gateway/billing/index.ts | 29 ++
.../ai-gateway/billing/spending-limit.ts | 148 +++++++
src/resources/ai-gateway/billing/topup.ts | 3 +
.../ai-gateway/billing/topup/config.ts | 133 +++++++
.../ai-gateway/billing/topup/index.ts | 18 +
.../ai-gateway/billing/topup/topup.ts | 139 +++++++
src/resources/ai-gateway/index.ts | 11 +
.../ai-gateway/billing/billing.test.ts | 80 ++++
.../ai-gateway/billing/spending-limit.test.ts | 67 ++++
.../ai-gateway/billing/topup/config.test.ts | 65 ++++
.../ai-gateway/billing/topup/topup.test.ts | 48 +++
17 files changed, 1195 insertions(+), 2 deletions(-)
create mode 100644 src/resources/ai-gateway/billing.ts
create mode 100644 src/resources/ai-gateway/billing/billing.ts
create mode 100644 src/resources/ai-gateway/billing/index.ts
create mode 100644 src/resources/ai-gateway/billing/spending-limit.ts
create mode 100644 src/resources/ai-gateway/billing/topup.ts
create mode 100644 src/resources/ai-gateway/billing/topup/config.ts
create mode 100644 src/resources/ai-gateway/billing/topup/index.ts
create mode 100644 src/resources/ai-gateway/billing/topup/topup.ts
create mode 100644 tests/api-resources/ai-gateway/billing/billing.test.ts
create mode 100644 tests/api-resources/ai-gateway/billing/spending-limit.test.ts
create mode 100644 tests/api-resources/ai-gateway/billing/topup/config.test.ts
create mode 100644 tests/api-resources/ai-gateway/billing/topup/topup.test.ts
diff --git a/.stats.yml b/.stats.yml
index bcc369c880..fa4557fd0c 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 2207
+configured_endpoints: 2219
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
openapi_spec_hash: 080c9cae915329f859d49062622da2f7
-config_hash: e84ce27865a87048dfceb774cac9c0fd
+config_hash: f450f135e11cc00980b6c05811e4988d
diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes
index 2c9955e3e1..5629104c4f 100755
--- a/scripts/detect-breaking-changes
+++ b/scripts/detect-breaking-changes
@@ -783,6 +783,10 @@ TEST_PATHS=(
tests/api-resources/ai-gateway/dynamic-routing.test.ts
tests/api-resources/ai-gateway/provider-configs.test.ts
tests/api-resources/ai-gateway/urls.test.ts
+ tests/api-resources/ai-gateway/billing/billing.test.ts
+ tests/api-resources/ai-gateway/billing/topup/topup.test.ts
+ tests/api-resources/ai-gateway/billing/topup/config.test.ts
+ tests/api-resources/ai-gateway/billing/spending-limit.test.ts
tests/api-resources/iam/iam.test.ts
tests/api-resources/iam/permission-groups.test.ts
tests/api-resources/iam/resource-groups.test.ts
diff --git a/src/resources/ai-gateway/ai-gateway.ts b/src/resources/ai-gateway/ai-gateway.ts
index bc2f4ab4b9..1f67180455 100644
--- a/src/resources/ai-gateway/ai-gateway.ts
+++ b/src/resources/ai-gateway/ai-gateway.ts
@@ -89,6 +89,18 @@ import {
} from './provider-configs';
import * as URLsAPI from './urls';
import { URLGetParams, URLGetResponse, URLs } from './urls';
+import * as BillingAPI from './billing/billing';
+import {
+ Billing,
+ BillingCreditBalanceParams,
+ BillingCreditBalanceResponse,
+ BillingInvoiceHistoryParams,
+ BillingInvoiceHistoryResponse,
+ BillingInvoicePreviewParams,
+ BillingInvoicePreviewResponse,
+ BillingUsageHistoryParams,
+ BillingUsageHistoryResponse,
+} from './billing/billing';
import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../pagination';
export class AIGateway extends APIResource {
@@ -99,6 +111,7 @@ export class AIGateway extends APIResource {
dynamicRouting: DynamicRoutingAPI.DynamicRouting = new DynamicRoutingAPI.DynamicRouting(this._client);
providerConfigs: ProviderConfigsAPI.ProviderConfigs = new ProviderConfigsAPI.ProviderConfigs(this._client);
urls: URLsAPI.URLs = new URLsAPI.URLs(this._client);
+ billing: BillingAPI.Billing = new BillingAPI.Billing(this._client);
/**
* Creates a new AI Gateway.
@@ -1112,6 +1125,7 @@ AIGateway.DynamicRouting = DynamicRouting;
AIGateway.ProviderConfigs = ProviderConfigs;
AIGateway.ProviderConfigListResponsesV4PagePaginationArray = ProviderConfigListResponsesV4PagePaginationArray;
AIGateway.URLs = URLs;
+AIGateway.Billing = Billing;
export declare namespace AIGateway {
export {
@@ -1214,4 +1228,16 @@ export declare namespace AIGateway {
};
export { URLs as URLs, type URLGetResponse as URLGetResponse, type URLGetParams as URLGetParams };
+
+ export {
+ Billing as Billing,
+ type BillingCreditBalanceResponse as BillingCreditBalanceResponse,
+ type BillingInvoiceHistoryResponse as BillingInvoiceHistoryResponse,
+ type BillingInvoicePreviewResponse as BillingInvoicePreviewResponse,
+ type BillingUsageHistoryResponse as BillingUsageHistoryResponse,
+ type BillingCreditBalanceParams as BillingCreditBalanceParams,
+ type BillingInvoiceHistoryParams as BillingInvoiceHistoryParams,
+ type BillingInvoicePreviewParams as BillingInvoicePreviewParams,
+ type BillingUsageHistoryParams as BillingUsageHistoryParams,
+ };
}
diff --git a/src/resources/ai-gateway/api.md b/src/resources/ai-gateway/api.md
index 34a65839e3..a437e6c8d9 100644
--- a/src/resources/ai-gateway/api.md
+++ b/src/resources/ai-gateway/api.md
@@ -129,3 +129,59 @@ Types:
Methods:
- client.aiGateway.urls.get(gatewayId, provider, { ...params }) -> URLGetResponse
+
+## Billing
+
+Types:
+
+- BillingCreditBalanceResponse
+- BillingInvoiceHistoryResponse
+- BillingInvoicePreviewResponse
+- BillingUsageHistoryResponse
+
+Methods:
+
+- client.aiGateway.billing.creditBalance({ ...params }) -> BillingCreditBalanceResponse
+- client.aiGateway.billing.invoiceHistory({ ...params }) -> BillingInvoiceHistoryResponse
+- client.aiGateway.billing.invoicePreview({ ...params }) -> BillingInvoicePreviewResponse
+- client.aiGateway.billing.usageHistory({ ...params }) -> BillingUsageHistoryResponse
+
+### Topup
+
+Types:
+
+- TopupCreateResponse
+- TopupStatusResponse
+
+Methods:
+
+- client.aiGateway.billing.topup.create({ ...params }) -> TopupCreateResponse
+- client.aiGateway.billing.topup.status({ ...params }) -> TopupStatusResponse
+
+#### Config
+
+Types:
+
+- ConfigCreateResponse
+- ConfigDeleteResponse
+- ConfigGetResponse
+
+Methods:
+
+- client.aiGateway.billing.topup.config.create({ ...params }) -> ConfigCreateResponse
+- client.aiGateway.billing.topup.config.delete({ ...params }) -> ConfigDeleteResponse
+- client.aiGateway.billing.topup.config.get({ ...params }) -> ConfigGetResponse
+
+### SpendingLimit
+
+Types:
+
+- SpendingLimitCreateResponse
+- SpendingLimitDeleteResponse
+- SpendingLimitGetResponse
+
+Methods:
+
+- client.aiGateway.billing.spendingLimit.create({ ...params }) -> SpendingLimitCreateResponse
+- client.aiGateway.billing.spendingLimit.delete({ ...params }) -> SpendingLimitDeleteResponse
+- client.aiGateway.billing.spendingLimit.get({ ...params }) -> SpendingLimitGetResponse
diff --git a/src/resources/ai-gateway/billing.ts b/src/resources/ai-gateway/billing.ts
new file mode 100644
index 0000000000..565ff303e6
--- /dev/null
+++ b/src/resources/ai-gateway/billing.ts
@@ -0,0 +1,3 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+export * from './billing/index';
diff --git a/src/resources/ai-gateway/billing/billing.ts b/src/resources/ai-gateway/billing/billing.ts
new file mode 100644
index 0000000000..94fe30b4bd
--- /dev/null
+++ b/src/resources/ai-gateway/billing/billing.ts
@@ -0,0 +1,363 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import { APIResource } from '../../../resource';
+import * as Core from '../../../core';
+import * as SpendingLimitAPI from './spending-limit';
+import {
+ SpendingLimit,
+ SpendingLimitCreateParams,
+ SpendingLimitCreateResponse,
+ SpendingLimitDeleteParams,
+ SpendingLimitDeleteResponse,
+ SpendingLimitGetParams,
+ SpendingLimitGetResponse,
+} from './spending-limit';
+import * as TopupAPI from './topup/topup';
+import {
+ Topup,
+ TopupCreateParams,
+ TopupCreateResponse,
+ TopupStatusParams,
+ TopupStatusResponse,
+} from './topup/topup';
+
+export class Billing extends APIResource {
+ topup: TopupAPI.Topup = new TopupAPI.Topup(this._client);
+ spendingLimit: SpendingLimitAPI.SpendingLimit = new SpendingLimitAPI.SpendingLimit(this._client);
+
+ /**
+ * Retrieve the current credit balance, payment method info, and top-up
+ * configuration.
+ *
+ * @example
+ * ```ts
+ * const response =
+ * await client.aiGateway.billing.creditBalance({
+ * account_id: 'account_id',
+ * });
+ * ```
+ */
+ creditBalance(
+ params: BillingCreditBalanceParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ const { account_id } = params;
+ return (
+ this._client.get(
+ `/accounts/${account_id}/ai-gateway/billing/credit-balance`,
+ options,
+ ) as Core.APIPromise<{ result: BillingCreditBalanceResponse }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+
+ /**
+ * Retrieve a list of past invoices with pagination, optionally filtered by type.
+ *
+ * @example
+ * ```ts
+ * const response =
+ * await client.aiGateway.billing.invoiceHistory({
+ * account_id: 'account_id',
+ * });
+ * ```
+ */
+ invoiceHistory(
+ params: BillingInvoiceHistoryParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ const { account_id, ...query } = params;
+ return (
+ this._client.get(`/accounts/${account_id}/ai-gateway/billing/invoice-history`, {
+ query,
+ ...options,
+ }) as Core.APIPromise<{ result: BillingInvoiceHistoryResponse }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+
+ /**
+ * Retrieve a preview of the upcoming invoice including line items and tax.
+ *
+ * @example
+ * ```ts
+ * const response =
+ * await client.aiGateway.billing.invoicePreview({
+ * account_id: 'account_id',
+ * });
+ * ```
+ */
+ invoicePreview(
+ params: BillingInvoicePreviewParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ const { account_id } = params;
+ return (
+ this._client.get(
+ `/accounts/${account_id}/ai-gateway/billing/invoice-preview`,
+ options,
+ ) as Core.APIPromise<{ result: BillingInvoicePreviewResponse }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+
+ /**
+ * Retrieve aggregated usage meter event summaries for the given time range.
+ *
+ * @example
+ * ```ts
+ * const response =
+ * await client.aiGateway.billing.usageHistory({
+ * account_id: 'account_id',
+ * value_grouping_window: 'day',
+ * });
+ * ```
+ */
+ usageHistory(
+ params: BillingUsageHistoryParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ const { account_id, ...query } = params;
+ return (
+ this._client.get(`/accounts/${account_id}/ai-gateway/billing/usage-history`, {
+ query,
+ ...options,
+ }) as Core.APIPromise<{ result: BillingUsageHistoryResponse }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+}
+
+export interface BillingCreditBalanceResponse {
+ balance: number;
+
+ has_default_payment_method: boolean;
+
+ payment_method: BillingCreditBalanceResponse.PaymentMethod | null;
+
+ topup_config: BillingCreditBalanceResponse.TopupConfig;
+
+ first_topup_success?: boolean;
+}
+
+export namespace BillingCreditBalanceResponse {
+ export interface PaymentMethod {
+ brand?: string;
+
+ last4?: string;
+ }
+
+ export interface TopupConfig {
+ amount: number | null;
+
+ disabledReason: string | null;
+
+ error: string | null;
+
+ lastFailedAt: number | null;
+
+ threshold: number | null;
+ }
+}
+
+export interface BillingInvoiceHistoryResponse {
+ invoices: Array;
+
+ pagination: BillingInvoiceHistoryResponse.Pagination;
+}
+
+export namespace BillingInvoiceHistoryResponse {
+ export interface Invoice {
+ amount_due: number;
+
+ amount_paid: number;
+
+ amount_remaining: number;
+
+ currency: string;
+
+ id?: string | null;
+
+ attempt_count?: number;
+
+ attempted?: boolean;
+
+ auto_advance?: boolean | null;
+
+ created?: number;
+
+ created_by?: string;
+
+ description?: string | null;
+
+ invoice_origin?: string;
+
+ invoice_pdf?: string | null;
+
+ status?: string | null;
+ }
+
+ export interface Pagination {
+ has_more: boolean;
+
+ page: number;
+
+ per_page: number;
+
+ total_count: number;
+ }
+}
+
+export interface BillingInvoicePreviewResponse {
+ id: string;
+
+ amount_due: number;
+
+ amount_paid: number;
+
+ amount_remaining: number;
+
+ currency: string;
+
+ invoice_lines: Array;
+
+ period_end: number;
+
+ period_start: number;
+
+ status: 'draft' | 'open' | 'paid' | 'uncollectible' | 'void';
+}
+
+export namespace BillingInvoicePreviewResponse {
+ export interface InvoiceLine {
+ amount: number;
+
+ currency: string;
+
+ description: string | null;
+
+ period: InvoiceLine.Period;
+
+ pricing: InvoiceLine.Pricing;
+
+ quantity: number;
+
+ pretax_credit_amounts?: Array;
+ }
+
+ export namespace InvoiceLine {
+ export interface Period {
+ end: number;
+
+ start: number;
+ }
+
+ export interface Pricing {
+ unit_amount_decimal: string | null;
+ }
+
+ export interface PretaxCreditAmount {
+ amount: number;
+
+ type: string;
+
+ credit_balance_transaction?: string | null;
+
+ discount?: string | null;
+ }
+ }
+}
+
+export interface BillingUsageHistoryResponse {
+ history: Array;
+}
+
+export namespace BillingUsageHistoryResponse {
+ export interface History {
+ id: string;
+
+ aggregated_value: number;
+
+ end_time: number;
+
+ start_time: number;
+ }
+}
+
+export interface BillingCreditBalanceParams {
+ /**
+ * Cloudflare account ID.
+ */
+ account_id: string;
+}
+
+export interface BillingInvoiceHistoryParams {
+ /**
+ * Path param: Cloudflare account ID.
+ */
+ account_id: string;
+
+ /**
+ * Query param: Filter invoice type: auto, manual, or all.
+ */
+ type?: 'auto' | 'all' | 'manual';
+}
+
+export interface BillingInvoicePreviewParams {
+ /**
+ * Cloudflare account ID.
+ */
+ account_id: string;
+}
+
+export interface BillingUsageHistoryParams {
+ /**
+ * Path param: Cloudflare account ID.
+ */
+ account_id: string;
+
+ /**
+ * Query param: Grouping window for usage data.
+ */
+ value_grouping_window: 'day' | 'hour';
+
+ /**
+ * Query param: End time (Unix timestamp).
+ */
+ end_time?: number | null;
+
+ /**
+ * Query param: Start time (Unix timestamp).
+ */
+ start_time?: number | null;
+}
+
+Billing.Topup = Topup;
+Billing.SpendingLimit = SpendingLimit;
+
+export declare namespace Billing {
+ export {
+ type BillingCreditBalanceResponse as BillingCreditBalanceResponse,
+ type BillingInvoiceHistoryResponse as BillingInvoiceHistoryResponse,
+ type BillingInvoicePreviewResponse as BillingInvoicePreviewResponse,
+ type BillingUsageHistoryResponse as BillingUsageHistoryResponse,
+ type BillingCreditBalanceParams as BillingCreditBalanceParams,
+ type BillingInvoiceHistoryParams as BillingInvoiceHistoryParams,
+ type BillingInvoicePreviewParams as BillingInvoicePreviewParams,
+ type BillingUsageHistoryParams as BillingUsageHistoryParams,
+ };
+
+ export {
+ Topup as Topup,
+ type TopupCreateResponse as TopupCreateResponse,
+ type TopupStatusResponse as TopupStatusResponse,
+ type TopupCreateParams as TopupCreateParams,
+ type TopupStatusParams as TopupStatusParams,
+ };
+
+ export {
+ SpendingLimit as SpendingLimit,
+ type SpendingLimitCreateResponse as SpendingLimitCreateResponse,
+ type SpendingLimitDeleteResponse as SpendingLimitDeleteResponse,
+ type SpendingLimitGetResponse as SpendingLimitGetResponse,
+ type SpendingLimitCreateParams as SpendingLimitCreateParams,
+ type SpendingLimitDeleteParams as SpendingLimitDeleteParams,
+ type SpendingLimitGetParams as SpendingLimitGetParams,
+ };
+}
diff --git a/src/resources/ai-gateway/billing/index.ts b/src/resources/ai-gateway/billing/index.ts
new file mode 100644
index 0000000000..35277abff0
--- /dev/null
+++ b/src/resources/ai-gateway/billing/index.ts
@@ -0,0 +1,29 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+export {
+ Billing,
+ type BillingCreditBalanceResponse,
+ type BillingInvoiceHistoryResponse,
+ type BillingInvoicePreviewResponse,
+ type BillingUsageHistoryResponse,
+ type BillingCreditBalanceParams,
+ type BillingInvoiceHistoryParams,
+ type BillingInvoicePreviewParams,
+ type BillingUsageHistoryParams,
+} from './billing';
+export {
+ SpendingLimit,
+ type SpendingLimitCreateResponse,
+ type SpendingLimitDeleteResponse,
+ type SpendingLimitGetResponse,
+ type SpendingLimitCreateParams,
+ type SpendingLimitDeleteParams,
+ type SpendingLimitGetParams,
+} from './spending-limit';
+export {
+ Topup,
+ type TopupCreateResponse,
+ type TopupStatusResponse,
+ type TopupCreateParams,
+ type TopupStatusParams,
+} from './topup/index';
diff --git a/src/resources/ai-gateway/billing/spending-limit.ts b/src/resources/ai-gateway/billing/spending-limit.ts
new file mode 100644
index 0000000000..f1c03f56ee
--- /dev/null
+++ b/src/resources/ai-gateway/billing/spending-limit.ts
@@ -0,0 +1,148 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import { APIResource } from '../../../resource';
+import * as Core from '../../../core';
+
+export class SpendingLimit extends APIResource {
+ /**
+ * Configure a spending limit with amount, strategy, and duration.
+ *
+ * @example
+ * ```ts
+ * const spendingLimit =
+ * await client.aiGateway.billing.spendingLimit.create({
+ * account_id: 'account_id',
+ * amount: 10000,
+ * duration: 'monthly',
+ * strategy: 'fixed',
+ * });
+ * ```
+ */
+ create(
+ params: SpendingLimitCreateParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ const { account_id, ...body } = params;
+ return (
+ this._client.post(`/accounts/${account_id}/ai-gateway/billing/spending-limit`, {
+ body,
+ ...options,
+ }) as Core.APIPromise<{ result: SpendingLimitCreateResponse }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+
+ /**
+ * Remove the spending limit for the account.
+ *
+ * @example
+ * ```ts
+ * const spendingLimit =
+ * await client.aiGateway.billing.spendingLimit.delete({
+ * account_id: 'account_id',
+ * });
+ * ```
+ */
+ delete(
+ params: SpendingLimitDeleteParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ const { account_id } = params;
+ return (
+ this._client.delete(
+ `/accounts/${account_id}/ai-gateway/billing/spending-limit`,
+ options,
+ ) as Core.APIPromise<{ result: SpendingLimitDeleteResponse }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+
+ /**
+ * Retrieve the current spending limit configuration for the account.
+ *
+ * @example
+ * ```ts
+ * const spendingLimit =
+ * await client.aiGateway.billing.spendingLimit.get({
+ * account_id: 'account_id',
+ * });
+ * ```
+ */
+ get(
+ params: SpendingLimitGetParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ const { account_id } = params;
+ return (
+ this._client.get(
+ `/accounts/${account_id}/ai-gateway/billing/spending-limit`,
+ options,
+ ) as Core.APIPromise<{ result: SpendingLimitGetResponse }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+}
+
+export type SpendingLimitCreateResponse = unknown;
+
+export type SpendingLimitDeleteResponse = unknown;
+
+export interface SpendingLimitGetResponse {
+ config: SpendingLimitGetResponse.Config;
+
+ enabled: boolean;
+}
+
+export namespace SpendingLimitGetResponse {
+ export interface Config {
+ amount: number | null;
+
+ duration: string | null;
+
+ strategy: string | null;
+ }
+}
+
+export interface SpendingLimitCreateParams {
+ /**
+ * Path param: Cloudflare account ID.
+ */
+ account_id: string;
+
+ /**
+ * Body param: Spending limit amount in cents (min 100).
+ */
+ amount: number;
+
+ /**
+ * Body param: Spending limit duration.
+ */
+ duration: 'daily' | 'weekly' | 'monthly';
+
+ /**
+ * Body param: Spending limit strategy.
+ */
+ strategy: 'fixed' | 'sliding';
+}
+
+export interface SpendingLimitDeleteParams {
+ /**
+ * Cloudflare account ID.
+ */
+ account_id: string;
+}
+
+export interface SpendingLimitGetParams {
+ /**
+ * Cloudflare account ID.
+ */
+ account_id: string;
+}
+
+export declare namespace SpendingLimit {
+ export {
+ type SpendingLimitCreateResponse as SpendingLimitCreateResponse,
+ type SpendingLimitDeleteResponse as SpendingLimitDeleteResponse,
+ type SpendingLimitGetResponse as SpendingLimitGetResponse,
+ type SpendingLimitCreateParams as SpendingLimitCreateParams,
+ type SpendingLimitDeleteParams as SpendingLimitDeleteParams,
+ type SpendingLimitGetParams as SpendingLimitGetParams,
+ };
+}
diff --git a/src/resources/ai-gateway/billing/topup.ts b/src/resources/ai-gateway/billing/topup.ts
new file mode 100644
index 0000000000..fc403a44d5
--- /dev/null
+++ b/src/resources/ai-gateway/billing/topup.ts
@@ -0,0 +1,3 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+export * from './topup/index';
diff --git a/src/resources/ai-gateway/billing/topup/config.ts b/src/resources/ai-gateway/billing/topup/config.ts
new file mode 100644
index 0000000000..15b63f76fc
--- /dev/null
+++ b/src/resources/ai-gateway/billing/topup/config.ts
@@ -0,0 +1,133 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import { APIResource } from '../../../../resource';
+import * as Core from '../../../../core';
+
+export class Config extends APIResource {
+ /**
+ * Configure auto top-up with a balance threshold and top-up amount.
+ *
+ * @example
+ * ```ts
+ * const config =
+ * await client.aiGateway.billing.topup.config.create({
+ * account_id: 'account_id',
+ * amount: 5000,
+ * threshold: 500,
+ * });
+ * ```
+ */
+ create(params: ConfigCreateParams, options?: Core.RequestOptions): Core.APIPromise {
+ const { account_id, ...body } = params;
+ return (
+ this._client.post(`/accounts/${account_id}/ai-gateway/billing/topup/config`, {
+ body,
+ ...options,
+ }) as Core.APIPromise<{ result: ConfigCreateResponse }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+
+ /**
+ * Remove the auto top-up configuration for the account.
+ *
+ * @example
+ * ```ts
+ * const config =
+ * await client.aiGateway.billing.topup.config.delete({
+ * account_id: 'account_id',
+ * });
+ * ```
+ */
+ delete(params: ConfigDeleteParams, options?: Core.RequestOptions): Core.APIPromise {
+ const { account_id } = params;
+ return (
+ this._client.delete(
+ `/accounts/${account_id}/ai-gateway/billing/topup/config`,
+ options,
+ ) as Core.APIPromise<{ result: ConfigDeleteResponse }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+
+ /**
+ * Retrieve the current auto top-up threshold, amount, and any error state.
+ *
+ * @example
+ * ```ts
+ * const config =
+ * await client.aiGateway.billing.topup.config.get({
+ * account_id: 'account_id',
+ * });
+ * ```
+ */
+ get(params: ConfigGetParams, options?: Core.RequestOptions): Core.APIPromise {
+ const { account_id } = params;
+ return (
+ this._client.get(
+ `/accounts/${account_id}/ai-gateway/billing/topup/config`,
+ options,
+ ) as Core.APIPromise<{ result: ConfigGetResponse }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+}
+
+export interface ConfigCreateResponse {
+ amount: number;
+
+ threshold: number;
+}
+
+export type ConfigDeleteResponse = unknown;
+
+export interface ConfigGetResponse {
+ amount: number | null;
+
+ disabledReason: string | null;
+
+ error: string | null;
+
+ lastFailedAt: number | null;
+
+ threshold: number | null;
+}
+
+export interface ConfigCreateParams {
+ /**
+ * Path param: Cloudflare account ID.
+ */
+ account_id: string;
+
+ /**
+ * Body param: Auto top-up amount in cents (min 1000).
+ */
+ amount: number;
+
+ /**
+ * Body param: Balance threshold in cents that triggers auto top-up (min 500).
+ */
+ threshold: number;
+}
+
+export interface ConfigDeleteParams {
+ /**
+ * Cloudflare account ID.
+ */
+ account_id: string;
+}
+
+export interface ConfigGetParams {
+ /**
+ * Cloudflare account ID.
+ */
+ account_id: string;
+}
+
+export declare namespace Config {
+ export {
+ type ConfigCreateResponse as ConfigCreateResponse,
+ type ConfigDeleteResponse as ConfigDeleteResponse,
+ type ConfigGetResponse as ConfigGetResponse,
+ type ConfigCreateParams as ConfigCreateParams,
+ type ConfigDeleteParams as ConfigDeleteParams,
+ type ConfigGetParams as ConfigGetParams,
+ };
+}
diff --git a/src/resources/ai-gateway/billing/topup/index.ts b/src/resources/ai-gateway/billing/topup/index.ts
new file mode 100644
index 0000000000..cb58e9d912
--- /dev/null
+++ b/src/resources/ai-gateway/billing/topup/index.ts
@@ -0,0 +1,18 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+export {
+ Config,
+ type ConfigCreateResponse,
+ type ConfigDeleteResponse,
+ type ConfigGetResponse,
+ type ConfigCreateParams,
+ type ConfigDeleteParams,
+ type ConfigGetParams,
+} from './config';
+export {
+ Topup,
+ type TopupCreateResponse,
+ type TopupStatusResponse,
+ type TopupCreateParams,
+ type TopupStatusParams,
+} from './topup';
diff --git a/src/resources/ai-gateway/billing/topup/topup.ts b/src/resources/ai-gateway/billing/topup/topup.ts
new file mode 100644
index 0000000000..0df4d022ae
--- /dev/null
+++ b/src/resources/ai-gateway/billing/topup/topup.ts
@@ -0,0 +1,139 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import { APIResource } from '../../../../resource';
+import * as Core from '../../../../core';
+import * as ConfigAPI from './config';
+import {
+ Config,
+ ConfigCreateParams,
+ ConfigCreateResponse,
+ ConfigDeleteParams,
+ ConfigDeleteResponse,
+ ConfigGetParams,
+ ConfigGetResponse,
+} from './config';
+
+export class Topup extends APIResource {
+ config: ConfigAPI.Config = new ConfigAPI.Config(this._client);
+
+ /**
+ * Create a credit top-up via Stripe PaymentIntent for the given account.
+ *
+ * @example
+ * ```ts
+ * const topup = await client.aiGateway.billing.topup.create({
+ * account_id: 'account_id',
+ * amount: 5000,
+ * });
+ * ```
+ */
+ create(params: TopupCreateParams, options?: Core.RequestOptions): Core.APIPromise {
+ const { account_id, ...body } = params;
+ return (
+ this._client.post(`/accounts/${account_id}/ai-gateway/billing/topup`, {
+ body,
+ ...options,
+ }) as Core.APIPromise<{ result: TopupCreateResponse }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+
+ /**
+ * Get the payment processing status of a top-up by its invoice ID.
+ *
+ * @example
+ * ```ts
+ * const response =
+ * await client.aiGateway.billing.topup.status({
+ * account_id: 'account_id',
+ * payment_intent_id: 'in_1abc',
+ * });
+ * ```
+ */
+ status(params: TopupStatusParams, options?: Core.RequestOptions): Core.APIPromise {
+ const { account_id, ...body } = params;
+ return (
+ this._client.post(`/accounts/${account_id}/ai-gateway/billing/topup/status`, {
+ body,
+ ...options,
+ }) as Core.APIPromise<{ result: TopupStatusResponse }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+}
+
+export interface TopupCreateResponse {
+ /**
+ * Stripe PaymentIntent client secret.
+ */
+ client_secret: string | null;
+
+ /**
+ * Whether the user was already onboarded.
+ */
+ onboarding: boolean;
+
+ /**
+ * Stripe invoice ID.
+ */
+ payment_intent_id: string;
+
+ /**
+ * Card brand (visa, mastercard, etc.).
+ */
+ brand?: string;
+
+ /**
+ * Last 4 digits of card.
+ */
+ last4?: string;
+}
+
+export interface TopupStatusResponse {
+ payment_intent_id: string;
+
+ status: 'completed' | 'pending';
+}
+
+export interface TopupCreateParams {
+ /**
+ * Path param: Cloudflare account ID.
+ */
+ account_id: string;
+
+ /**
+ * Body param: Top-up amount in cents (min 1000).
+ */
+ amount: number;
+}
+
+export interface TopupStatusParams {
+ /**
+ * Path param: Cloudflare account ID.
+ */
+ account_id: string;
+
+ /**
+ * Body param: Stripe invoice ID to check status for.
+ */
+ payment_intent_id: string;
+}
+
+Topup.Config = Config;
+
+export declare namespace Topup {
+ export {
+ type TopupCreateResponse as TopupCreateResponse,
+ type TopupStatusResponse as TopupStatusResponse,
+ type TopupCreateParams as TopupCreateParams,
+ type TopupStatusParams as TopupStatusParams,
+ };
+
+ export {
+ Config as Config,
+ type ConfigCreateResponse as ConfigCreateResponse,
+ type ConfigDeleteResponse as ConfigDeleteResponse,
+ type ConfigGetResponse as ConfigGetResponse,
+ type ConfigCreateParams as ConfigCreateParams,
+ type ConfigDeleteParams as ConfigDeleteParams,
+ type ConfigGetParams as ConfigGetParams,
+ };
+}
diff --git a/src/resources/ai-gateway/index.ts b/src/resources/ai-gateway/index.ts
index 682de9f76b..7b9a3f9995 100644
--- a/src/resources/ai-gateway/index.ts
+++ b/src/resources/ai-gateway/index.ts
@@ -1,6 +1,17 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
export { AIGateway } from './ai-gateway';
+export {
+ Billing,
+ type BillingCreditBalanceResponse,
+ type BillingInvoiceHistoryResponse,
+ type BillingInvoicePreviewResponse,
+ type BillingUsageHistoryResponse,
+ type BillingCreditBalanceParams,
+ type BillingInvoiceHistoryParams,
+ type BillingInvoicePreviewParams,
+ type BillingUsageHistoryParams,
+} from './billing/index';
export {
DatasetListResponsesV4PagePaginationArray,
Datasets,
diff --git a/tests/api-resources/ai-gateway/billing/billing.test.ts b/tests/api-resources/ai-gateway/billing/billing.test.ts
new file mode 100644
index 0000000000..07fa0bfc25
--- /dev/null
+++ b/tests/api-resources/ai-gateway/billing/billing.test.ts
@@ -0,0 +1,80 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import Cloudflare from 'cloudflare';
+import { Response } from 'node-fetch';
+
+const client = new Cloudflare({
+ apiKey: '144c9defac04969c7bfad8efaa8ea194',
+ apiEmail: 'user@example.com',
+ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
+});
+
+describe('resource billing', () => {
+ test('creditBalance: only required params', async () => {
+ const responsePromise = client.aiGateway.billing.creditBalance({ account_id: 'account_id' });
+ 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);
+ });
+
+ test('creditBalance: required and optional params', async () => {
+ const response = await client.aiGateway.billing.creditBalance({ account_id: 'account_id' });
+ });
+
+ test('invoiceHistory: only required params', async () => {
+ const responsePromise = client.aiGateway.billing.invoiceHistory({ account_id: 'account_id' });
+ 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);
+ });
+
+ test('invoiceHistory: required and optional params', async () => {
+ const response = await client.aiGateway.billing.invoiceHistory({ account_id: 'account_id', type: 'all' });
+ });
+
+ test('invoicePreview: only required params', async () => {
+ const responsePromise = client.aiGateway.billing.invoicePreview({ account_id: 'account_id' });
+ 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);
+ });
+
+ test('invoicePreview: required and optional params', async () => {
+ const response = await client.aiGateway.billing.invoicePreview({ account_id: 'account_id' });
+ });
+
+ test('usageHistory: only required params', async () => {
+ const responsePromise = client.aiGateway.billing.usageHistory({
+ account_id: 'account_id',
+ value_grouping_window: 'day',
+ });
+ 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);
+ });
+
+ test('usageHistory: required and optional params', async () => {
+ const response = await client.aiGateway.billing.usageHistory({
+ account_id: 'account_id',
+ value_grouping_window: 'day',
+ end_time: 1700086400,
+ start_time: 1700000000,
+ });
+ });
+});
diff --git a/tests/api-resources/ai-gateway/billing/spending-limit.test.ts b/tests/api-resources/ai-gateway/billing/spending-limit.test.ts
new file mode 100644
index 0000000000..378a04725f
--- /dev/null
+++ b/tests/api-resources/ai-gateway/billing/spending-limit.test.ts
@@ -0,0 +1,67 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import Cloudflare from 'cloudflare';
+import { Response } from 'node-fetch';
+
+const client = new Cloudflare({
+ apiKey: '144c9defac04969c7bfad8efaa8ea194',
+ apiEmail: 'user@example.com',
+ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
+});
+
+describe('resource spendingLimit', () => {
+ test('create: only required params', async () => {
+ const responsePromise = client.aiGateway.billing.spendingLimit.create({
+ account_id: 'account_id',
+ amount: 10000,
+ duration: 'monthly',
+ strategy: 'fixed',
+ });
+ 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);
+ });
+
+ test('create: required and optional params', async () => {
+ const response = await client.aiGateway.billing.spendingLimit.create({
+ account_id: 'account_id',
+ amount: 10000,
+ duration: 'monthly',
+ strategy: 'fixed',
+ });
+ });
+
+ test('delete: only required params', async () => {
+ const responsePromise = client.aiGateway.billing.spendingLimit.delete({ account_id: 'account_id' });
+ 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);
+ });
+
+ test('delete: required and optional params', async () => {
+ const response = await client.aiGateway.billing.spendingLimit.delete({ account_id: 'account_id' });
+ });
+
+ test('get: only required params', async () => {
+ const responsePromise = client.aiGateway.billing.spendingLimit.get({ account_id: 'account_id' });
+ 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);
+ });
+
+ test('get: required and optional params', async () => {
+ const response = await client.aiGateway.billing.spendingLimit.get({ account_id: 'account_id' });
+ });
+});
diff --git a/tests/api-resources/ai-gateway/billing/topup/config.test.ts b/tests/api-resources/ai-gateway/billing/topup/config.test.ts
new file mode 100644
index 0000000000..10f62c6ac2
--- /dev/null
+++ b/tests/api-resources/ai-gateway/billing/topup/config.test.ts
@@ -0,0 +1,65 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import Cloudflare from 'cloudflare';
+import { Response } from 'node-fetch';
+
+const client = new Cloudflare({
+ apiKey: '144c9defac04969c7bfad8efaa8ea194',
+ apiEmail: 'user@example.com',
+ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
+});
+
+describe('resource config', () => {
+ test('create: only required params', async () => {
+ const responsePromise = client.aiGateway.billing.topup.config.create({
+ account_id: 'account_id',
+ amount: 5000,
+ threshold: 500,
+ });
+ 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);
+ });
+
+ test('create: required and optional params', async () => {
+ const response = await client.aiGateway.billing.topup.config.create({
+ account_id: 'account_id',
+ amount: 5000,
+ threshold: 500,
+ });
+ });
+
+ test('delete: only required params', async () => {
+ const responsePromise = client.aiGateway.billing.topup.config.delete({ account_id: 'account_id' });
+ 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);
+ });
+
+ test('delete: required and optional params', async () => {
+ const response = await client.aiGateway.billing.topup.config.delete({ account_id: 'account_id' });
+ });
+
+ test('get: only required params', async () => {
+ const responsePromise = client.aiGateway.billing.topup.config.get({ account_id: 'account_id' });
+ 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);
+ });
+
+ test('get: required and optional params', async () => {
+ const response = await client.aiGateway.billing.topup.config.get({ account_id: 'account_id' });
+ });
+});
diff --git a/tests/api-resources/ai-gateway/billing/topup/topup.test.ts b/tests/api-resources/ai-gateway/billing/topup/topup.test.ts
new file mode 100644
index 0000000000..612c2098a3
--- /dev/null
+++ b/tests/api-resources/ai-gateway/billing/topup/topup.test.ts
@@ -0,0 +1,48 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import Cloudflare from 'cloudflare';
+import { Response } from 'node-fetch';
+
+const client = new Cloudflare({
+ apiKey: '144c9defac04969c7bfad8efaa8ea194',
+ apiEmail: 'user@example.com',
+ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
+});
+
+describe('resource topup', () => {
+ test('create: only required params', async () => {
+ const responsePromise = client.aiGateway.billing.topup.create({ account_id: 'account_id', amount: 5000 });
+ 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);
+ });
+
+ test('create: required and optional params', async () => {
+ const response = await client.aiGateway.billing.topup.create({ account_id: 'account_id', amount: 5000 });
+ });
+
+ test('status: only required params', async () => {
+ const responsePromise = client.aiGateway.billing.topup.status({
+ account_id: 'account_id',
+ payment_intent_id: 'in_1abc',
+ });
+ 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);
+ });
+
+ test('status: required and optional params', async () => {
+ const response = await client.aiGateway.billing.topup.status({
+ account_id: 'account_id',
+ payment_intent_id: 'in_1abc',
+ });
+ });
+});
From c18247ec0effa88fa783cff44f9d3b59287eddde Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 6 May 2026 16:50:45 +0000
Subject: [PATCH 15/73] codegen metadata
---
.stats.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index fa4557fd0c..ab8c807038 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 2219
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
-openapi_spec_hash: 080c9cae915329f859d49062622da2f7
+openapi_spec_hash: bffae552c9187ab2f14f0c87039bdbab
config_hash: f450f135e11cc00980b6c05811e4988d
From 93bfc18c442817691c065d3e106b037ca8fcd829 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 6 May 2026 21:01:40 +0000
Subject: [PATCH 16/73] feat: chore: skip failing Go SDK tests for ai_gateway,
cache, load_balancers
* chore: skip failing Go SDK tests for ai_gateway, cache, load_balancers
---
.stats.yml | 2 +-
tests/api-resources/ai-gateway/billing/billing.test.ts | 6 ++++--
tests/api-resources/cache/origin-cloud-regions.test.ts | 6 ++++--
.../load-balancers/monitor-groups/monitor-groups.test.ts | 6 ++++--
4 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index ab8c807038..b887ef69c8 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 2219
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
openapi_spec_hash: bffae552c9187ab2f14f0c87039bdbab
-config_hash: f450f135e11cc00980b6c05811e4988d
+config_hash: f6fa3a155508fae2904b264233641e02
diff --git a/tests/api-resources/ai-gateway/billing/billing.test.ts b/tests/api-resources/ai-gateway/billing/billing.test.ts
index 07fa0bfc25..28994b39a0 100644
--- a/tests/api-resources/ai-gateway/billing/billing.test.ts
+++ b/tests/api-resources/ai-gateway/billing/billing.test.ts
@@ -10,7 +10,8 @@ const client = new Cloudflare({
});
describe('resource billing', () => {
- test('creditBalance: only required params', async () => {
+ // HTTP 404 error from prism -- route not in spec
+ test.skip('creditBalance: only required params', async () => {
const responsePromise = client.aiGateway.billing.creditBalance({ account_id: 'account_id' });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
@@ -21,7 +22,8 @@ describe('resource billing', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});
- test('creditBalance: required and optional params', async () => {
+ // HTTP 404 error from prism -- route not in spec
+ test.skip('creditBalance: required and optional params', async () => {
const response = await client.aiGateway.billing.creditBalance({ account_id: 'account_id' });
});
diff --git a/tests/api-resources/cache/origin-cloud-regions.test.ts b/tests/api-resources/cache/origin-cloud-regions.test.ts
index 4e9739877b..4bf496f305 100644
--- a/tests/api-resources/cache/origin-cloud-regions.test.ts
+++ b/tests/api-resources/cache/origin-cloud-regions.test.ts
@@ -10,7 +10,8 @@ const client = new Cloudflare({
});
describe('resource originCloudRegions', () => {
- test('update: only required params', async () => {
+ // HTTP 404 error from prism -- route not in spec
+ test.skip('update: only required params', async () => {
const responsePromise = client.cache.originCloudRegions.update('192.0.2.1', {
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
origin_ip: '192.0.2.1',
@@ -26,7 +27,8 @@ describe('resource originCloudRegions', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});
- test('update: required and optional params', async () => {
+ // HTTP 404 error from prism -- route not in spec
+ test.skip('update: required and optional params', async () => {
const response = await client.cache.originCloudRegions.update('192.0.2.1', {
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
origin_ip: '192.0.2.1',
diff --git a/tests/api-resources/load-balancers/monitor-groups/monitor-groups.test.ts b/tests/api-resources/load-balancers/monitor-groups/monitor-groups.test.ts
index 80a375dd05..1f1924e1cf 100644
--- a/tests/api-resources/load-balancers/monitor-groups/monitor-groups.test.ts
+++ b/tests/api-resources/load-balancers/monitor-groups/monitor-groups.test.ts
@@ -10,7 +10,8 @@ const client = new Cloudflare({
});
describe('resource monitorGroups', () => {
- test('create: only required params', async () => {
+ // HTTP 422 error from prism
+ test.skip('create: only required params', async () => {
const responsePromise = client.loadBalancers.monitorGroups.create({
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
description: 'Primary datacenter monitors',
@@ -32,7 +33,8 @@ describe('resource monitorGroups', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});
- test('create: required and optional params', async () => {
+ // HTTP 422 error from prism
+ test.skip('create: required and optional params', async () => {
const response = await client.loadBalancers.monitorGroups.create({
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
description: 'Primary datacenter monitors',
From 2e419b487230f2d5decfb497ff0d8050a972e800 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 6 May 2026 21:30:53 +0000
Subject: [PATCH 17/73] chore(api): update composite API spec
---
.stats.yml | 2 +-
src/resources/ai-gateway/billing/billing.ts | 4 ++--
tests/api-resources/ai-gateway/billing/billing.test.ts | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index b887ef69c8..ac1f553526 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 2219
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
-openapi_spec_hash: bffae552c9187ab2f14f0c87039bdbab
+openapi_spec_hash: 478ddecc51ea529014a89e20699fad90
config_hash: f6fa3a155508fae2904b264233641e02
diff --git a/src/resources/ai-gateway/billing/billing.ts b/src/resources/ai-gateway/billing/billing.ts
index 94fe30b4bd..c8da558ee7 100644
--- a/src/resources/ai-gateway/billing/billing.ts
+++ b/src/resources/ai-gateway/billing/billing.ts
@@ -318,12 +318,12 @@ export interface BillingUsageHistoryParams {
value_grouping_window: 'day' | 'hour';
/**
- * Query param: End time (Unix timestamp).
+ * Query param: End time as Unix timestamp in milliseconds.
*/
end_time?: number | null;
/**
- * Query param: Start time (Unix timestamp).
+ * Query param: Start time as Unix timestamp in milliseconds.
*/
start_time?: number | null;
}
diff --git a/tests/api-resources/ai-gateway/billing/billing.test.ts b/tests/api-resources/ai-gateway/billing/billing.test.ts
index 28994b39a0..6c1a9283d7 100644
--- a/tests/api-resources/ai-gateway/billing/billing.test.ts
+++ b/tests/api-resources/ai-gateway/billing/billing.test.ts
@@ -75,8 +75,8 @@ describe('resource billing', () => {
const response = await client.aiGateway.billing.usageHistory({
account_id: 'account_id',
value_grouping_window: 'day',
- end_time: 1700086400,
- start_time: 1700000000,
+ end_time: 1700086400000,
+ start_time: 1700000000000,
});
});
});
From 194ff00ebdae48a74047678cec93c323d99c260c Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 6 May 2026 21:35:51 +0000
Subject: [PATCH 18/73] chore(api): update composite API spec
---
.stats.yml | 4 +-
src/resources/cache/api.md | 2 +
src/resources/cache/cache.ts | 145 +++++++++++++++++++++++-
tests/api-resources/cache/cache.test.ts | 20 ++++
4 files changed, 166 insertions(+), 5 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index ac1f553526..02b1113a4b 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 2219
+configured_endpoints: 2220
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
-openapi_spec_hash: 478ddecc51ea529014a89e20699fad90
+openapi_spec_hash: 5f7d8a96b953cef8677dacffc249761d
config_hash: f6fa3a155508fae2904b264233641e02
diff --git a/src/resources/cache/api.md b/src/resources/cache/api.md
index 14e19f79a7..a6caf9ba23 100644
--- a/src/resources/cache/api.md
+++ b/src/resources/cache/api.md
@@ -3,10 +3,12 @@
Types:
- CachePurgeResponse
+- CachePurgeEnvironmentResponse
Methods:
- client.cache.purge({ ...params }) -> CachePurgeResponse | null
+- client.cache.purgeEnvironment(environmentId, { ...params }) -> CachePurgeEnvironmentResponse | null
## CacheReserve
diff --git a/src/resources/cache/cache.ts b/src/resources/cache/cache.ts
index 9b81afbac2..4e9ece1acf 100644
--- a/src/resources/cache/cache.ts
+++ b/src/resources/cache/cache.ts
@@ -111,7 +111,7 @@ export class Cache extends APIResource {
* Single file purge example with url and header pairs:
*
* ```
- * {"files": [{url: "http://www.example.com/cat_picture.jpg", headers: { "CF-IPCountry": "US", "CF-Device-Type": "desktop", "Accept-Language": "zh-CN" }}, {url: "http://www.example.com/dog_picture.jpg", headers: { "CF-IPCountry": "EU", "CF-Device-Type": "mobile", "Accept-Language": "en-US" }}]}
+ * {"files": [{"url": "http://www.example.com/cat_picture.jpg", "headers": {"CF-IPCountry": "US", "CF-Device-Type": "desktop", "Accept-Language": "zh-CN"}}, {"url": "http://www.example.com/dog_picture.jpg", "headers": {"CF-IPCountry": "EU", "CF-Device-Type": "mobile", "Accept-Language": "en-US"}}]}
* ```
*
* ### Purge Cached Content by Tag, Host or Prefix
@@ -139,7 +139,7 @@ export class Cache extends APIResource {
*
* ### Availability and limits
*
- * please refer to
+ * Please refer to
* [purge cache availability and limits documentation page](https://developers.cloudflare.com/cache/how-to/purge-cache/#availability-and-limits).
*
* @example
@@ -157,12 +157,48 @@ export class Cache extends APIResource {
}>
)._thenUnwrap((obj) => obj.result);
}
+
+ /**
+ * Purge cached content scoped to a specific environment. Supports the same purge
+ * types as the zone-level endpoint (purge everything, by URL, by tag, host, or
+ * prefix).
+ *
+ * ### Availability and limits
+ *
+ * Please refer to
+ * [purge cache availability and limits documentation page](https://developers.cloudflare.com/cache/how-to/purge-cache/#availability-and-limits).
+ *
+ * @example
+ * ```ts
+ * const response = await client.cache.purgeEnvironment(
+ * '023e105f4ecef8ad9ca31a8372d0c353',
+ * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
+ * );
+ * ```
+ */
+ purgeEnvironment(
+ environmentId: string,
+ params: CachePurgeEnvironmentParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ const { zone_id, ...body } = params;
+ return (
+ this._client.post(`/zones/${zone_id}/environments/${environmentId}/purge_cache`, {
+ body,
+ ...options,
+ }) as Core.APIPromise<{ result: CachePurgeEnvironmentResponse | null }>
+ )._thenUnwrap((obj) => obj.result);
+ }
}
export interface CachePurgeResponse {
id: string;
}
+export interface CachePurgeEnvironmentResponse {
+ id: string;
+}
+
export type CachePurgeParams =
| CachePurgeParams.CachePurgeFlexPurgeByTags
| CachePurgeParams.CachePurgeFlexPurgeByHostnames
@@ -261,6 +297,104 @@ export declare namespace CachePurgeParams {
}
}
+export type CachePurgeEnvironmentParams =
+ | CachePurgeEnvironmentParams.CachePurgeFlexPurgeByTags
+ | CachePurgeEnvironmentParams.CachePurgeFlexPurgeByHostnames
+ | CachePurgeEnvironmentParams.CachePurgeFlexPurgeByPrefixes
+ | CachePurgeEnvironmentParams.CachePurgeEverything
+ | CachePurgeEnvironmentParams.CachePurgeSingleFile
+ | CachePurgeEnvironmentParams.CachePurgeSingleFileWithURLAndHeaders;
+
+export declare namespace CachePurgeEnvironmentParams {
+ export interface CachePurgeFlexPurgeByTags {
+ /**
+ * Path param
+ */
+ zone_id: string;
+
+ /**
+ * Body param: For more information on cache tags and purging by tags, please refer
+ * to
+ * [purge by cache-tags documentation page](https://developers.cloudflare.com/cache/how-to/purge-cache/purge-by-tags/).
+ */
+ tags?: Array;
+ }
+
+ export interface CachePurgeFlexPurgeByHostnames {
+ /**
+ * Path param
+ */
+ zone_id: string;
+
+ /**
+ * Body param: For more information purging by hostnames, please refer to
+ * [purge by hostname documentation page](https://developers.cloudflare.com/cache/how-to/purge-cache/purge-by-hostname/).
+ */
+ hosts?: Array;
+ }
+
+ export interface CachePurgeFlexPurgeByPrefixes {
+ /**
+ * Path param
+ */
+ zone_id: string;
+
+ /**
+ * Body param: For more information on purging by prefixes, please refer to
+ * [purge by prefix documentation page](https://developers.cloudflare.com/cache/how-to/purge-cache/purge_by_prefix/).
+ */
+ prefixes?: Array;
+ }
+
+ export interface CachePurgeEverything {
+ /**
+ * Path param
+ */
+ zone_id: string;
+
+ /**
+ * Body param: For more information, please refer to
+ * [purge everything documentation page](https://developers.cloudflare.com/cache/how-to/purge-cache/purge-everything/).
+ */
+ purge_everything?: boolean;
+ }
+
+ export interface CachePurgeSingleFile {
+ /**
+ * Path param
+ */
+ zone_id: string;
+
+ /**
+ * Body param: For more information on purging files, please refer to
+ * [purge by single-file documentation page](https://developers.cloudflare.com/cache/how-to/purge-cache/purge-by-single-file/).
+ */
+ files?: Array;
+ }
+
+ export interface CachePurgeSingleFileWithURLAndHeaders {
+ /**
+ * Path param
+ */
+ zone_id: string;
+
+ /**
+ * Body param: For more information on purging files with URL and headers, please
+ * refer to
+ * [purge by single-file documentation page](https://developers.cloudflare.com/cache/how-to/purge-cache/purge-by-single-file/).
+ */
+ files?: Array;
+ }
+
+ export namespace CachePurgeSingleFileWithURLAndHeaders {
+ export interface File {
+ headers?: { [key: string]: string };
+
+ url?: string;
+ }
+ }
+}
+
Cache.CacheReserveResource = CacheReserveResource;
Cache.SmartTieredCache = SmartTieredCache;
Cache.Variants = Variants;
@@ -269,7 +403,12 @@ Cache.OriginCloudRegions = OriginCloudRegions;
Cache.OriginCloudRegionsV4PagePaginationArray = OriginCloudRegionsV4PagePaginationArray;
export declare namespace Cache {
- export { type CachePurgeResponse as CachePurgeResponse, type CachePurgeParams as CachePurgeParams };
+ export {
+ type CachePurgeResponse as CachePurgeResponse,
+ type CachePurgeEnvironmentResponse as CachePurgeEnvironmentResponse,
+ type CachePurgeParams as CachePurgeParams,
+ type CachePurgeEnvironmentParams as CachePurgeEnvironmentParams,
+ };
export {
CacheReserveResource as CacheReserveResource,
diff --git a/tests/api-resources/cache/cache.test.ts b/tests/api-resources/cache/cache.test.ts
index 5604143ce9..3ae5283a29 100644
--- a/tests/api-resources/cache/cache.test.ts
+++ b/tests/api-resources/cache/cache.test.ts
@@ -27,4 +27,24 @@ describe('resource cache', () => {
tags: ['a-cache-tag', 'another-cache-tag'],
});
});
+
+ test('purgeEnvironment: only required params', async () => {
+ const responsePromise = client.cache.purgeEnvironment('023e105f4ecef8ad9ca31a8372d0c353', {
+ zone_id: '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);
+ });
+
+ test('purgeEnvironment: required and optional params', async () => {
+ const response = await client.cache.purgeEnvironment('023e105f4ecef8ad9ca31a8372d0c353', {
+ zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
+ tags: ['a-cache-tag', 'another-cache-tag'],
+ });
+ });
});
From e54749dc53a0e61c28b0a4d2c5ddf7ff17affb02 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 7 May 2026 13:25:17 +0000
Subject: [PATCH 19/73] chore(api): update composite API spec
---
.stats.yml | 2 +-
src/resources/radar/quality/iqi.ts | 8 ++------
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 02b1113a4b..f5a1c43751 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 2220
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
-openapi_spec_hash: 5f7d8a96b953cef8677dacffc249761d
+openapi_spec_hash: 9a73d6e19fbf993950d4705e65c8e5f6
config_hash: f6fa3a155508fae2904b264233641e02
diff --git a/src/resources/radar/quality/iqi.ts b/src/resources/radar/quality/iqi.ts
index 1b6a968a5f..81a2f281af 100644
--- a/src/resources/radar/quality/iqi.ts
+++ b/src/resources/radar/quality/iqi.ts
@@ -318,13 +318,9 @@ export namespace IQITimeseriesGroupsResponse {
}
export interface Serie0 {
- p25: Array;
-
- p50: Array;
-
- p75: Array;
-
timestamps: Array;
+
+ [k: string]: Array | Array | undefined;
}
}
From 8749cd9e52fd74867d6ed1e73109c4f6e2b1a777 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 7 May 2026 15:47:11 +0000
Subject: [PATCH 20/73] codegen metadata
---
.stats.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index f5a1c43751..e117106b2f 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 2220
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
-openapi_spec_hash: 9a73d6e19fbf993950d4705e65c8e5f6
+openapi_spec_hash: 133defba7d0d08dc80ddcbbd587e0291
config_hash: f6fa3a155508fae2904b264233641e02
From 8ba9fb2e4e7ed08d118ae4593e52ab9d1cb940f6 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 7 May 2026 16:27:26 +0000
Subject: [PATCH 21/73] codegen metadata
---
.stats.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index e117106b2f..f063e47afa 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 2220
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
-openapi_spec_hash: 133defba7d0d08dc80ddcbbd587e0291
+openapi_spec_hash: e53e5e8a8b0247835b06484b4382e0c4
config_hash: f6fa3a155508fae2904b264233641e02
From a37e928d86087d6b7373aa2f6a9f175b88f1b2aa Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 7 May 2026 17:03:18 +0000
Subject: [PATCH 22/73] codegen metadata
---
.stats.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index f063e47afa..c46ee1d4e2 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 2220
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
openapi_spec_hash: e53e5e8a8b0247835b06484b4382e0c4
-config_hash: f6fa3a155508fae2904b264233641e02
+config_hash: cef856e42543e49d9b09cb9eac20dc9e
From 804b8d2b79fb5836e15fe1a2d35cfb518830ca7a Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 11 May 2026 06:08:39 +0000
Subject: [PATCH 23/73] chore(api): update composite API spec
---
.stats.yml | 2 +-
src/resources/ai-gateway/ai-gateway.ts | 423 ++++++++++++++++++
.../zero-trust/devices/fleet-status.ts | 5 +
.../zero-trust/dex/fleet-status/devices.ts | 5 +
.../zero-trust/dlp/entries/custom.ts | 103 +++--
.../zero-trust/dlp/entries/entries.ts | 121 +++--
.../zero-trust/dlp/entries/integration.ts | 103 +++--
.../zero-trust/dlp/entries/predefined.ts | 103 +++--
.../zero-trust/dlp/profiles/custom.ts | 36 ++
.../zero-trust/dlp/profiles/predefined.ts | 18 +
.../zero-trust/dlp/profiles/profiles.ts | 90 ++++
.../ai-gateway/ai-gateway.test.ts | 36 +-
12 files changed, 943 insertions(+), 102 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index c46ee1d4e2..5164ab07e1 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 2220
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
-openapi_spec_hash: e53e5e8a8b0247835b06484b4382e0c4
+openapi_spec_hash: 20525f5883d4d78be797dee296df1442
config_hash: cef856e42543e49d9b09cb9eac20dc9e
diff --git a/src/resources/ai-gateway/ai-gateway.ts b/src/resources/ai-gateway/ai-gateway.ts
index 1f67180455..31ec1cc2c9 100644
--- a/src/resources/ai-gateway/ai-gateway.ts
+++ b/src/resources/ai-gateway/ai-gateway.ts
@@ -273,6 +273,8 @@ export interface AIGatewayCreateResponse {
dlp?: AIGatewayCreateResponse.UnionMember0 | AIGatewayCreateResponse.UnionMember1;
+ guardrails?: AIGatewayCreateResponse.Guardrails | null;
+
is_default?: boolean;
log_management?: number | null;
@@ -344,6 +346,74 @@ export namespace AIGatewayCreateResponse {
}
}
+ export interface Guardrails {
+ prompt: Guardrails.Prompt;
+
+ response: Guardrails.Response;
+ }
+
+ export namespace Guardrails {
+ export interface Prompt {
+ P1?: 'FLAG' | 'BLOCK';
+
+ S1?: 'FLAG' | 'BLOCK';
+
+ S10?: 'FLAG' | 'BLOCK';
+
+ S11?: 'FLAG' | 'BLOCK';
+
+ S12?: 'FLAG' | 'BLOCK';
+
+ S13?: 'FLAG' | 'BLOCK';
+
+ S2?: 'FLAG' | 'BLOCK';
+
+ S3?: 'FLAG' | 'BLOCK';
+
+ S4?: 'FLAG' | 'BLOCK';
+
+ S5?: 'FLAG' | 'BLOCK';
+
+ S6?: 'FLAG' | 'BLOCK';
+
+ S7?: 'FLAG' | 'BLOCK';
+
+ S8?: 'FLAG' | 'BLOCK';
+
+ S9?: 'FLAG' | 'BLOCK';
+ }
+
+ export interface Response {
+ P1?: 'FLAG' | 'BLOCK';
+
+ S1?: 'FLAG' | 'BLOCK';
+
+ S10?: 'FLAG' | 'BLOCK';
+
+ S11?: 'FLAG' | 'BLOCK';
+
+ S12?: 'FLAG' | 'BLOCK';
+
+ S13?: 'FLAG' | 'BLOCK';
+
+ S2?: 'FLAG' | 'BLOCK';
+
+ S3?: 'FLAG' | 'BLOCK';
+
+ S4?: 'FLAG' | 'BLOCK';
+
+ S5?: 'FLAG' | 'BLOCK';
+
+ S6?: 'FLAG' | 'BLOCK';
+
+ S7?: 'FLAG' | 'BLOCK';
+
+ S8?: 'FLAG' | 'BLOCK';
+
+ S9?: 'FLAG' | 'BLOCK';
+ }
+ }
+
export interface Otel {
authorization: string;
@@ -391,6 +461,8 @@ export interface AIGatewayUpdateResponse {
dlp?: AIGatewayUpdateResponse.UnionMember0 | AIGatewayUpdateResponse.UnionMember1;
+ guardrails?: AIGatewayUpdateResponse.Guardrails | null;
+
is_default?: boolean;
log_management?: number | null;
@@ -462,6 +534,74 @@ export namespace AIGatewayUpdateResponse {
}
}
+ export interface Guardrails {
+ prompt: Guardrails.Prompt;
+
+ response: Guardrails.Response;
+ }
+
+ export namespace Guardrails {
+ export interface Prompt {
+ P1?: 'FLAG' | 'BLOCK';
+
+ S1?: 'FLAG' | 'BLOCK';
+
+ S10?: 'FLAG' | 'BLOCK';
+
+ S11?: 'FLAG' | 'BLOCK';
+
+ S12?: 'FLAG' | 'BLOCK';
+
+ S13?: 'FLAG' | 'BLOCK';
+
+ S2?: 'FLAG' | 'BLOCK';
+
+ S3?: 'FLAG' | 'BLOCK';
+
+ S4?: 'FLAG' | 'BLOCK';
+
+ S5?: 'FLAG' | 'BLOCK';
+
+ S6?: 'FLAG' | 'BLOCK';
+
+ S7?: 'FLAG' | 'BLOCK';
+
+ S8?: 'FLAG' | 'BLOCK';
+
+ S9?: 'FLAG' | 'BLOCK';
+ }
+
+ export interface Response {
+ P1?: 'FLAG' | 'BLOCK';
+
+ S1?: 'FLAG' | 'BLOCK';
+
+ S10?: 'FLAG' | 'BLOCK';
+
+ S11?: 'FLAG' | 'BLOCK';
+
+ S12?: 'FLAG' | 'BLOCK';
+
+ S13?: 'FLAG' | 'BLOCK';
+
+ S2?: 'FLAG' | 'BLOCK';
+
+ S3?: 'FLAG' | 'BLOCK';
+
+ S4?: 'FLAG' | 'BLOCK';
+
+ S5?: 'FLAG' | 'BLOCK';
+
+ S6?: 'FLAG' | 'BLOCK';
+
+ S7?: 'FLAG' | 'BLOCK';
+
+ S8?: 'FLAG' | 'BLOCK';
+
+ S9?: 'FLAG' | 'BLOCK';
+ }
+ }
+
export interface Otel {
authorization: string;
@@ -509,6 +649,8 @@ export interface AIGatewayListResponse {
dlp?: AIGatewayListResponse.UnionMember0 | AIGatewayListResponse.UnionMember1;
+ guardrails?: AIGatewayListResponse.Guardrails | null;
+
is_default?: boolean;
log_management?: number | null;
@@ -580,6 +722,74 @@ export namespace AIGatewayListResponse {
}
}
+ export interface Guardrails {
+ prompt: Guardrails.Prompt;
+
+ response: Guardrails.Response;
+ }
+
+ export namespace Guardrails {
+ export interface Prompt {
+ P1?: 'FLAG' | 'BLOCK';
+
+ S1?: 'FLAG' | 'BLOCK';
+
+ S10?: 'FLAG' | 'BLOCK';
+
+ S11?: 'FLAG' | 'BLOCK';
+
+ S12?: 'FLAG' | 'BLOCK';
+
+ S13?: 'FLAG' | 'BLOCK';
+
+ S2?: 'FLAG' | 'BLOCK';
+
+ S3?: 'FLAG' | 'BLOCK';
+
+ S4?: 'FLAG' | 'BLOCK';
+
+ S5?: 'FLAG' | 'BLOCK';
+
+ S6?: 'FLAG' | 'BLOCK';
+
+ S7?: 'FLAG' | 'BLOCK';
+
+ S8?: 'FLAG' | 'BLOCK';
+
+ S9?: 'FLAG' | 'BLOCK';
+ }
+
+ export interface Response {
+ P1?: 'FLAG' | 'BLOCK';
+
+ S1?: 'FLAG' | 'BLOCK';
+
+ S10?: 'FLAG' | 'BLOCK';
+
+ S11?: 'FLAG' | 'BLOCK';
+
+ S12?: 'FLAG' | 'BLOCK';
+
+ S13?: 'FLAG' | 'BLOCK';
+
+ S2?: 'FLAG' | 'BLOCK';
+
+ S3?: 'FLAG' | 'BLOCK';
+
+ S4?: 'FLAG' | 'BLOCK';
+
+ S5?: 'FLAG' | 'BLOCK';
+
+ S6?: 'FLAG' | 'BLOCK';
+
+ S7?: 'FLAG' | 'BLOCK';
+
+ S8?: 'FLAG' | 'BLOCK';
+
+ S9?: 'FLAG' | 'BLOCK';
+ }
+ }
+
export interface Otel {
authorization: string;
@@ -627,6 +837,8 @@ export interface AIGatewayDeleteResponse {
dlp?: AIGatewayDeleteResponse.UnionMember0 | AIGatewayDeleteResponse.UnionMember1;
+ guardrails?: AIGatewayDeleteResponse.Guardrails | null;
+
is_default?: boolean;
log_management?: number | null;
@@ -698,6 +910,74 @@ export namespace AIGatewayDeleteResponse {
}
}
+ export interface Guardrails {
+ prompt: Guardrails.Prompt;
+
+ response: Guardrails.Response;
+ }
+
+ export namespace Guardrails {
+ export interface Prompt {
+ P1?: 'FLAG' | 'BLOCK';
+
+ S1?: 'FLAG' | 'BLOCK';
+
+ S10?: 'FLAG' | 'BLOCK';
+
+ S11?: 'FLAG' | 'BLOCK';
+
+ S12?: 'FLAG' | 'BLOCK';
+
+ S13?: 'FLAG' | 'BLOCK';
+
+ S2?: 'FLAG' | 'BLOCK';
+
+ S3?: 'FLAG' | 'BLOCK';
+
+ S4?: 'FLAG' | 'BLOCK';
+
+ S5?: 'FLAG' | 'BLOCK';
+
+ S6?: 'FLAG' | 'BLOCK';
+
+ S7?: 'FLAG' | 'BLOCK';
+
+ S8?: 'FLAG' | 'BLOCK';
+
+ S9?: 'FLAG' | 'BLOCK';
+ }
+
+ export interface Response {
+ P1?: 'FLAG' | 'BLOCK';
+
+ S1?: 'FLAG' | 'BLOCK';
+
+ S10?: 'FLAG' | 'BLOCK';
+
+ S11?: 'FLAG' | 'BLOCK';
+
+ S12?: 'FLAG' | 'BLOCK';
+
+ S13?: 'FLAG' | 'BLOCK';
+
+ S2?: 'FLAG' | 'BLOCK';
+
+ S3?: 'FLAG' | 'BLOCK';
+
+ S4?: 'FLAG' | 'BLOCK';
+
+ S5?: 'FLAG' | 'BLOCK';
+
+ S6?: 'FLAG' | 'BLOCK';
+
+ S7?: 'FLAG' | 'BLOCK';
+
+ S8?: 'FLAG' | 'BLOCK';
+
+ S9?: 'FLAG' | 'BLOCK';
+ }
+ }
+
export interface Otel {
authorization: string;
@@ -745,6 +1025,8 @@ export interface AIGatewayGetResponse {
dlp?: AIGatewayGetResponse.UnionMember0 | AIGatewayGetResponse.UnionMember1;
+ guardrails?: AIGatewayGetResponse.Guardrails | null;
+
is_default?: boolean;
log_management?: number | null;
@@ -816,6 +1098,74 @@ export namespace AIGatewayGetResponse {
}
}
+ export interface Guardrails {
+ prompt: Guardrails.Prompt;
+
+ response: Guardrails.Response;
+ }
+
+ export namespace Guardrails {
+ export interface Prompt {
+ P1?: 'FLAG' | 'BLOCK';
+
+ S1?: 'FLAG' | 'BLOCK';
+
+ S10?: 'FLAG' | 'BLOCK';
+
+ S11?: 'FLAG' | 'BLOCK';
+
+ S12?: 'FLAG' | 'BLOCK';
+
+ S13?: 'FLAG' | 'BLOCK';
+
+ S2?: 'FLAG' | 'BLOCK';
+
+ S3?: 'FLAG' | 'BLOCK';
+
+ S4?: 'FLAG' | 'BLOCK';
+
+ S5?: 'FLAG' | 'BLOCK';
+
+ S6?: 'FLAG' | 'BLOCK';
+
+ S7?: 'FLAG' | 'BLOCK';
+
+ S8?: 'FLAG' | 'BLOCK';
+
+ S9?: 'FLAG' | 'BLOCK';
+ }
+
+ export interface Response {
+ P1?: 'FLAG' | 'BLOCK';
+
+ S1?: 'FLAG' | 'BLOCK';
+
+ S10?: 'FLAG' | 'BLOCK';
+
+ S11?: 'FLAG' | 'BLOCK';
+
+ S12?: 'FLAG' | 'BLOCK';
+
+ S13?: 'FLAG' | 'BLOCK';
+
+ S2?: 'FLAG' | 'BLOCK';
+
+ S3?: 'FLAG' | 'BLOCK';
+
+ S4?: 'FLAG' | 'BLOCK';
+
+ S5?: 'FLAG' | 'BLOCK';
+
+ S6?: 'FLAG' | 'BLOCK';
+
+ S7?: 'FLAG' | 'BLOCK';
+
+ S8?: 'FLAG' | 'BLOCK';
+
+ S9?: 'FLAG' | 'BLOCK';
+ }
+ }
+
export interface Otel {
authorization: string;
@@ -973,6 +1323,11 @@ export interface AIGatewayUpdateParams {
*/
dlp?: AIGatewayUpdateParams.UnionMember0 | AIGatewayUpdateParams.UnionMember1;
+ /**
+ * Body param
+ */
+ guardrails?: AIGatewayUpdateParams.Guardrails | null;
+
/**
* Body param
*/
@@ -1069,6 +1424,74 @@ export namespace AIGatewayUpdateParams {
}
}
+ export interface Guardrails {
+ prompt: Guardrails.Prompt;
+
+ response: Guardrails.Response;
+ }
+
+ export namespace Guardrails {
+ export interface Prompt {
+ P1?: 'FLAG' | 'BLOCK';
+
+ S1?: 'FLAG' | 'BLOCK';
+
+ S10?: 'FLAG' | 'BLOCK';
+
+ S11?: 'FLAG' | 'BLOCK';
+
+ S12?: 'FLAG' | 'BLOCK';
+
+ S13?: 'FLAG' | 'BLOCK';
+
+ S2?: 'FLAG' | 'BLOCK';
+
+ S3?: 'FLAG' | 'BLOCK';
+
+ S4?: 'FLAG' | 'BLOCK';
+
+ S5?: 'FLAG' | 'BLOCK';
+
+ S6?: 'FLAG' | 'BLOCK';
+
+ S7?: 'FLAG' | 'BLOCK';
+
+ S8?: 'FLAG' | 'BLOCK';
+
+ S9?: 'FLAG' | 'BLOCK';
+ }
+
+ export interface Response {
+ P1?: 'FLAG' | 'BLOCK';
+
+ S1?: 'FLAG' | 'BLOCK';
+
+ S10?: 'FLAG' | 'BLOCK';
+
+ S11?: 'FLAG' | 'BLOCK';
+
+ S12?: 'FLAG' | 'BLOCK';
+
+ S13?: 'FLAG' | 'BLOCK';
+
+ S2?: 'FLAG' | 'BLOCK';
+
+ S3?: 'FLAG' | 'BLOCK';
+
+ S4?: 'FLAG' | 'BLOCK';
+
+ S5?: 'FLAG' | 'BLOCK';
+
+ S6?: 'FLAG' | 'BLOCK';
+
+ S7?: 'FLAG' | 'BLOCK';
+
+ S8?: 'FLAG' | 'BLOCK';
+
+ S9?: 'FLAG' | 'BLOCK';
+ }
+ }
+
export interface Otel {
authorization: string;
diff --git a/src/resources/zero-trust/devices/fleet-status.ts b/src/resources/zero-trust/devices/fleet-status.ts
index efc676cc04..9da3d09bfe 100644
--- a/src/resources/zero-trust/devices/fleet-status.ts
+++ b/src/resources/zero-trust/devices/fleet-status.ts
@@ -92,6 +92,11 @@ export interface FleetStatusGetResponse {
*/
deviceName?: string;
+ /**
+ * @deprecated Use `registrationId` instead.
+ */
+ deviceRegistration?: string | null;
+
diskReadBps?: number | null;
diskUsagePct?: number | null;
diff --git a/src/resources/zero-trust/dex/fleet-status/devices.ts b/src/resources/zero-trust/dex/fleet-status/devices.ts
index ad81ea9c5e..53aae83850 100644
--- a/src/resources/zero-trust/dex/fleet-status/devices.ts
+++ b/src/resources/zero-trust/dex/fleet-status/devices.ts
@@ -98,6 +98,11 @@ export interface DeviceListResponse {
*/
deviceName?: string;
+ /**
+ * @deprecated Use `registrationId` instead.
+ */
+ deviceRegistration?: string | null;
+
diskReadBps?: number | null;
diskUsagePct?: number | null;
diff --git a/src/resources/zero-trust/dlp/entries/custom.ts b/src/resources/zero-trust/dlp/entries/custom.ts
index 212d218bd0..7765d3fb45 100644
--- a/src/resources/zero-trust/dlp/entries/custom.ts
+++ b/src/resources/zero-trust/dlp/entries/custom.ts
@@ -192,7 +192,8 @@ export type CustomListResponse =
| CustomListResponse.UnionMember2
| CustomListResponse.UnionMember3
| CustomListResponse.UnionMember4
- | CustomListResponse.UnionMember5;
+ | CustomListResponse.UnionMember5
+ | CustomListResponse.UnionMember6;
export namespace CustomListResponse {
export interface UnionMember0 {
@@ -226,7 +227,26 @@ export namespace CustomListResponse {
export interface UnionMember1 {
id: string;
- confidence: UnionMember1.Confidence;
+ created_at: string;
+
+ /**
+ * @deprecated
+ */
+ enabled: boolean;
+
+ name: string;
+
+ type: 'custom_prompt_topic';
+
+ updated_at: string;
+
+ upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
+ }
+
+ export interface UnionMember2 {
+ id: string;
+
+ confidence: UnionMember2.Confidence;
enabled: boolean;
@@ -244,10 +264,10 @@ export namespace CustomListResponse {
/**
* A Predefined AI prompt classification topic entry.
*/
- variant?: UnionMember1.UnionMember0 | UnionMember1.UnionMember1;
+ variant?: UnionMember2.UnionMember0 | UnionMember2.UnionMember1;
}
- export namespace UnionMember1 {
+ export namespace UnionMember2 {
export interface Confidence {
/**
* Indicates whether this entry has AI remote service validation.
@@ -289,7 +309,7 @@ export namespace CustomListResponse {
}
}
- export interface UnionMember2 {
+ export interface UnionMember3 {
id: string;
created_at: string;
@@ -307,7 +327,7 @@ export namespace CustomListResponse {
upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
}
- export interface UnionMember3 {
+ export interface UnionMember4 {
id: string;
/**
@@ -331,7 +351,7 @@ export namespace CustomListResponse {
upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
}
- export interface UnionMember4 {
+ export interface UnionMember5 {
id: string;
created_at: string;
@@ -347,7 +367,7 @@ export namespace CustomListResponse {
upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
}
- export interface UnionMember5 {
+ export interface UnionMember6 {
id: string;
created_at: string;
@@ -376,7 +396,8 @@ export type CustomGetResponse =
| CustomGetResponse.UnionMember2
| CustomGetResponse.UnionMember3
| CustomGetResponse.UnionMember4
- | CustomGetResponse.UnionMember5;
+ | CustomGetResponse.UnionMember5
+ | CustomGetResponse.UnionMember6;
export namespace CustomGetResponse {
export interface UnionMember0 {
@@ -423,7 +444,39 @@ export namespace CustomGetResponse {
export interface UnionMember1 {
id: string;
- confidence: UnionMember1.Confidence;
+ created_at: string;
+
+ /**
+ * @deprecated
+ */
+ enabled: boolean;
+
+ name: string;
+
+ type: 'custom_prompt_topic';
+
+ updated_at: string;
+
+ profiles?: Array;
+
+ upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
+ }
+
+ export namespace UnionMember1 {
+ /**
+ * Computed entry field for a profile that an entry is shared into.
+ */
+ export interface Profile {
+ id: string;
+
+ name: string;
+ }
+ }
+
+ export interface UnionMember2 {
+ id: string;
+
+ confidence: UnionMember2.Confidence;
enabled: boolean;
@@ -436,17 +489,17 @@ export namespace CustomGetResponse {
*/
profile_id?: string | null;
- profiles?: Array;
+ profiles?: Array;
upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
/**
* A Predefined AI prompt classification topic entry.
*/
- variant?: UnionMember1.UnionMember0 | UnionMember1.UnionMember1;
+ variant?: UnionMember2.UnionMember0 | UnionMember2.UnionMember1;
}
- export namespace UnionMember1 {
+ export namespace UnionMember2 {
export interface Confidence {
/**
* Indicates whether this entry has AI remote service validation.
@@ -497,7 +550,7 @@ export namespace CustomGetResponse {
}
}
- export interface UnionMember2 {
+ export interface UnionMember3 {
id: string;
created_at: string;
@@ -512,12 +565,12 @@ export namespace CustomGetResponse {
profile_id?: string | null;
- profiles?: Array;
+ profiles?: Array;
upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
}
- export namespace UnionMember2 {
+ export namespace UnionMember3 {
/**
* Computed entry field for a profile that an entry is shared into.
*/
@@ -528,7 +581,7 @@ export namespace CustomGetResponse {
}
}
- export interface UnionMember3 {
+ export interface UnionMember4 {
id: string;
/**
@@ -549,12 +602,12 @@ export namespace CustomGetResponse {
updated_at: string;
- profiles?: Array;
+ profiles?: Array;
upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
}
- export namespace UnionMember3 {
+ export namespace UnionMember4 {
/**
* Computed entry field for a profile that an entry is shared into.
*/
@@ -565,7 +618,7 @@ export namespace CustomGetResponse {
}
}
- export interface UnionMember4 {
+ export interface UnionMember5 {
id: string;
created_at: string;
@@ -578,12 +631,12 @@ export namespace CustomGetResponse {
updated_at: string;
- profiles?: Array;
+ profiles?: Array;
upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
}
- export namespace UnionMember4 {
+ export namespace UnionMember5 {
/**
* Computed entry field for a profile that an entry is shared into.
*/
@@ -594,7 +647,7 @@ export namespace CustomGetResponse {
}
}
- export interface UnionMember5 {
+ export interface UnionMember6 {
id: string;
created_at: string;
@@ -611,12 +664,12 @@ export namespace CustomGetResponse {
profile_id?: string | null;
- profiles?: Array;
+ profiles?: Array;
upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
}
- export namespace UnionMember5 {
+ export namespace UnionMember6 {
/**
* Computed entry field for a profile that an entry is shared into.
*/
diff --git a/src/resources/zero-trust/dlp/entries/entries.ts b/src/resources/zero-trust/dlp/entries/entries.ts
index e20ee525e9..47853f011d 100644
--- a/src/resources/zero-trust/dlp/entries/entries.ts
+++ b/src/resources/zero-trust/dlp/entries/entries.ts
@@ -209,6 +209,7 @@ export interface EntryCreateResponse {
export type EntryUpdateResponse =
| EntryUpdateResponse.CustomEntry
+ | EntryUpdateResponse.CustomPromptTopicEntry
| EntryUpdateResponse.PredefinedEntry
| EntryUpdateResponse.IntegrationEntry
| EntryUpdateResponse.ExactDataEntry
@@ -242,6 +243,23 @@ export namespace EntryUpdateResponse {
profile_id?: string | null;
}
+ export interface CustomPromptTopicEntry {
+ id: string;
+
+ created_at: string;
+
+ /**
+ * @deprecated
+ */
+ enabled: boolean;
+
+ name: string;
+
+ type: 'custom_prompt_topic';
+
+ updated_at: string;
+ }
+
export interface PredefinedEntry {
id: string;
@@ -383,7 +401,8 @@ export type EntryListResponse =
| EntryListResponse.UnionMember2
| EntryListResponse.UnionMember3
| EntryListResponse.UnionMember4
- | EntryListResponse.UnionMember5;
+ | EntryListResponse.UnionMember5
+ | EntryListResponse.UnionMember6;
export namespace EntryListResponse {
export interface UnionMember0 {
@@ -417,7 +436,26 @@ export namespace EntryListResponse {
export interface UnionMember1 {
id: string;
- confidence: UnionMember1.Confidence;
+ created_at: string;
+
+ /**
+ * @deprecated
+ */
+ enabled: boolean;
+
+ name: string;
+
+ type: 'custom_prompt_topic';
+
+ updated_at: string;
+
+ upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
+ }
+
+ export interface UnionMember2 {
+ id: string;
+
+ confidence: UnionMember2.Confidence;
enabled: boolean;
@@ -435,10 +473,10 @@ export namespace EntryListResponse {
/**
* A Predefined AI prompt classification topic entry.
*/
- variant?: UnionMember1.UnionMember0 | UnionMember1.UnionMember1;
+ variant?: UnionMember2.UnionMember0 | UnionMember2.UnionMember1;
}
- export namespace UnionMember1 {
+ export namespace UnionMember2 {
export interface Confidence {
/**
* Indicates whether this entry has AI remote service validation.
@@ -480,7 +518,7 @@ export namespace EntryListResponse {
}
}
- export interface UnionMember2 {
+ export interface UnionMember3 {
id: string;
created_at: string;
@@ -498,7 +536,7 @@ export namespace EntryListResponse {
upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
}
- export interface UnionMember3 {
+ export interface UnionMember4 {
id: string;
/**
@@ -522,7 +560,7 @@ export namespace EntryListResponse {
upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
}
- export interface UnionMember4 {
+ export interface UnionMember5 {
id: string;
created_at: string;
@@ -538,7 +576,7 @@ export namespace EntryListResponse {
upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
}
- export interface UnionMember5 {
+ export interface UnionMember6 {
id: string;
created_at: string;
@@ -567,7 +605,8 @@ export type EntryGetResponse =
| EntryGetResponse.UnionMember2
| EntryGetResponse.UnionMember3
| EntryGetResponse.UnionMember4
- | EntryGetResponse.UnionMember5;
+ | EntryGetResponse.UnionMember5
+ | EntryGetResponse.UnionMember6;
export namespace EntryGetResponse {
export interface UnionMember0 {
@@ -614,7 +653,39 @@ export namespace EntryGetResponse {
export interface UnionMember1 {
id: string;
- confidence: UnionMember1.Confidence;
+ created_at: string;
+
+ /**
+ * @deprecated
+ */
+ enabled: boolean;
+
+ name: string;
+
+ type: 'custom_prompt_topic';
+
+ updated_at: string;
+
+ profiles?: Array;
+
+ upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
+ }
+
+ export namespace UnionMember1 {
+ /**
+ * Computed entry field for a profile that an entry is shared into.
+ */
+ export interface Profile {
+ id: string;
+
+ name: string;
+ }
+ }
+
+ export interface UnionMember2 {
+ id: string;
+
+ confidence: UnionMember2.Confidence;
enabled: boolean;
@@ -627,17 +698,17 @@ export namespace EntryGetResponse {
*/
profile_id?: string | null;
- profiles?: Array;
+ profiles?: Array;
upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
/**
* A Predefined AI prompt classification topic entry.
*/
- variant?: UnionMember1.UnionMember0 | UnionMember1.UnionMember1;
+ variant?: UnionMember2.UnionMember0 | UnionMember2.UnionMember1;
}
- export namespace UnionMember1 {
+ export namespace UnionMember2 {
export interface Confidence {
/**
* Indicates whether this entry has AI remote service validation.
@@ -688,7 +759,7 @@ export namespace EntryGetResponse {
}
}
- export interface UnionMember2 {
+ export interface UnionMember3 {
id: string;
created_at: string;
@@ -703,12 +774,12 @@ export namespace EntryGetResponse {
profile_id?: string | null;
- profiles?: Array;
+ profiles?: Array;
upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
}
- export namespace UnionMember2 {
+ export namespace UnionMember3 {
/**
* Computed entry field for a profile that an entry is shared into.
*/
@@ -719,7 +790,7 @@ export namespace EntryGetResponse {
}
}
- export interface UnionMember3 {
+ export interface UnionMember4 {
id: string;
/**
@@ -740,12 +811,12 @@ export namespace EntryGetResponse {
updated_at: string;
- profiles?: Array;
+ profiles?: Array;
upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
}
- export namespace UnionMember3 {
+ export namespace UnionMember4 {
/**
* Computed entry field for a profile that an entry is shared into.
*/
@@ -756,7 +827,7 @@ export namespace EntryGetResponse {
}
}
- export interface UnionMember4 {
+ export interface UnionMember5 {
id: string;
created_at: string;
@@ -769,12 +840,12 @@ export namespace EntryGetResponse {
updated_at: string;
- profiles?: Array;
+ profiles?: Array;
upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
}
- export namespace UnionMember4 {
+ export namespace UnionMember5 {
/**
* Computed entry field for a profile that an entry is shared into.
*/
@@ -785,7 +856,7 @@ export namespace EntryGetResponse {
}
}
- export interface UnionMember5 {
+ export interface UnionMember6 {
id: string;
created_at: string;
@@ -802,12 +873,12 @@ export namespace EntryGetResponse {
profile_id?: string | null;
- profiles?: Array;
+ profiles?: Array;
upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
}
- export namespace UnionMember5 {
+ export namespace UnionMember6 {
/**
* Computed entry field for a profile that an entry is shared into.
*/
diff --git a/src/resources/zero-trust/dlp/entries/integration.ts b/src/resources/zero-trust/dlp/entries/integration.ts
index 60ab3773b5..fe76a4b724 100644
--- a/src/resources/zero-trust/dlp/entries/integration.ts
+++ b/src/resources/zero-trust/dlp/entries/integration.ts
@@ -173,7 +173,8 @@ export type IntegrationListResponse =
| IntegrationListResponse.UnionMember2
| IntegrationListResponse.UnionMember3
| IntegrationListResponse.UnionMember4
- | IntegrationListResponse.UnionMember5;
+ | IntegrationListResponse.UnionMember5
+ | IntegrationListResponse.UnionMember6;
export namespace IntegrationListResponse {
export interface UnionMember0 {
@@ -207,7 +208,26 @@ export namespace IntegrationListResponse {
export interface UnionMember1 {
id: string;
- confidence: UnionMember1.Confidence;
+ created_at: string;
+
+ /**
+ * @deprecated
+ */
+ enabled: boolean;
+
+ name: string;
+
+ type: 'custom_prompt_topic';
+
+ updated_at: string;
+
+ upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
+ }
+
+ export interface UnionMember2 {
+ id: string;
+
+ confidence: UnionMember2.Confidence;
enabled: boolean;
@@ -225,10 +245,10 @@ export namespace IntegrationListResponse {
/**
* A Predefined AI prompt classification topic entry.
*/
- variant?: UnionMember1.UnionMember0 | UnionMember1.UnionMember1;
+ variant?: UnionMember2.UnionMember0 | UnionMember2.UnionMember1;
}
- export namespace UnionMember1 {
+ export namespace UnionMember2 {
export interface Confidence {
/**
* Indicates whether this entry has AI remote service validation.
@@ -270,7 +290,7 @@ export namespace IntegrationListResponse {
}
}
- export interface UnionMember2 {
+ export interface UnionMember3 {
id: string;
created_at: string;
@@ -288,7 +308,7 @@ export namespace IntegrationListResponse {
upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
}
- export interface UnionMember3 {
+ export interface UnionMember4 {
id: string;
/**
@@ -312,7 +332,7 @@ export namespace IntegrationListResponse {
upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
}
- export interface UnionMember4 {
+ export interface UnionMember5 {
id: string;
created_at: string;
@@ -328,7 +348,7 @@ export namespace IntegrationListResponse {
upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
}
- export interface UnionMember5 {
+ export interface UnionMember6 {
id: string;
created_at: string;
@@ -357,7 +377,8 @@ export type IntegrationGetResponse =
| IntegrationGetResponse.UnionMember2
| IntegrationGetResponse.UnionMember3
| IntegrationGetResponse.UnionMember4
- | IntegrationGetResponse.UnionMember5;
+ | IntegrationGetResponse.UnionMember5
+ | IntegrationGetResponse.UnionMember6;
export namespace IntegrationGetResponse {
export interface UnionMember0 {
@@ -404,7 +425,39 @@ export namespace IntegrationGetResponse {
export interface UnionMember1 {
id: string;
- confidence: UnionMember1.Confidence;
+ created_at: string;
+
+ /**
+ * @deprecated
+ */
+ enabled: boolean;
+
+ name: string;
+
+ type: 'custom_prompt_topic';
+
+ updated_at: string;
+
+ profiles?: Array;
+
+ upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
+ }
+
+ export namespace UnionMember1 {
+ /**
+ * Computed entry field for a profile that an entry is shared into.
+ */
+ export interface Profile {
+ id: string;
+
+ name: string;
+ }
+ }
+
+ export interface UnionMember2 {
+ id: string;
+
+ confidence: UnionMember2.Confidence;
enabled: boolean;
@@ -417,17 +470,17 @@ export namespace IntegrationGetResponse {
*/
profile_id?: string | null;
- profiles?: Array;
+ profiles?: Array;
upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
/**
* A Predefined AI prompt classification topic entry.
*/
- variant?: UnionMember1.UnionMember0 | UnionMember1.UnionMember1;
+ variant?: UnionMember2.UnionMember0 | UnionMember2.UnionMember1;
}
- export namespace UnionMember1 {
+ export namespace UnionMember2 {
export interface Confidence {
/**
* Indicates whether this entry has AI remote service validation.
@@ -478,7 +531,7 @@ export namespace IntegrationGetResponse {
}
}
- export interface UnionMember2 {
+ export interface UnionMember3 {
id: string;
created_at: string;
@@ -493,12 +546,12 @@ export namespace IntegrationGetResponse {
profile_id?: string | null;
- profiles?: Array;
+ profiles?: Array;
upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
}
- export namespace UnionMember2 {
+ export namespace UnionMember3 {
/**
* Computed entry field for a profile that an entry is shared into.
*/
@@ -509,7 +562,7 @@ export namespace IntegrationGetResponse {
}
}
- export interface UnionMember3 {
+ export interface UnionMember4 {
id: string;
/**
@@ -530,12 +583,12 @@ export namespace IntegrationGetResponse {
updated_at: string;
- profiles?: Array;
+ profiles?: Array;
upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
}
- export namespace UnionMember3 {
+ export namespace UnionMember4 {
/**
* Computed entry field for a profile that an entry is shared into.
*/
@@ -546,7 +599,7 @@ export namespace IntegrationGetResponse {
}
}
- export interface UnionMember4 {
+ export interface UnionMember5 {
id: string;
created_at: string;
@@ -559,12 +612,12 @@ export namespace IntegrationGetResponse {
updated_at: string;
- profiles?: Array;
+ profiles?: Array;
upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
}
- export namespace UnionMember4 {
+ export namespace UnionMember5 {
/**
* Computed entry field for a profile that an entry is shared into.
*/
@@ -575,7 +628,7 @@ export namespace IntegrationGetResponse {
}
}
- export interface UnionMember5 {
+ export interface UnionMember6 {
id: string;
created_at: string;
@@ -592,12 +645,12 @@ export namespace IntegrationGetResponse {
profile_id?: string | null;
- profiles?: Array;
+ profiles?: Array;
upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
}
- export namespace UnionMember5 {
+ export namespace UnionMember6 {
/**
* Computed entry field for a profile that an entry is shared into.
*/
diff --git a/src/resources/zero-trust/dlp/entries/predefined.ts b/src/resources/zero-trust/dlp/entries/predefined.ts
index 3f47812d9e..ac1c380aeb 100644
--- a/src/resources/zero-trust/dlp/entries/predefined.ts
+++ b/src/resources/zero-trust/dlp/entries/predefined.ts
@@ -269,7 +269,8 @@ export type PredefinedListResponse =
| PredefinedListResponse.UnionMember2
| PredefinedListResponse.UnionMember3
| PredefinedListResponse.UnionMember4
- | PredefinedListResponse.UnionMember5;
+ | PredefinedListResponse.UnionMember5
+ | PredefinedListResponse.UnionMember6;
export namespace PredefinedListResponse {
export interface UnionMember0 {
@@ -303,7 +304,26 @@ export namespace PredefinedListResponse {
export interface UnionMember1 {
id: string;
- confidence: UnionMember1.Confidence;
+ created_at: string;
+
+ /**
+ * @deprecated
+ */
+ enabled: boolean;
+
+ name: string;
+
+ type: 'custom_prompt_topic';
+
+ updated_at: string;
+
+ upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
+ }
+
+ export interface UnionMember2 {
+ id: string;
+
+ confidence: UnionMember2.Confidence;
enabled: boolean;
@@ -321,10 +341,10 @@ export namespace PredefinedListResponse {
/**
* A Predefined AI prompt classification topic entry.
*/
- variant?: UnionMember1.UnionMember0 | UnionMember1.UnionMember1;
+ variant?: UnionMember2.UnionMember0 | UnionMember2.UnionMember1;
}
- export namespace UnionMember1 {
+ export namespace UnionMember2 {
export interface Confidence {
/**
* Indicates whether this entry has AI remote service validation.
@@ -366,7 +386,7 @@ export namespace PredefinedListResponse {
}
}
- export interface UnionMember2 {
+ export interface UnionMember3 {
id: string;
created_at: string;
@@ -384,7 +404,7 @@ export namespace PredefinedListResponse {
upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
}
- export interface UnionMember3 {
+ export interface UnionMember4 {
id: string;
/**
@@ -408,7 +428,7 @@ export namespace PredefinedListResponse {
upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
}
- export interface UnionMember4 {
+ export interface UnionMember5 {
id: string;
created_at: string;
@@ -424,7 +444,7 @@ export namespace PredefinedListResponse {
upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
}
- export interface UnionMember5 {
+ export interface UnionMember6 {
id: string;
created_at: string;
@@ -453,7 +473,8 @@ export type PredefinedGetResponse =
| PredefinedGetResponse.UnionMember2
| PredefinedGetResponse.UnionMember3
| PredefinedGetResponse.UnionMember4
- | PredefinedGetResponse.UnionMember5;
+ | PredefinedGetResponse.UnionMember5
+ | PredefinedGetResponse.UnionMember6;
export namespace PredefinedGetResponse {
export interface UnionMember0 {
@@ -500,7 +521,39 @@ export namespace PredefinedGetResponse {
export interface UnionMember1 {
id: string;
- confidence: UnionMember1.Confidence;
+ created_at: string;
+
+ /**
+ * @deprecated
+ */
+ enabled: boolean;
+
+ name: string;
+
+ type: 'custom_prompt_topic';
+
+ updated_at: string;
+
+ profiles?: Array;
+
+ upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
+ }
+
+ export namespace UnionMember1 {
+ /**
+ * Computed entry field for a profile that an entry is shared into.
+ */
+ export interface Profile {
+ id: string;
+
+ name: string;
+ }
+ }
+
+ export interface UnionMember2 {
+ id: string;
+
+ confidence: UnionMember2.Confidence;
enabled: boolean;
@@ -513,17 +566,17 @@ export namespace PredefinedGetResponse {
*/
profile_id?: string | null;
- profiles?: Array;
+ profiles?: Array;
upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
/**
* A Predefined AI prompt classification topic entry.
*/
- variant?: UnionMember1.UnionMember0 | UnionMember1.UnionMember1;
+ variant?: UnionMember2.UnionMember0 | UnionMember2.UnionMember1;
}
- export namespace UnionMember1 {
+ export namespace UnionMember2 {
export interface Confidence {
/**
* Indicates whether this entry has AI remote service validation.
@@ -574,7 +627,7 @@ export namespace PredefinedGetResponse {
}
}
- export interface UnionMember2 {
+ export interface UnionMember3 {
id: string;
created_at: string;
@@ -589,12 +642,12 @@ export namespace PredefinedGetResponse {
profile_id?: string | null;
- profiles?: Array;
+ profiles?: Array;
upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
}
- export namespace UnionMember2 {
+ export namespace UnionMember3 {
/**
* Computed entry field for a profile that an entry is shared into.
*/
@@ -605,7 +658,7 @@ export namespace PredefinedGetResponse {
}
}
- export interface UnionMember3 {
+ export interface UnionMember4 {
id: string;
/**
@@ -626,12 +679,12 @@ export namespace PredefinedGetResponse {
updated_at: string;
- profiles?: Array;
+ profiles?: Array;
upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
}
- export namespace UnionMember3 {
+ export namespace UnionMember4 {
/**
* Computed entry field for a profile that an entry is shared into.
*/
@@ -642,7 +695,7 @@ export namespace PredefinedGetResponse {
}
}
- export interface UnionMember4 {
+ export interface UnionMember5 {
id: string;
created_at: string;
@@ -655,12 +708,12 @@ export namespace PredefinedGetResponse {
updated_at: string;
- profiles?: Array;
+ profiles?: Array;
upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
}
- export namespace UnionMember4 {
+ export namespace UnionMember5 {
/**
* Computed entry field for a profile that an entry is shared into.
*/
@@ -671,7 +724,7 @@ export namespace PredefinedGetResponse {
}
}
- export interface UnionMember5 {
+ export interface UnionMember6 {
id: string;
created_at: string;
@@ -688,12 +741,12 @@ export namespace PredefinedGetResponse {
profile_id?: string | null;
- profiles?: Array;
+ profiles?: Array;
upload_status?: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete';
}
- export namespace UnionMember5 {
+ export namespace UnionMember6 {
/**
* Computed entry field for a profile that an entry is shared into.
*/
diff --git a/src/resources/zero-trust/dlp/profiles/custom.ts b/src/resources/zero-trust/dlp/profiles/custom.ts
index 90e6e03825..5ee6f6a121 100644
--- a/src/resources/zero-trust/dlp/profiles/custom.ts
+++ b/src/resources/zero-trust/dlp/profiles/custom.ts
@@ -165,6 +165,7 @@ export interface CustomProfile {
*/
entries?: Array<
| CustomProfile.CustomEntry
+ | CustomProfile.CustomPromptTopicEntry
| CustomProfile.PredefinedEntry
| CustomProfile.IntegrationEntry
| CustomProfile.ExactDataEntry
@@ -179,6 +180,7 @@ export interface CustomProfile {
shared_entries?: Array<
| CustomProfile.CustomEntry
+ | CustomProfile.CustomPromptTopicEntry
| CustomProfile.PredefinedEntry
| CustomProfile.IntegrationEntry
| CustomProfile.ExactDataEntry
@@ -214,6 +216,23 @@ export namespace CustomProfile {
profile_id?: string | null;
}
+ export interface CustomPromptTopicEntry {
+ id: string;
+
+ created_at: string;
+
+ /**
+ * @deprecated
+ */
+ enabled: boolean;
+
+ name: string;
+
+ type: 'custom_prompt_topic';
+
+ updated_at: string;
+ }
+
export interface PredefinedEntry {
id: string;
@@ -383,6 +402,23 @@ export namespace CustomProfile {
profile_id?: string | null;
}
+ export interface CustomPromptTopicEntry {
+ id: string;
+
+ created_at: string;
+
+ /**
+ * @deprecated
+ */
+ enabled: boolean;
+
+ name: string;
+
+ type: 'custom_prompt_topic';
+
+ updated_at: string;
+ }
+
export interface PredefinedEntry {
id: string;
diff --git a/src/resources/zero-trust/dlp/profiles/predefined.ts b/src/resources/zero-trust/dlp/profiles/predefined.ts
index 5d89fd871d..01f70838ce 100644
--- a/src/resources/zero-trust/dlp/profiles/predefined.ts
+++ b/src/resources/zero-trust/dlp/profiles/predefined.ts
@@ -109,6 +109,7 @@ export interface PredefinedProfile {
*/
entries: Array<
| PredefinedProfile.CustomEntry
+ | PredefinedProfile.CustomPromptTopicEntry
| PredefinedProfile.PredefinedEntry
| PredefinedProfile.IntegrationEntry
| PredefinedProfile.ExactDataEntry
@@ -158,6 +159,23 @@ export namespace PredefinedProfile {
profile_id?: string | null;
}
+ export interface CustomPromptTopicEntry {
+ id: string;
+
+ created_at: string;
+
+ /**
+ * @deprecated
+ */
+ enabled: boolean;
+
+ name: string;
+
+ type: 'custom_prompt_topic';
+
+ updated_at: string;
+ }
+
export interface PredefinedEntry {
id: string;
diff --git a/src/resources/zero-trust/dlp/profiles/profiles.ts b/src/resources/zero-trust/dlp/profiles/profiles.ts
index 94d8da86f8..7f10f17bfe 100644
--- a/src/resources/zero-trust/dlp/profiles/profiles.ts
+++ b/src/resources/zero-trust/dlp/profiles/profiles.ts
@@ -173,6 +173,7 @@ export namespace Profile {
*/
entries?: Array<
| CustomProfile.CustomEntry
+ | CustomProfile.CustomPromptTopicEntry
| CustomProfile.PredefinedEntry
| CustomProfile.IntegrationEntry
| CustomProfile.ExactDataEntry
@@ -187,6 +188,7 @@ export namespace Profile {
shared_entries?: Array<
| CustomProfile.CustomEntry
+ | CustomProfile.CustomPromptTopicEntry
| CustomProfile.PredefinedEntry
| CustomProfile.IntegrationEntry
| CustomProfile.ExactDataEntry
@@ -222,6 +224,23 @@ export namespace Profile {
profile_id?: string | null;
}
+ export interface CustomPromptTopicEntry {
+ id: string;
+
+ created_at: string;
+
+ /**
+ * @deprecated
+ */
+ enabled: boolean;
+
+ name: string;
+
+ type: 'custom_prompt_topic';
+
+ updated_at: string;
+ }
+
export interface PredefinedEntry {
id: string;
@@ -391,6 +410,23 @@ export namespace Profile {
profile_id?: string | null;
}
+ export interface CustomPromptTopicEntry {
+ id: string;
+
+ created_at: string;
+
+ /**
+ * @deprecated
+ */
+ enabled: boolean;
+
+ name: string;
+
+ type: 'custom_prompt_topic';
+
+ updated_at: string;
+ }
+
export interface PredefinedEntry {
id: string;
@@ -539,6 +575,7 @@ export namespace Profile {
*/
entries: Array<
| PredefinedProfile.CustomEntry
+ | PredefinedProfile.CustomPromptTopicEntry
| PredefinedProfile.PredefinedEntry
| PredefinedProfile.IntegrationEntry
| PredefinedProfile.ExactDataEntry
@@ -598,6 +635,23 @@ export namespace Profile {
profile_id?: string | null;
}
+ export interface CustomPromptTopicEntry {
+ id: string;
+
+ created_at: string;
+
+ /**
+ * @deprecated
+ */
+ enabled: boolean;
+
+ name: string;
+
+ type: 'custom_prompt_topic';
+
+ updated_at: string;
+ }
+
export interface PredefinedEntry {
id: string;
@@ -743,6 +797,7 @@ export namespace Profile {
*/
entries: Array<
| IntegrationProfile.CustomEntry
+ | IntegrationProfile.CustomPromptTopicEntry
| IntegrationProfile.PredefinedEntry
| IntegrationProfile.IntegrationEntry
| IntegrationProfile.ExactDataEntry
@@ -754,6 +809,7 @@ export namespace Profile {
shared_entries: Array<
| IntegrationProfile.CustomEntry
+ | IntegrationProfile.CustomPromptTopicEntry
| IntegrationProfile.PredefinedEntry
| IntegrationProfile.IntegrationEntry
| IntegrationProfile.ExactDataEntry
@@ -798,6 +854,23 @@ export namespace Profile {
profile_id?: string | null;
}
+ export interface CustomPromptTopicEntry {
+ id: string;
+
+ created_at: string;
+
+ /**
+ * @deprecated
+ */
+ enabled: boolean;
+
+ name: string;
+
+ type: 'custom_prompt_topic';
+
+ updated_at: string;
+ }
+
export interface PredefinedEntry {
id: string;
@@ -958,6 +1031,23 @@ export namespace Profile {
profile_id?: string | null;
}
+ export interface CustomPromptTopicEntry {
+ id: string;
+
+ created_at: string;
+
+ /**
+ * @deprecated
+ */
+ enabled: boolean;
+
+ name: string;
+
+ type: 'custom_prompt_topic';
+
+ updated_at: string;
+ }
+
export interface PredefinedEntry {
id: string;
diff --git a/tests/api-resources/ai-gateway/ai-gateway.test.ts b/tests/api-resources/ai-gateway/ai-gateway.test.ts
index 1428ae341f..5f98fba07e 100644
--- a/tests/api-resources/ai-gateway/ai-gateway.test.ts
+++ b/tests/api-resources/ai-gateway/ai-gateway.test.ts
@@ -84,6 +84,40 @@ describe('resource aiGateway', () => {
enabled: true,
profiles: ['string'],
},
+ guardrails: {
+ prompt: {
+ P1: 'FLAG',
+ S1: 'FLAG',
+ S10: 'FLAG',
+ S11: 'FLAG',
+ S12: 'FLAG',
+ S13: 'FLAG',
+ S2: 'FLAG',
+ S3: 'FLAG',
+ S4: 'FLAG',
+ S5: 'FLAG',
+ S6: 'FLAG',
+ S7: 'FLAG',
+ S8: 'FLAG',
+ S9: 'FLAG',
+ },
+ response: {
+ P1: 'FLAG',
+ S1: 'FLAG',
+ S10: 'FLAG',
+ S11: 'FLAG',
+ S12: 'FLAG',
+ S13: 'FLAG',
+ S2: 'FLAG',
+ S3: 'FLAG',
+ S4: 'FLAG',
+ S5: 'FLAG',
+ S6: 'FLAG',
+ S7: 'FLAG',
+ S8: 'FLAG',
+ S9: 'FLAG',
+ },
+ },
log_management: 10000,
log_management_strategy: 'STOP_INSERTING',
logpush: true,
@@ -92,7 +126,7 @@ describe('resource aiGateway', () => {
{
authorization: 'authorization',
headers: { foo: 'string' },
- url: 'url',
+ url: 'https://example.com',
content_type: 'json',
},
],
From acb87c71f1128ce0f59ab5e9bda15bf9176bb12a Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 12 May 2026 00:30:31 +0000
Subject: [PATCH 24/73] chore(api): update composite API spec
---
.stats.yml | 2 +-
src/resources/acm/custom-trust-store.ts | 15 +++++----
src/resources/ai-gateway/dynamic-routing.ts | 32 +++++++++++++++++--
src/resources/d1/d1.ts | 6 ++--
src/resources/d1/database/database.ts | 19 +++++++++++
.../ai-gateway/dynamic-routing.test.ts | 2 ++
.../d1/database/database.test.ts | 1 +
7 files changed, 65 insertions(+), 12 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 5164ab07e1..4aa3d32323 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 2220
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
-openapi_spec_hash: 20525f5883d4d78be797dee296df1442
+openapi_spec_hash: 0a99f50e35e07f6bf24899f6cb02ca0f
config_hash: cef856e42543e49d9b09cb9eac20dc9e
diff --git a/src/resources/acm/custom-trust-store.ts b/src/resources/acm/custom-trust-store.ts
index 7cfdd7d0b5..1e25285e0b 100644
--- a/src/resources/acm/custom-trust-store.ts
+++ b/src/resources/acm/custom-trust-store.ts
@@ -6,7 +6,8 @@ import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../p
export class CustomTrustStore extends APIResource {
/**
- * Add Custom Origin Trust Store for a Zone.
+ * Upload a root CA certificate to the Custom Origin Trust Store for a Zone. Only
+ * root CA certificates are accepted.
*
* @example
* ```ts
@@ -56,7 +57,7 @@ export class CustomTrustStore extends APIResource {
}
/**
- * Removes a CA certificate from the custom origin trust store. Origins using
+ * Removes a root CA certificate from the custom origin trust store. Origins using
* certificates signed by this CA will no longer be trusted.
*
* @example
@@ -83,8 +84,8 @@ export class CustomTrustStore extends APIResource {
}
/**
- * Retrieves details about a specific certificate in the custom origin trust store,
- * including expiration and subject information.
+ * Retrieves details about a specific root CA certificate in the custom origin
+ * trust store, including expiration and subject information.
*
* @example
* ```ts
@@ -119,7 +120,8 @@ export interface CustomTrustStore {
id: string;
/**
- * The zone's SSL certificate or certificate and the intermediate(s).
+ * The root CA certificate in PEM format. Only root CA certificates are accepted;
+ * intermediate and leaf certificates are not supported.
*/
certificate: string;
@@ -168,7 +170,8 @@ export interface CustomTrustStoreCreateParams {
zone_id: string;
/**
- * Body param: The zone's SSL certificate or certificate and the intermediate(s).
+ * Body param: The root CA certificate in PEM format. Only root CA certificates are
+ * accepted; intermediate and leaf certificates are not supported.
*/
certificate: string;
}
diff --git a/src/resources/ai-gateway/dynamic-routing.ts b/src/resources/ai-gateway/dynamic-routing.ts
index 7210e4c948..fb67ddba09 100644
--- a/src/resources/ai-gateway/dynamic-routing.ts
+++ b/src/resources/ai-gateway/dynamic-routing.ts
@@ -82,8 +82,11 @@ export class DynamicRouting extends APIResource {
params: DynamicRoutingListParams,
options?: Core.RequestOptions,
): Core.APIPromise {
- const { account_id } = params;
- return this._client.get(`/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/routes`, options);
+ const { account_id, ...query } = params;
+ return this._client.get(`/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/routes`, {
+ query,
+ ...options,
+ });
}
/**
@@ -491,6 +494,8 @@ export namespace DynamicRoutingCreateResponse {
data: string;
version_id: string;
+
+ is_valid?: boolean;
}
}
@@ -701,6 +706,8 @@ export namespace DynamicRoutingUpdateResponse {
data: string;
version_id: string;
+
+ is_valid?: boolean;
}
}
}
@@ -925,6 +932,8 @@ export namespace DynamicRoutingListResponse {
data: string;
version_id: string;
+
+ is_valid?: boolean;
}
}
}
@@ -1665,6 +1674,8 @@ export namespace DynamicRoutingGetResponse {
data: string;
version_id: string;
+
+ is_valid?: boolean;
}
}
@@ -1693,6 +1704,8 @@ export interface DynamicRoutingGetVersionResponse {
name: string;
version_id: string;
+
+ is_valid?: boolean;
}
export namespace DynamicRoutingGetVersionResponse {
@@ -1911,6 +1924,8 @@ export namespace DynamicRoutingListVersionsResponse {
data: string;
version_id: string;
+
+ is_valid?: boolean;
}
}
}
@@ -2110,7 +2125,20 @@ export interface DynamicRoutingUpdateParams {
}
export interface DynamicRoutingListParams {
+ /**
+ * Path param
+ */
account_id: string;
+
+ /**
+ * Query param: Page number
+ */
+ page?: number;
+
+ /**
+ * Query param: Number of routes per page
+ */
+ per_page?: number;
}
export interface DynamicRoutingDeleteParams {
diff --git a/src/resources/d1/d1.ts b/src/resources/d1/d1.ts
index 46a2524e02..4a51c559a8 100644
--- a/src/resources/d1/d1.ts
+++ b/src/resources/d1/d1.ts
@@ -75,9 +75,9 @@ export namespace D1 {
*/
export interface ReadReplication {
/**
- * The read replication mode for the database. Use 'auto' to create replicas and
- * allow D1 automatically place them around the world, or 'disabled' to not use any
- * database replicas (it can take a few hours for all replicas to be deleted).
+ * The read replication mode for the database. Mode 'auto' denotes that D1 creates
+ * replicas and automatically places them around the world. Mode 'disabled' denotes
+ * that no database replicas are used.
*/
mode: 'auto' | 'disabled';
}
diff --git a/src/resources/d1/database/database.ts b/src/resources/d1/database/database.ts
index 01936a7754..ed96fea209 100644
--- a/src/resources/d1/database/database.ts
+++ b/src/resources/d1/database/database.ts
@@ -701,6 +701,25 @@ export interface DatabaseCreateParams {
* user.
*/
primary_location_hint?: 'wnam' | 'enam' | 'weur' | 'eeur' | 'apac' | 'oc';
+
+ /**
+ * Body param: Configuration for D1 read replication.
+ */
+ read_replication?: DatabaseCreateParams.ReadReplication;
+}
+
+export namespace DatabaseCreateParams {
+ /**
+ * Configuration for D1 read replication.
+ */
+ export interface ReadReplication {
+ /**
+ * The read replication mode for the database. Use 'auto' to create replicas and
+ * allow D1 automatically place them around the world, or 'disabled' to not use any
+ * database replicas (it can take a few hours for all replicas to be deleted).
+ */
+ mode: 'auto' | 'disabled';
+ }
}
export interface DatabaseUpdateParams {
diff --git a/tests/api-resources/ai-gateway/dynamic-routing.test.ts b/tests/api-resources/ai-gateway/dynamic-routing.test.ts
index df2b90b5d8..547924b213 100644
--- a/tests/api-resources/ai-gateway/dynamic-routing.test.ts
+++ b/tests/api-resources/ai-gateway/dynamic-routing.test.ts
@@ -82,6 +82,8 @@ describe('resource dynamicRouting', () => {
test('list: required and optional params', async () => {
const response = await client.aiGateway.dynamicRouting.list('54442216', {
account_id: '0d37909e38d3e99c29fa2cd343ac421a',
+ page: 1,
+ per_page: 20,
});
});
diff --git a/tests/api-resources/d1/database/database.test.ts b/tests/api-resources/d1/database/database.test.ts
index 979c4446c3..c7dea1b432 100644
--- a/tests/api-resources/d1/database/database.test.ts
+++ b/tests/api-resources/d1/database/database.test.ts
@@ -30,6 +30,7 @@ describe('resource database', () => {
name: 'my-database',
jurisdiction: 'eu',
primary_location_hint: 'wnam',
+ read_replication: { mode: 'auto' },
});
});
From 1a0e7d63c513ea7a77fafe8be565266be1d3f202 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 12 May 2026 15:45:37 +0000
Subject: [PATCH 25/73] codegen metadata
---
.stats.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index 4aa3d32323..9ab2b4c63b 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 2220
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
-openapi_spec_hash: 0a99f50e35e07f6bf24899f6cb02ca0f
+openapi_spec_hash: 4388fdee095ceb19ba22da605f7a4fe2
config_hash: cef856e42543e49d9b09cb9eac20dc9e
From 163d258b6278a359d1d5d379b20db8c620b90663 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 12 May 2026 17:01:55 +0000
Subject: [PATCH 26/73] feat: feat: WAD-244 Onboard AI Security for Apps api
* feat: WAD-244 Onboard AI Security for Apps api
---
.stats.yml | 4 +-
api.md | 2 +
scripts/detect-breaking-changes | 2 +
src/index.ts | 5 +
src/resources/ai-security.ts | 3 +
src/resources/ai-security/ai-security.ts | 117 ++++++++++++++
src/resources/ai-security/api.md | 23 +++
src/resources/ai-security/custom-topics.ts | 143 ++++++++++++++++++
src/resources/ai-security/index.ts | 10 ++
src/resources/index.ts | 1 +
.../ai-security/ai-security.test.ts | 45 ++++++
.../ai-security/custom-topics.test.ts | 51 +++++++
12 files changed, 404 insertions(+), 2 deletions(-)
create mode 100644 src/resources/ai-security.ts
create mode 100644 src/resources/ai-security/ai-security.ts
create mode 100644 src/resources/ai-security/api.md
create mode 100644 src/resources/ai-security/custom-topics.ts
create mode 100644 src/resources/ai-security/index.ts
create mode 100644 tests/api-resources/ai-security/ai-security.test.ts
create mode 100644 tests/api-resources/ai-security/custom-topics.test.ts
diff --git a/.stats.yml b/.stats.yml
index 9ab2b4c63b..83f29fc05d 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 2220
+configured_endpoints: 2224
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
openapi_spec_hash: 4388fdee095ceb19ba22da605f7a4fe2
-config_hash: cef856e42543e49d9b09cb9eac20dc9e
+config_hash: f442d2e2e1199d087c1cd3441cd62b77
diff --git a/api.md b/api.md
index 6e073fdc99..dffd6a3c44 100644
--- a/api.md
+++ b/api.md
@@ -219,6 +219,8 @@ Types:
# [ContentScanning](src/resources/content-scanning/api.md)
+# [AISecurity](src/resources/ai-security/api.md)
+
# [AbuseReports](src/resources/abuse-reports/api.md)
# [AI](src/resources/ai/api.md)
diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes
index 5629104c4f..f3ab109852 100755
--- a/scripts/detect-breaking-changes
+++ b/scripts/detect-breaking-changes
@@ -818,6 +818,8 @@ TEST_PATHS=(
tests/api-resources/content-scanning/content-scanning.test.ts
tests/api-resources/content-scanning/payloads.test.ts
tests/api-resources/content-scanning/settings.test.ts
+ tests/api-resources/ai-security/ai-security.test.ts
+ tests/api-resources/ai-security/custom-topics.test.ts
tests/api-resources/abuse-reports/abuse-reports.test.ts
tests/api-resources/abuse-reports/mitigations.test.ts
tests/api-resources/ai/ai.test.ts
diff --git a/src/index.ts b/src/index.ts
index 9abff20913..e8558e34ce 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -25,6 +25,7 @@ import { Accounts } from './resources/accounts/accounts';
import { ACM } from './resources/acm/acm';
import { Addressing } from './resources/addressing/addressing';
import { AIGateway } from './resources/ai-gateway/ai-gateway';
+import { AISecurity } from './resources/ai-security/ai-security';
import { AI } from './resources/ai/ai';
import { AISearch } from './resources/aisearch/aisearch';
import { Alerting } from './resources/alerting/alerting';
@@ -372,6 +373,7 @@ export class Cloudflare extends Core.APIClient {
resourceTagging: API.ResourceTagging = new API.ResourceTagging(this);
leakedCredentialChecks: API.LeakedCredentialChecks = new API.LeakedCredentialChecks(this);
contentScanning: API.ContentScanning = new API.ContentScanning(this);
+ aiSecurity: API.AISecurity = new API.AISecurity(this);
abuseReports: API.AbuseReports = new API.AbuseReports(this);
ai: API.AI = new API.AI(this);
aiSearch: API.AISearch = new API.AISearch(this);
@@ -620,6 +622,7 @@ Cloudflare.ResourceSharing = ResourceSharing;
Cloudflare.ResourceTagging = ResourceTagging;
Cloudflare.LeakedCredentialChecks = LeakedCredentialChecks;
Cloudflare.ContentScanning = ContentScanning;
+Cloudflare.AISecurity = AISecurity;
Cloudflare.AbuseReports = AbuseReports;
Cloudflare.AI = AI;
Cloudflare.AISearch = AISearch;
@@ -859,6 +862,8 @@ export declare namespace Cloudflare {
export { ContentScanning as ContentScanning };
+ export { AISecurity as AISecurity };
+
export { AbuseReports as AbuseReports };
export { AI as AI };
diff --git a/src/resources/ai-security.ts b/src/resources/ai-security.ts
new file mode 100644
index 0000000000..fc541887d2
--- /dev/null
+++ b/src/resources/ai-security.ts
@@ -0,0 +1,3 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+export * from './ai-security/index';
diff --git a/src/resources/ai-security/ai-security.ts b/src/resources/ai-security/ai-security.ts
new file mode 100644
index 0000000000..4645991853
--- /dev/null
+++ b/src/resources/ai-security/ai-security.ts
@@ -0,0 +1,117 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import { APIResource } from '../../resource';
+import * as Core from '../../core';
+import * as CustomTopicsAPI from './custom-topics';
+import {
+ CustomTopicGetParams,
+ CustomTopicGetResponse,
+ CustomTopicUpdateParams,
+ CustomTopicUpdateResponse,
+ CustomTopics,
+} from './custom-topics';
+
+export class AISecurity extends APIResource {
+ customTopics: CustomTopicsAPI.CustomTopics = new CustomTopicsAPI.CustomTopics(this._client);
+
+ /**
+ * Enable or disable AI Security for Apps for a zone.
+ *
+ * Changes can take up to a minute to propagate to the zone.
+ *
+ * @example
+ * ```ts
+ * const aiSecurity = await client.aiSecurity.update({
+ * zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
+ * });
+ * ```
+ */
+ update(
+ params: AISecurityUpdateParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ const { zone_id, ...body } = params;
+ return (
+ this._client.put(`/zones/${zone_id}/ai-security/settings`, { body, ...options }) as Core.APIPromise<{
+ result: AISecurityUpdateResponse;
+ }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+
+ /**
+ * Get whether AI Security for Apps is enabled or disabled for a zone.
+ *
+ * @example
+ * ```ts
+ * const aiSecurity = await client.aiSecurity.get({
+ * zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
+ * });
+ * ```
+ */
+ get(params: AISecurityGetParams, options?: Core.RequestOptions): Core.APIPromise {
+ const { zone_id } = params;
+ return (
+ this._client.get(`/zones/${zone_id}/ai-security/settings`, options) as Core.APIPromise<{
+ result: AISecurityGetResponse;
+ }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+}
+
+/**
+ * AI Security for Apps enablement status for a zone.
+ */
+export interface AISecurityUpdateResponse {
+ /**
+ * Whether AI Security for Apps is enabled on the zone.
+ */
+ enabled?: boolean;
+}
+
+/**
+ * AI Security for Apps enablement status for a zone.
+ */
+export interface AISecurityGetResponse {
+ /**
+ * Whether AI Security for Apps is enabled on the zone.
+ */
+ enabled?: boolean;
+}
+
+export interface AISecurityUpdateParams {
+ /**
+ * Path param: Defines the zone.
+ */
+ zone_id: string;
+
+ /**
+ * Body param: Whether AI Security for Apps is enabled on the zone.
+ */
+ enabled?: boolean;
+}
+
+export interface AISecurityGetParams {
+ /**
+ * Defines the zone.
+ */
+ zone_id: string;
+}
+
+AISecurity.CustomTopics = CustomTopics;
+
+export declare namespace AISecurity {
+ export {
+ type AISecurityUpdateResponse as AISecurityUpdateResponse,
+ type AISecurityGetResponse as AISecurityGetResponse,
+ type AISecurityUpdateParams as AISecurityUpdateParams,
+ type AISecurityGetParams as AISecurityGetParams,
+ };
+
+ export {
+ CustomTopics as CustomTopics,
+ type CustomTopicUpdateResponse as CustomTopicUpdateResponse,
+ type CustomTopicGetResponse as CustomTopicGetResponse,
+ type CustomTopicUpdateParams as CustomTopicUpdateParams,
+ type CustomTopicGetParams as CustomTopicGetParams,
+ };
+}
diff --git a/src/resources/ai-security/api.md b/src/resources/ai-security/api.md
new file mode 100644
index 0000000000..d75b74efd6
--- /dev/null
+++ b/src/resources/ai-security/api.md
@@ -0,0 +1,23 @@
+# AISecurity
+
+Types:
+
+- AISecurityUpdateResponse
+- AISecurityGetResponse
+
+Methods:
+
+- client.aiSecurity.update({ ...params }) -> AISecurityUpdateResponse
+- client.aiSecurity.get({ ...params }) -> AISecurityGetResponse
+
+## CustomTopics
+
+Types:
+
+- CustomTopicUpdateResponse
+- CustomTopicGetResponse
+
+Methods:
+
+- client.aiSecurity.customTopics.update({ ...params }) -> CustomTopicUpdateResponse
+- client.aiSecurity.customTopics.get({ ...params }) -> CustomTopicGetResponse
diff --git a/src/resources/ai-security/custom-topics.ts b/src/resources/ai-security/custom-topics.ts
new file mode 100644
index 0000000000..217a4c317c
--- /dev/null
+++ b/src/resources/ai-security/custom-topics.ts
@@ -0,0 +1,143 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import { APIResource } from '../../resource';
+import * as Core from '../../core';
+
+export class CustomTopics extends APIResource {
+ /**
+ * Set the AI Security for Apps custom topic categories for a zone.
+ *
+ * A maximum of 20 custom topics can be configured per zone. Each topic label must
+ * be 2–20 characters using only lowercase letters (a–z), digits (0–9), and
+ * hyphens. Each topic description must be 2–50 printable ASCII characters.
+ *
+ * Changes can take up to a minute to propagate to the zone.
+ *
+ * @example
+ * ```ts
+ * const customTopic =
+ * await client.aiSecurity.customTopics.update({
+ * zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
+ * });
+ * ```
+ */
+ update(
+ params: CustomTopicUpdateParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ const { zone_id, ...body } = params;
+ return (
+ this._client.put(`/zones/${zone_id}/ai-security/custom-topics`, {
+ body,
+ ...options,
+ }) as Core.APIPromise<{ result: CustomTopicUpdateResponse }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+
+ /**
+ * Get the AI Security for Apps custom topic categories for a zone.
+ *
+ * @example
+ * ```ts
+ * const customTopic =
+ * await client.aiSecurity.customTopics.get({
+ * zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
+ * });
+ * ```
+ */
+ get(params: CustomTopicGetParams, options?: Core.RequestOptions): Core.APIPromise {
+ const { zone_id } = params;
+ return (
+ this._client.get(`/zones/${zone_id}/ai-security/custom-topics`, options) as Core.APIPromise<{
+ result: CustomTopicGetResponse;
+ }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+}
+
+export interface CustomTopicUpdateResponse {
+ /**
+ * Custom topic categories for AI Security for Apps content detection.
+ */
+ topics?: Array;
+}
+
+export namespace CustomTopicUpdateResponse {
+ export interface Topic {
+ /**
+ * Unique label identifier. Must contain only lowercase letters (a–z), digits
+ * (0–9), and hyphens.
+ */
+ label: string;
+
+ /**
+ * Description of the topic category. Must contain only printable ASCII characters.
+ */
+ topic: string;
+ }
+}
+
+export interface CustomTopicGetResponse {
+ /**
+ * Custom topic categories for AI Security for Apps content detection.
+ */
+ topics?: Array;
+}
+
+export namespace CustomTopicGetResponse {
+ export interface Topic {
+ /**
+ * Unique label identifier. Must contain only lowercase letters (a–z), digits
+ * (0–9), and hyphens.
+ */
+ label: string;
+
+ /**
+ * Description of the topic category. Must contain only printable ASCII characters.
+ */
+ topic: string;
+ }
+}
+
+export interface CustomTopicUpdateParams {
+ /**
+ * Path param: Defines the zone.
+ */
+ zone_id: string;
+
+ /**
+ * Body param: Custom topic categories for AI Security for Apps content detection.
+ */
+ topics?: Array;
+}
+
+export namespace CustomTopicUpdateParams {
+ export interface Topic {
+ /**
+ * Unique label identifier. Must contain only lowercase letters (a–z), digits
+ * (0–9), and hyphens.
+ */
+ label: string;
+
+ /**
+ * Description of the topic category. Must contain only printable ASCII characters.
+ */
+ topic: string;
+ }
+}
+
+export interface CustomTopicGetParams {
+ /**
+ * Defines the zone.
+ */
+ zone_id: string;
+}
+
+export declare namespace CustomTopics {
+ export {
+ type CustomTopicUpdateResponse as CustomTopicUpdateResponse,
+ type CustomTopicGetResponse as CustomTopicGetResponse,
+ type CustomTopicUpdateParams as CustomTopicUpdateParams,
+ type CustomTopicGetParams as CustomTopicGetParams,
+ };
+}
diff --git a/src/resources/ai-security/index.ts b/src/resources/ai-security/index.ts
new file mode 100644
index 0000000000..fe24586666
--- /dev/null
+++ b/src/resources/ai-security/index.ts
@@ -0,0 +1,10 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+export { AISecurity } from './ai-security';
+export {
+ CustomTopics,
+ type CustomTopicUpdateResponse,
+ type CustomTopicGetResponse,
+ type CustomTopicUpdateParams,
+ type CustomTopicGetParams,
+} from './custom-topics';
diff --git a/src/resources/index.ts b/src/resources/index.ts
index a16db5c29e..7235c2e0a8 100644
--- a/src/resources/index.ts
+++ b/src/resources/index.ts
@@ -5,6 +5,7 @@ export { ACM } from './acm/acm';
export { AI } from './ai/ai';
export { AIGateway } from './ai-gateway/ai-gateway';
export { AISearch } from './aisearch/aisearch';
+export { AISecurity } from './ai-security/ai-security';
export { APIGateway } from './api-gateway/api-gateway';
export { AbuseReports } from './abuse-reports/abuse-reports';
export { Accounts } from './accounts/accounts';
diff --git a/tests/api-resources/ai-security/ai-security.test.ts b/tests/api-resources/ai-security/ai-security.test.ts
new file mode 100644
index 0000000000..f9730ae514
--- /dev/null
+++ b/tests/api-resources/ai-security/ai-security.test.ts
@@ -0,0 +1,45 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import Cloudflare from 'cloudflare';
+import { Response } from 'node-fetch';
+
+const client = new Cloudflare({
+ apiKey: '144c9defac04969c7bfad8efaa8ea194',
+ apiEmail: 'user@example.com',
+ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
+});
+
+describe('resource aiSecurity', () => {
+ test('update: only required params', async () => {
+ const responsePromise = client.aiSecurity.update({ zone_id: '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);
+ });
+
+ test('update: required and optional params', async () => {
+ const response = await client.aiSecurity.update({
+ zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
+ enabled: true,
+ });
+ });
+
+ test('get: only required params', async () => {
+ const responsePromise = client.aiSecurity.get({ zone_id: '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);
+ });
+
+ test('get: required and optional params', async () => {
+ const response = await client.aiSecurity.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' });
+ });
+});
diff --git a/tests/api-resources/ai-security/custom-topics.test.ts b/tests/api-resources/ai-security/custom-topics.test.ts
new file mode 100644
index 0000000000..e0c97ce2e6
--- /dev/null
+++ b/tests/api-resources/ai-security/custom-topics.test.ts
@@ -0,0 +1,51 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import Cloudflare from 'cloudflare';
+import { Response } from 'node-fetch';
+
+const client = new Cloudflare({
+ apiKey: '144c9defac04969c7bfad8efaa8ea194',
+ apiEmail: 'user@example.com',
+ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
+});
+
+describe('resource customTopics', () => {
+ test('update: only required params', async () => {
+ const responsePromise = client.aiSecurity.customTopics.update({
+ zone_id: '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);
+ });
+
+ test('update: required and optional params', async () => {
+ const response = await client.aiSecurity.customTopics.update({
+ zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
+ topics: [{ label: 'credit-cards', topic: 'credit card numbers' }],
+ });
+ });
+
+ test('get: only required params', async () => {
+ const responsePromise = client.aiSecurity.customTopics.get({
+ zone_id: '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);
+ });
+
+ test('get: required and optional params', async () => {
+ const response = await client.aiSecurity.customTopics.get({
+ zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
+ });
+ });
+});
From 59e61484ca95777fae21e515cd14282fbc20990f Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 12 May 2026 19:11:19 +0000
Subject: [PATCH 27/73] feat: chore: skip 25 failing TypeScript SDK tests from
prism
* chore: skip failing tests from CI run 25749791655
Skip 25 failing test methods from cloudflare-typescript PR #2753
(staging-next sync). Failures are prism mock server errors, not
real SDK bugs.
Breakdown by HTTP status:
- 22 methods: HTTP 404 (route not in prism spec)
- 2 methods: HTTP 422 (load_balancers.monitor_groups)
- 1 method: HTTP 405 (cache.smart_tiered_cache.create)
Resources affected:
- ai_gateway.billing (3 methods + 8 in subresources)
- ai_security (2 methods + 2 in custom_topics)
- cache (1 method + 7 in origin_cloud_regions + 1 in smart_tiered_cache)
- load_balancers.monitor_groups (2 methods)
CI run: https://github.com/cloudflare/cloudflare-typescript/actions/runs/25749791655
---
.stats.yml | 2 +-
.../ai-gateway/billing/billing.test.ts | 18 ++++++----
.../ai-gateway/billing/spending-limit.test.ts | 18 ++++++----
.../ai-gateway/billing/topup/config.test.ts | 18 ++++++----
.../ai-gateway/billing/topup/topup.test.ts | 12 ++++---
.../ai-security/ai-security.test.ts | 12 ++++---
.../ai-security/custom-topics.test.ts | 12 ++++---
tests/api-resources/cache/cache.test.ts | 6 ++--
.../cache/origin-cloud-regions.test.ts | 36 ++++++++++++-------
.../cache/smart-tiered-cache.test.ts | 6 ++--
.../monitor-groups/monitor-groups.test.ts | 12 ++++---
11 files changed, 101 insertions(+), 51 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 83f29fc05d..9cc1aaaa8b 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 2224
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
openapi_spec_hash: 4388fdee095ceb19ba22da605f7a4fe2
-config_hash: f442d2e2e1199d087c1cd3441cd62b77
+config_hash: a0d2c4abe971a3caafcc4324d98d7106
diff --git a/tests/api-resources/ai-gateway/billing/billing.test.ts b/tests/api-resources/ai-gateway/billing/billing.test.ts
index 6c1a9283d7..e02557ecf3 100644
--- a/tests/api-resources/ai-gateway/billing/billing.test.ts
+++ b/tests/api-resources/ai-gateway/billing/billing.test.ts
@@ -27,7 +27,8 @@ describe('resource billing', () => {
const response = await client.aiGateway.billing.creditBalance({ account_id: 'account_id' });
});
- test('invoiceHistory: only required params', async () => {
+ // HTTP 404 error from prism
+ test.skip('invoiceHistory: only required params', async () => {
const responsePromise = client.aiGateway.billing.invoiceHistory({ account_id: 'account_id' });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
@@ -38,11 +39,13 @@ describe('resource billing', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});
- test('invoiceHistory: required and optional params', async () => {
+ // HTTP 404 error from prism
+ test.skip('invoiceHistory: required and optional params', async () => {
const response = await client.aiGateway.billing.invoiceHistory({ account_id: 'account_id', type: 'all' });
});
- test('invoicePreview: only required params', async () => {
+ // HTTP 404 error from prism
+ test.skip('invoicePreview: only required params', async () => {
const responsePromise = client.aiGateway.billing.invoicePreview({ account_id: 'account_id' });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
@@ -53,11 +56,13 @@ describe('resource billing', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});
- test('invoicePreview: required and optional params', async () => {
+ // HTTP 404 error from prism
+ test.skip('invoicePreview: required and optional params', async () => {
const response = await client.aiGateway.billing.invoicePreview({ account_id: 'account_id' });
});
- test('usageHistory: only required params', async () => {
+ // HTTP 404 error from prism
+ test.skip('usageHistory: only required params', async () => {
const responsePromise = client.aiGateway.billing.usageHistory({
account_id: 'account_id',
value_grouping_window: 'day',
@@ -71,7 +76,8 @@ describe('resource billing', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});
- test('usageHistory: required and optional params', async () => {
+ // HTTP 404 error from prism
+ test.skip('usageHistory: required and optional params', async () => {
const response = await client.aiGateway.billing.usageHistory({
account_id: 'account_id',
value_grouping_window: 'day',
diff --git a/tests/api-resources/ai-gateway/billing/spending-limit.test.ts b/tests/api-resources/ai-gateway/billing/spending-limit.test.ts
index 378a04725f..e14d29f9a4 100644
--- a/tests/api-resources/ai-gateway/billing/spending-limit.test.ts
+++ b/tests/api-resources/ai-gateway/billing/spending-limit.test.ts
@@ -10,7 +10,8 @@ const client = new Cloudflare({
});
describe('resource spendingLimit', () => {
- test('create: only required params', async () => {
+ // HTTP 404 error from prism
+ test.skip('create: only required params', async () => {
const responsePromise = client.aiGateway.billing.spendingLimit.create({
account_id: 'account_id',
amount: 10000,
@@ -26,7 +27,8 @@ describe('resource spendingLimit', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});
- test('create: required and optional params', async () => {
+ // HTTP 404 error from prism
+ test.skip('create: required and optional params', async () => {
const response = await client.aiGateway.billing.spendingLimit.create({
account_id: 'account_id',
amount: 10000,
@@ -35,7 +37,8 @@ describe('resource spendingLimit', () => {
});
});
- test('delete: only required params', async () => {
+ // HTTP 404 error from prism
+ test.skip('delete: only required params', async () => {
const responsePromise = client.aiGateway.billing.spendingLimit.delete({ account_id: 'account_id' });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
@@ -46,11 +49,13 @@ describe('resource spendingLimit', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});
- test('delete: required and optional params', async () => {
+ // HTTP 404 error from prism
+ test.skip('delete: required and optional params', async () => {
const response = await client.aiGateway.billing.spendingLimit.delete({ account_id: 'account_id' });
});
- test('get: only required params', async () => {
+ // HTTP 404 error from prism
+ test.skip('get: only required params', async () => {
const responsePromise = client.aiGateway.billing.spendingLimit.get({ account_id: 'account_id' });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
@@ -61,7 +66,8 @@ describe('resource spendingLimit', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});
- test('get: required and optional params', async () => {
+ // HTTP 404 error from prism
+ test.skip('get: required and optional params', async () => {
const response = await client.aiGateway.billing.spendingLimit.get({ account_id: 'account_id' });
});
});
diff --git a/tests/api-resources/ai-gateway/billing/topup/config.test.ts b/tests/api-resources/ai-gateway/billing/topup/config.test.ts
index 10f62c6ac2..3578dd3094 100644
--- a/tests/api-resources/ai-gateway/billing/topup/config.test.ts
+++ b/tests/api-resources/ai-gateway/billing/topup/config.test.ts
@@ -10,7 +10,8 @@ const client = new Cloudflare({
});
describe('resource config', () => {
- test('create: only required params', async () => {
+ // HTTP 404 error from prism
+ test.skip('create: only required params', async () => {
const responsePromise = client.aiGateway.billing.topup.config.create({
account_id: 'account_id',
amount: 5000,
@@ -25,7 +26,8 @@ describe('resource config', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});
- test('create: required and optional params', async () => {
+ // HTTP 404 error from prism
+ test.skip('create: required and optional params', async () => {
const response = await client.aiGateway.billing.topup.config.create({
account_id: 'account_id',
amount: 5000,
@@ -33,7 +35,8 @@ describe('resource config', () => {
});
});
- test('delete: only required params', async () => {
+ // HTTP 404 error from prism
+ test.skip('delete: only required params', async () => {
const responsePromise = client.aiGateway.billing.topup.config.delete({ account_id: 'account_id' });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
@@ -44,11 +47,13 @@ describe('resource config', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});
- test('delete: required and optional params', async () => {
+ // HTTP 404 error from prism
+ test.skip('delete: required and optional params', async () => {
const response = await client.aiGateway.billing.topup.config.delete({ account_id: 'account_id' });
});
- test('get: only required params', async () => {
+ // HTTP 404 error from prism
+ test.skip('get: only required params', async () => {
const responsePromise = client.aiGateway.billing.topup.config.get({ account_id: 'account_id' });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
@@ -59,7 +64,8 @@ describe('resource config', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});
- test('get: required and optional params', async () => {
+ // HTTP 404 error from prism
+ test.skip('get: required and optional params', async () => {
const response = await client.aiGateway.billing.topup.config.get({ account_id: 'account_id' });
});
});
diff --git a/tests/api-resources/ai-gateway/billing/topup/topup.test.ts b/tests/api-resources/ai-gateway/billing/topup/topup.test.ts
index 612c2098a3..8412810300 100644
--- a/tests/api-resources/ai-gateway/billing/topup/topup.test.ts
+++ b/tests/api-resources/ai-gateway/billing/topup/topup.test.ts
@@ -10,7 +10,8 @@ const client = new Cloudflare({
});
describe('resource topup', () => {
- test('create: only required params', async () => {
+ // HTTP 404 error from prism
+ test.skip('create: only required params', async () => {
const responsePromise = client.aiGateway.billing.topup.create({ account_id: 'account_id', amount: 5000 });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
@@ -21,11 +22,13 @@ describe('resource topup', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});
- test('create: required and optional params', async () => {
+ // HTTP 404 error from prism
+ test.skip('create: required and optional params', async () => {
const response = await client.aiGateway.billing.topup.create({ account_id: 'account_id', amount: 5000 });
});
- test('status: only required params', async () => {
+ // HTTP 404 error from prism
+ test.skip('status: only required params', async () => {
const responsePromise = client.aiGateway.billing.topup.status({
account_id: 'account_id',
payment_intent_id: 'in_1abc',
@@ -39,7 +42,8 @@ describe('resource topup', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});
- test('status: required and optional params', async () => {
+ // HTTP 404 error from prism
+ test.skip('status: required and optional params', async () => {
const response = await client.aiGateway.billing.topup.status({
account_id: 'account_id',
payment_intent_id: 'in_1abc',
diff --git a/tests/api-resources/ai-security/ai-security.test.ts b/tests/api-resources/ai-security/ai-security.test.ts
index f9730ae514..dedfbf4adf 100644
--- a/tests/api-resources/ai-security/ai-security.test.ts
+++ b/tests/api-resources/ai-security/ai-security.test.ts
@@ -10,7 +10,8 @@ const client = new Cloudflare({
});
describe('resource aiSecurity', () => {
- test('update: only required params', async () => {
+ // HTTP 404 error from prism
+ test.skip('update: only required params', async () => {
const responsePromise = client.aiSecurity.update({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
@@ -21,14 +22,16 @@ describe('resource aiSecurity', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});
- test('update: required and optional params', async () => {
+ // HTTP 404 error from prism
+ test.skip('update: required and optional params', async () => {
const response = await client.aiSecurity.update({
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
enabled: true,
});
});
- test('get: only required params', async () => {
+ // HTTP 404 error from prism
+ test.skip('get: only required params', async () => {
const responsePromise = client.aiSecurity.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
@@ -39,7 +42,8 @@ describe('resource aiSecurity', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});
- test('get: required and optional params', async () => {
+ // HTTP 404 error from prism
+ test.skip('get: required and optional params', async () => {
const response = await client.aiSecurity.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' });
});
});
diff --git a/tests/api-resources/ai-security/custom-topics.test.ts b/tests/api-resources/ai-security/custom-topics.test.ts
index e0c97ce2e6..18fb39c00c 100644
--- a/tests/api-resources/ai-security/custom-topics.test.ts
+++ b/tests/api-resources/ai-security/custom-topics.test.ts
@@ -10,7 +10,8 @@ const client = new Cloudflare({
});
describe('resource customTopics', () => {
- test('update: only required params', async () => {
+ // HTTP 404 error from prism
+ test.skip('update: only required params', async () => {
const responsePromise = client.aiSecurity.customTopics.update({
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
});
@@ -23,14 +24,16 @@ describe('resource customTopics', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});
- test('update: required and optional params', async () => {
+ // HTTP 404 error from prism
+ test.skip('update: required and optional params', async () => {
const response = await client.aiSecurity.customTopics.update({
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
topics: [{ label: 'credit-cards', topic: 'credit card numbers' }],
});
});
- test('get: only required params', async () => {
+ // HTTP 404 error from prism
+ test.skip('get: only required params', async () => {
const responsePromise = client.aiSecurity.customTopics.get({
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
});
@@ -43,7 +46,8 @@ describe('resource customTopics', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});
- test('get: required and optional params', async () => {
+ // HTTP 404 error from prism
+ test.skip('get: required and optional params', async () => {
const response = await client.aiSecurity.customTopics.get({
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
});
diff --git a/tests/api-resources/cache/cache.test.ts b/tests/api-resources/cache/cache.test.ts
index 3ae5283a29..894a545938 100644
--- a/tests/api-resources/cache/cache.test.ts
+++ b/tests/api-resources/cache/cache.test.ts
@@ -28,7 +28,8 @@ describe('resource cache', () => {
});
});
- test('purgeEnvironment: only required params', async () => {
+ // HTTP 404 error from prism
+ test.skip('purgeEnvironment: only required params', async () => {
const responsePromise = client.cache.purgeEnvironment('023e105f4ecef8ad9ca31a8372d0c353', {
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
});
@@ -41,7 +42,8 @@ describe('resource cache', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});
- test('purgeEnvironment: required and optional params', async () => {
+ // HTTP 404 error from prism
+ test.skip('purgeEnvironment: required and optional params', async () => {
const response = await client.cache.purgeEnvironment('023e105f4ecef8ad9ca31a8372d0c353', {
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
tags: ['a-cache-tag', 'another-cache-tag'],
diff --git a/tests/api-resources/cache/origin-cloud-regions.test.ts b/tests/api-resources/cache/origin-cloud-regions.test.ts
index 4bf496f305..3123b24639 100644
--- a/tests/api-resources/cache/origin-cloud-regions.test.ts
+++ b/tests/api-resources/cache/origin-cloud-regions.test.ts
@@ -37,7 +37,8 @@ describe('resource originCloudRegions', () => {
});
});
- test('list: only required params', async () => {
+ // HTTP 404 error from prism
+ test.skip('list: only required params', async () => {
const responsePromise = client.cache.originCloudRegions.list({
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
});
@@ -50,7 +51,8 @@ describe('resource originCloudRegions', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});
- test('list: required and optional params', async () => {
+ // HTTP 404 error from prism
+ test.skip('list: required and optional params', async () => {
const response = await client.cache.originCloudRegions.list({
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
page: 1,
@@ -58,7 +60,8 @@ describe('resource originCloudRegions', () => {
});
});
- test('delete: only required params', async () => {
+ // HTTP 404 error from prism
+ test.skip('delete: only required params', async () => {
const responsePromise = client.cache.originCloudRegions.delete('192.0.2.1', {
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
});
@@ -71,13 +74,15 @@ describe('resource originCloudRegions', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});
- test('delete: required and optional params', async () => {
+ // HTTP 404 error from prism
+ test.skip('delete: required and optional params', async () => {
const response = await client.cache.originCloudRegions.delete('192.0.2.1', {
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
});
});
- test('bulkDelete: only required params', async () => {
+ // HTTP 404 error from prism
+ test.skip('bulkDelete: only required params', async () => {
const responsePromise = client.cache.originCloudRegions.bulkDelete({
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
});
@@ -90,13 +95,15 @@ describe('resource originCloudRegions', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});
- test('bulkDelete: required and optional params', async () => {
+ // HTTP 404 error from prism
+ test.skip('bulkDelete: required and optional params', async () => {
const response = await client.cache.originCloudRegions.bulkDelete({
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
});
});
- test('bulkUpdate: only required params', async () => {
+ // HTTP 404 error from prism
+ test.skip('bulkUpdate: only required params', async () => {
const responsePromise = client.cache.originCloudRegions.bulkUpdate({
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
body: [
@@ -121,7 +128,8 @@ describe('resource originCloudRegions', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});
- test('bulkUpdate: required and optional params', async () => {
+ // HTTP 404 error from prism
+ test.skip('bulkUpdate: required and optional params', async () => {
const response = await client.cache.originCloudRegions.bulkUpdate({
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
body: [
@@ -139,7 +147,8 @@ describe('resource originCloudRegions', () => {
});
});
- test('get: only required params', async () => {
+ // HTTP 404 error from prism
+ test.skip('get: only required params', async () => {
const responsePromise = client.cache.originCloudRegions.get('192.0.2.1', {
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
});
@@ -152,13 +161,15 @@ describe('resource originCloudRegions', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});
- test('get: required and optional params', async () => {
+ // HTTP 404 error from prism
+ test.skip('get: required and optional params', async () => {
const response = await client.cache.originCloudRegions.get('192.0.2.1', {
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
});
});
- test('supportedRegions: only required params', async () => {
+ // HTTP 404 error from prism
+ test.skip('supportedRegions: only required params', async () => {
const responsePromise = client.cache.originCloudRegions.supportedRegions({
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
});
@@ -171,7 +182,8 @@ describe('resource originCloudRegions', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});
- test('supportedRegions: required and optional params', async () => {
+ // HTTP 404 error from prism
+ test.skip('supportedRegions: required and optional params', async () => {
const response = await client.cache.originCloudRegions.supportedRegions({
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
});
diff --git a/tests/api-resources/cache/smart-tiered-cache.test.ts b/tests/api-resources/cache/smart-tiered-cache.test.ts
index df25a0d0cd..9df7852687 100644
--- a/tests/api-resources/cache/smart-tiered-cache.test.ts
+++ b/tests/api-resources/cache/smart-tiered-cache.test.ts
@@ -10,7 +10,8 @@ const client = new Cloudflare({
});
describe('resource smartTieredCache', () => {
- test('create: only required params', async () => {
+ // HTTP 405 error from prism
+ test.skip('create: only required params', async () => {
const responsePromise = client.cache.smartTieredCache.create({
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
value: 'on',
@@ -24,7 +25,8 @@ describe('resource smartTieredCache', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});
- test('create: required and optional params', async () => {
+ // HTTP 405 error from prism
+ test.skip('create: required and optional params', async () => {
const response = await client.cache.smartTieredCache.create({
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
value: 'on',
diff --git a/tests/api-resources/load-balancers/monitor-groups/monitor-groups.test.ts b/tests/api-resources/load-balancers/monitor-groups/monitor-groups.test.ts
index 1f1924e1cf..a5143a5b86 100644
--- a/tests/api-resources/load-balancers/monitor-groups/monitor-groups.test.ts
+++ b/tests/api-resources/load-balancers/monitor-groups/monitor-groups.test.ts
@@ -49,7 +49,8 @@ describe('resource monitorGroups', () => {
});
});
- test('update: only required params', async () => {
+ // HTTP 422 error from prism
+ test.skip('update: only required params', async () => {
const responsePromise = client.loadBalancers.monitorGroups.update('17b5962d775c646f3f9725cbc7a53df4', {
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
description: 'Primary datacenter monitors',
@@ -71,7 +72,8 @@ describe('resource monitorGroups', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});
- test('update: required and optional params', async () => {
+ // HTTP 422 error from prism
+ test.skip('update: required and optional params', async () => {
const response = await client.loadBalancers.monitorGroups.update('17b5962d775c646f3f9725cbc7a53df4', {
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
description: 'Primary datacenter monitors',
@@ -124,7 +126,8 @@ describe('resource monitorGroups', () => {
});
});
- test('edit: only required params', async () => {
+ // HTTP 422 error from prism
+ test.skip('edit: only required params', async () => {
const responsePromise = client.loadBalancers.monitorGroups.edit('17b5962d775c646f3f9725cbc7a53df4', {
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
description: 'Primary datacenter monitors',
@@ -146,7 +149,8 @@ describe('resource monitorGroups', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});
- test('edit: required and optional params', async () => {
+ // HTTP 422 error from prism
+ test.skip('edit: required and optional params', async () => {
const response = await client.loadBalancers.monitorGroups.edit('17b5962d775c646f3f9725cbc7a53df4', {
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
description: 'Primary datacenter monitors',
From 3dca94b6455843ffc6024407bf0f63dd5d6c1aad Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 12 May 2026 20:01:20 +0000
Subject: [PATCH 28/73] chore(api): update composite API spec
---
.stats.yml | 2 +-
src/resources/intel/miscategorizations.ts | 5 ++++
src/resources/secrets-store/stores/stores.ts | 24 +++++++++++++------
.../secrets-store/stores/stores.test.ts | 1 +
4 files changed, 24 insertions(+), 8 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 9cc1aaaa8b..826cf4085b 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 2224
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
-openapi_spec_hash: 4388fdee095ceb19ba22da605f7a4fe2
+openapi_spec_hash: 922a016dedd59fe69b5fd850d9a9f836
config_hash: a0d2c4abe971a3caafcc4324d98d7106
diff --git a/src/resources/intel/miscategorizations.ts b/src/resources/intel/miscategorizations.ts
index a5a11f290a..dc1326b90f 100644
--- a/src/resources/intel/miscategorizations.ts
+++ b/src/resources/intel/miscategorizations.ts
@@ -7,6 +7,11 @@ export class Miscategorizations extends APIResource {
/**
* Allows you to submit requests to change a domain’s category.
*
+ * Requests that include category `169` (New Domains) or category `177` (Newly
+ * Seen) in any of `content_adds`, `content_removes`, `security_adds`, or
+ * `security_removes` will be rejected with a `400 Bad Request`. These categories
+ * are automatically managed and fall off 30 days after they are applied.
+ *
* @example
* ```ts
* const miscategorization =
diff --git a/src/resources/secrets-store/stores/stores.ts b/src/resources/secrets-store/stores/stores.ts
index 23f07fc98a..8bee25ccec 100644
--- a/src/resources/secrets-store/stores/stores.ts
+++ b/src/resources/secrets-store/stores/stores.ts
@@ -74,7 +74,10 @@ export class Stores extends APIResource {
}
/**
- * Deletes a single store
+ * Deletes a single store. By default, a store that still contains secrets cannot
+ * be deleted and returns HTTP 409 (Conflict) with the "store_not_empty" error.
+ * Pass `force=true` to cascade-delete all secrets in the store. Empty stores are
+ * always deleted regardless of the force parameter.
*
* @example
* ```ts
@@ -89,12 +92,12 @@ export class Stores extends APIResource {
params: StoreDeleteParams,
options?: Core.RequestOptions,
): Core.APIPromise {
- const { account_id } = params;
+ const { account_id, force } = params;
return (
- this._client.delete(
- `/accounts/${account_id}/secrets_store/stores/${storeId}`,
- options,
- ) as Core.APIPromise<{ result: StoreDeleteResponse | null }>
+ this._client.delete(`/accounts/${account_id}/secrets_store/stores/${storeId}`, {
+ query: { force },
+ ...options,
+ }) as Core.APIPromise<{ result: StoreDeleteResponse | null }>
)._thenUnwrap((obj) => obj.result);
}
}
@@ -191,9 +194,16 @@ export interface StoreListParams extends V4PagePaginationArrayParams {
export interface StoreDeleteParams {
/**
- * Account Identifier
+ * Path param: Account Identifier
*/
account_id: string;
+
+ /**
+ * Query param: When true, cascade-deletes all secrets in the store before deleting
+ * the store itself. Required when deleting a non-empty store. Without this
+ * parameter, attempting to delete a non-empty store returns 409.
+ */
+ force?: boolean;
}
Stores.StoreListResponsesV4PagePaginationArray = StoreListResponsesV4PagePaginationArray;
diff --git a/tests/api-resources/secrets-store/stores/stores.test.ts b/tests/api-resources/secrets-store/stores/stores.test.ts
index 7df24abfb7..4ff2b6cf41 100644
--- a/tests/api-resources/secrets-store/stores/stores.test.ts
+++ b/tests/api-resources/secrets-store/stores/stores.test.ts
@@ -76,6 +76,7 @@ describe('resource stores', () => {
test.skip('delete: required and optional params', async () => {
const response = await client.secretsStore.stores.delete('023e105f4ecef8ad9ca31a8372d0c353', {
account_id: '985e105f4ecef8ad9ca31a8372d0c353',
+ force: true,
});
});
});
From dfd53c3cb44c6b4aa1bfea44a0bf44178c0dbb94 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 12 May 2026 20:31:48 +0000
Subject: [PATCH 29/73] codegen metadata
---
.stats.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index 826cf4085b..8700bb2567 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 2224
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
-openapi_spec_hash: 922a016dedd59fe69b5fd850d9a9f836
+openapi_spec_hash: 31da2976a230d6a4056b11bbe236f35b
config_hash: a0d2c4abe971a3caafcc4324d98d7106
From a596de7cc7c64c7fa9887b52bed97550b392b369 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 13 May 2026 05:19:47 +0000
Subject: [PATCH 30/73] codegen metadata
---
.stats.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index 8700bb2567..8176f38ea0 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 2224
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
-openapi_spec_hash: 31da2976a230d6a4056b11bbe236f35b
+openapi_spec_hash: 62e8e24872538e8d6c6ea10982bfd9e1
config_hash: a0d2c4abe971a3caafcc4324d98d7106
From 3adae730d57d6f240efacf2c96d3cbde4d010e9a Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 13 May 2026 09:47:45 +0000
Subject: [PATCH 31/73] chore(api): update composite API spec
---
.stats.yml | 2 +-
.../email-security/investigate/investigate.ts | 17 +++++++++
src/resources/radar/http/http.ts | 24 +++++++++++++
src/resources/radar/post-quantum/tls.ts | 35 +++++++++++++++++--
.../investigate/investigate.test.ts | 1 +
tests/api-resources/radar/http/http.test.ts | 3 ++
6 files changed, 78 insertions(+), 4 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 8176f38ea0..39b21058ad 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 2224
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
-openapi_spec_hash: 62e8e24872538e8d6c6ea10982bfd9e1
+openapi_spec_hash: 688a10f8bad37046ecc77a00e6e358c4
config_hash: a0d2c4abe971a3caafcc4324d98d7106
diff --git a/src/resources/email-security/investigate/investigate.ts b/src/resources/email-security/investigate/investigate.ts
index 09d47af3ae..ed8cf1df14 100644
--- a/src/resources/email-security/investigate/investigate.ts
+++ b/src/resources/email-security/investigate/investigate.ts
@@ -205,6 +205,10 @@ export interface InvestigateListResponse {
sent_date?: string | null;
+ smtp_helo_server_ip?: string | null;
+
+ smtp_previous_hop_ip?: string | null;
+
subject?: string | null;
threat_categories?: Array | null;
@@ -214,6 +218,8 @@ export interface InvestigateListResponse {
to_name?: Array | null;
validation?: InvestigateListResponse.Validation;
+
+ x_originating_ip?: string | null;
}
export namespace InvestigateListResponse {
@@ -459,6 +465,10 @@ export interface InvestigateGetResponse {
sent_date?: string | null;
+ smtp_helo_server_ip?: string | null;
+
+ smtp_previous_hop_ip?: string | null;
+
subject?: string | null;
threat_categories?: Array | null;
@@ -468,6 +478,8 @@ export interface InvestigateGetResponse {
to_name?: Array | null;
validation?: InvestigateGetResponse.Validation;
+
+ x_originating_ip?: string | null;
}
export namespace InvestigateGetResponse {
@@ -626,6 +638,11 @@ export interface InvestigateListParams extends V4PagePaginationArrayParams {
*/
cursor?: string;
+ /**
+ * Query param: Delivery status to filter by.
+ */
+ delivery_status?: 'delivered' | 'moved' | 'quarantined' | 'rejected' | 'deferred' | 'bounced' | 'queued';
+
/**
* Query param: Whether to include only detections in search results.
*/
diff --git a/src/resources/radar/http/http.ts b/src/resources/radar/http/http.ts
index 5ccf97d03e..b37a5a2eb9 100644
--- a/src/resources/radar/http/http.ts
+++ b/src/resources/radar/http/http.ts
@@ -80,6 +80,7 @@ export class HTTP extends APIResource {
summaryV2(
dimension:
| 'ADM1'
+ | 'API_TRAFFIC'
| 'AS'
| 'BOT_CLASS'
| 'BROWSER'
@@ -98,6 +99,7 @@ export class HTTP extends APIResource {
summaryV2(
dimension:
| 'ADM1'
+ | 'API_TRAFFIC'
| 'AS'
| 'BOT_CLASS'
| 'BROWSER'
@@ -115,6 +117,7 @@ export class HTTP extends APIResource {
summaryV2(
dimension:
| 'ADM1'
+ | 'API_TRAFFIC'
| 'AS'
| 'BOT_CLASS'
| 'BROWSER'
@@ -180,6 +183,7 @@ export class HTTP extends APIResource {
timeseriesGroupsV2(
dimension:
| 'ADM1'
+ | 'API_TRAFFIC'
| 'AS'
| 'BOT_CLASS'
| 'BROWSER'
@@ -198,6 +202,7 @@ export class HTTP extends APIResource {
timeseriesGroupsV2(
dimension:
| 'ADM1'
+ | 'API_TRAFFIC'
| 'AS'
| 'BOT_CLASS'
| 'BROWSER'
@@ -215,6 +220,7 @@ export class HTTP extends APIResource {
timeseriesGroupsV2(
dimension:
| 'ADM1'
+ | 'API_TRAFFIC'
| 'AS'
| 'BOT_CLASS'
| 'BROWSER'
@@ -656,6 +662,12 @@ export namespace HTTPTimeseriesGroupsV2Response {
}
export interface HTTPSummaryV2Params {
+ /**
+ * Filters results by API traffic classification. API traffic is identified by JSON
+ * or XML response content types on dynamic (non-cacheable) HTTP requests.
+ */
+ apiTraffic?: Array<'API' | 'NON_API'>;
+
/**
* Filters results by Autonomous System. Specify one or more Autonomous System
* Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from
@@ -765,6 +777,12 @@ export interface HTTPTimeseriesParams {
*/
aggInterval?: '15m' | '1h' | '1d' | '1w';
+ /**
+ * Filters results by API traffic classification. API traffic is identified by JSON
+ * or XML response content types on dynamic (non-cacheable) HTTP requests.
+ */
+ apiTraffic?: Array<'API' | 'NON_API'>;
+
/**
* Filters results by Autonomous System. Specify one or more Autonomous System
* Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from
@@ -878,6 +896,12 @@ export interface HTTPTimeseriesGroupsV2Params {
*/
aggInterval?: '15m' | '1h' | '1d' | '1w';
+ /**
+ * Filters results by API traffic classification. API traffic is identified by JSON
+ * or XML response content types on dynamic (non-cacheable) HTTP requests.
+ */
+ apiTraffic?: Array<'API' | 'NON_API'>;
+
/**
* Filters results by Autonomous System. Specify one or more Autonomous System
* Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from
diff --git a/src/resources/radar/post-quantum/tls.ts b/src/resources/radar/post-quantum/tls.ts
index aef3d864d1..20917a665a 100644
--- a/src/resources/radar/post-quantum/tls.ts
+++ b/src/resources/radar/post-quantum/tls.ts
@@ -6,8 +6,9 @@ import * as Core from '../../../core';
export class TLS extends APIResource {
/**
* Tests whether a hostname or IP address supports Post-Quantum (PQ) TLS key
- * exchange. Returns information about the negotiated key exchange algorithm and
- * whether it uses PQ cryptography.
+ * exchange. Returns information about the negotiated key exchange algorithm,
+ * whether it uses PQ cryptography, and any detected TLS implementation bugs (Split
+ * ClientHello, HRR failure, etc.).
*
* @example
* ```ts
@@ -26,6 +27,8 @@ export class TLS extends APIResource {
}
export interface TLSSupportResponse {
+ bugs: TLSSupportResponse.Bugs;
+
/**
* The host that was tested
*/
@@ -42,11 +45,37 @@ export interface TLSSupportResponse {
kexName: string;
/**
- * Whether the negotiated key exchange uses Post-Quantum cryptography
+ * Whether the negotiated key exchange uses Post-Quantum cryptography (specifically
+ * X25519MLKEM768)
*/
pq: boolean;
}
+export namespace TLSSupportResponse {
+ export interface Bugs {
+ /**
+ * Server sends a HelloRetryRequest but fails to complete the handshake after the
+ * client sends the second ClientHello. Often caused by non-compliant TLS 1.3
+ * implementations on shared hosting providers.
+ */
+ hrrFailure: boolean;
+
+ /**
+ * Server rejects fragmented ClientHello caused by large PQ keyshare, but accepts
+ * classical (non-PQ) handshakes. Typically caused by middleboxes or firewalls that
+ * cannot reassemble split TLS ClientHello messages.
+ */
+ splitClientHello: boolean;
+
+ /**
+ * Server cannot handle an unknown key exchange algorithm in the ClientHello
+ * keyshare extension. Compliant servers should respond with HelloRetryRequest for
+ * a supported algorithm.
+ */
+ unknownKeyshare: boolean;
+ }
+}
+
export interface TLSSupportParams {
/**
* Hostname or IP address to test for Post-Quantum TLS support, optionally with
diff --git a/tests/api-resources/email-security/investigate/investigate.test.ts b/tests/api-resources/email-security/investigate/investigate.test.ts
index 24c5646ef5..f650dcfe6e 100644
--- a/tests/api-resources/email-security/investigate/investigate.test.ts
+++ b/tests/api-resources/email-security/investigate/investigate.test.ts
@@ -29,6 +29,7 @@ describe('resource investigate', () => {
action_log: true,
alert_id: 'alert_id',
cursor: 'cursor',
+ delivery_status: 'delivered',
detections_only: true,
domain: 'domain',
end: '2019-12-27T18:11:19.117Z',
diff --git a/tests/api-resources/radar/http/http.test.ts b/tests/api-resources/radar/http/http.test.ts
index 13d952c38f..473eb3fcdf 100644
--- a/tests/api-resources/radar/http/http.test.ts
+++ b/tests/api-resources/radar/http/http.test.ts
@@ -34,6 +34,7 @@ describe('resource http', () => {
client.radar.http.summaryV2(
'ADM1',
{
+ apiTraffic: ['API'],
asn: ['string'],
botClass: ['LIKELY_AUTOMATED'],
continent: ['string'],
@@ -81,6 +82,7 @@ describe('resource http', () => {
client.radar.http.timeseries(
{
aggInterval: '1h',
+ apiTraffic: ['API'],
asn: ['string'],
botClass: ['LIKELY_AUTOMATED'],
browserFamily: ['CHROME'],
@@ -130,6 +132,7 @@ describe('resource http', () => {
'ADM1',
{
aggInterval: '1h',
+ apiTraffic: ['API'],
asn: ['string'],
botClass: ['LIKELY_AUTOMATED'],
continent: ['string'],
From 25e45974ccc809287049fca0b29b010e688f296f Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 13 May 2026 13:28:52 +0000
Subject: [PATCH 32/73] chore(api): update composite API spec
---
.stats.yml | 2 +-
src/resources/zones/custom-nameservers.ts | 5 +++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index 39b21058ad..5e4d31a550 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 2224
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
-openapi_spec_hash: 688a10f8bad37046ecc77a00e6e358c4
+openapi_spec_hash: af35fe9ff5829ddee2028232a1ffd265
config_hash: a0d2c4abe971a3caafcc4324d98d7106
diff --git a/src/resources/zones/custom-nameservers.ts b/src/resources/zones/custom-nameservers.ts
index d5374a1553..31308d3f5d 100644
--- a/src/resources/zones/custom-nameservers.ts
+++ b/src/resources/zones/custom-nameservers.ts
@@ -132,6 +132,11 @@ export namespace CustomNameserverGetResponse {
* Total results available without any search parameters.
*/
total_count?: number;
+
+ /**
+ * The number of total pages in the entire result set.
+ */
+ total_pages?: number;
}
}
From cb2663a44b28ab489f68c5bdeae92b4253a37b11 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 13 May 2026 17:07:35 +0000
Subject: [PATCH 33/73] codegen metadata
---
.stats.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index 5e4d31a550..7fa5a14b3e 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 2224
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
-openapi_spec_hash: af35fe9ff5829ddee2028232a1ffd265
+openapi_spec_hash: 318e54e5c7666a55fb803495fa7e383c
config_hash: a0d2c4abe971a3caafcc4324d98d7106
From 3797a3c733106dff819b73d8651efad5271aa996 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 13 May 2026 22:13:51 +0000
Subject: [PATCH 34/73] chore(api): update composite API spec
---
.stats.yml | 2 +-
.../intel/indicator-feeds/indicator-feeds.ts | 11 +++++++++++
src/resources/workflows/instances/instances.ts | 6 ++++++
3 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index 7fa5a14b3e..97dbd7d9c4 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 2224
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
-openapi_spec_hash: 318e54e5c7666a55fb803495fa7e383c
+openapi_spec_hash: 275833b1cb003b3174b6e01526ccb7a6
config_hash: a0d2c4abe971a3caafcc4324d98d7106
diff --git a/src/resources/intel/indicator-feeds/indicator-feeds.ts b/src/resources/intel/indicator-feeds/indicator-feeds.ts
index 58cd580a2f..67d152fbd4 100644
--- a/src/resources/intel/indicator-feeds/indicator-feeds.ts
+++ b/src/resources/intel/indicator-feeds/indicator-feeds.ts
@@ -317,6 +317,17 @@ export interface IndicatorFeedGetResponse {
*/
last_upload_summary?: IndicatorFeedGetResponse.LastUploadSummary;
+ /**
+ * Human-readable error message describing why the latest upload failed. Populated
+ * only when `latest_upload_status` is `Error`. Returns one of a small fixed set of
+ * category-level messages (invalid domain / IP / URL entries, malformed row or
+ * header, invalid valid_until timestamp, etc.) or the generic `Upload failed` for
+ * unknown or infrastructure-level errors. Never echoes raw error text from the
+ * underlying loader. Intel accounts receive the verbatim loader/API error text
+ * (including specific offending values) instead of these category-level messages.
+ */
+ latest_upload_error?: string;
+
/**
* Status of the latest snapshot uploaded
*/
diff --git a/src/resources/workflows/instances/instances.ts b/src/resources/workflows/instances/instances.ts
index 44f7e01077..0400bfb87c 100644
--- a/src/resources/workflows/instances/instances.ts
+++ b/src/resources/workflows/instances/instances.ts
@@ -236,6 +236,12 @@ export namespace InstanceGetResponse {
* Specifies the timeout duration.
*/
timeout: string | number;
+
+ /**
+ * When set to 'output', step output is redacted from log and step output
+ * responses.
+ */
+ sensitive?: 'output';
}
export namespace Config {
From a9b4a69db45f0f7e171d29a53badfb8a1ab71ad0 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 13 May 2026 22:54:28 +0000
Subject: [PATCH 35/73] codegen metadata
---
.stats.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index 97dbd7d9c4..8ef767b791 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 2224
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
-openapi_spec_hash: 275833b1cb003b3174b6e01526ccb7a6
+openapi_spec_hash: c6b6ec233d76f292d7cafd65a7a5c330
config_hash: a0d2c4abe971a3caafcc4324d98d7106
From cf32841d013936da4d976d331d86c4bfe81ee5c7 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 14 May 2026 10:41:47 +0000
Subject: [PATCH 36/73] codegen metadata
---
.stats.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index 8ef767b791..b83714b276 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 2224
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
-openapi_spec_hash: c6b6ec233d76f292d7cafd65a7a5c330
+openapi_spec_hash: 381c372ce0663f3bff73aeff4c918b2c
config_hash: a0d2c4abe971a3caafcc4324d98d7106
From 99c8dfceaa4d740aad8940a62987ae188b060477 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 14 May 2026 14:06:47 +0000
Subject: [PATCH 37/73] chore(api): update composite API spec
---
.stats.yml | 4 +-
src/resources/api-gateway/api.md | 2 -
.../api-gateway/discovery/discovery.ts | 4 --
src/resources/api-gateway/discovery/index.ts | 2 -
.../api-gateway/discovery/operations.ts | 54 -------------------
.../api-gateway/discovery/operations.test.ts | 21 --------
6 files changed, 2 insertions(+), 85 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index b83714b276..d984d6119a 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 2224
+configured_endpoints: 2223
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
-openapi_spec_hash: 381c372ce0663f3bff73aeff4c918b2c
+openapi_spec_hash: 75233fc92a536588b23158e9a3d0ed90
config_hash: a0d2c4abe971a3caafcc4324d98d7106
diff --git a/src/resources/api-gateway/api.md b/src/resources/api-gateway/api.md
index ff702913f6..a0bb15556e 100644
--- a/src/resources/api-gateway/api.md
+++ b/src/resources/api-gateway/api.md
@@ -27,13 +27,11 @@ Methods:
Types:
- OperationBulkEditResponse
-- OperationEditResponse
Methods:
- client.apiGateway.discovery.operations.list({ ...params }) -> DiscoveryOperationsV4PagePaginationArray
- client.apiGateway.discovery.operations.bulkEdit({ ...params }) -> OperationBulkEditResponse
-- client.apiGateway.discovery.operations.edit(operationId, { ...params }) -> OperationEditResponse
## Labels
diff --git a/src/resources/api-gateway/discovery/discovery.ts b/src/resources/api-gateway/discovery/discovery.ts
index dc9185efdb..207bb9724b 100644
--- a/src/resources/api-gateway/discovery/discovery.ts
+++ b/src/resources/api-gateway/discovery/discovery.ts
@@ -6,8 +6,6 @@ import * as OperationsAPI from './operations';
import {
OperationBulkEditParams,
OperationBulkEditResponse,
- OperationEditParams,
- OperationEditResponse,
OperationListParams,
Operations,
} from './operations';
@@ -129,9 +127,7 @@ export declare namespace Discovery {
export {
Operations as Operations,
type OperationBulkEditResponse as OperationBulkEditResponse,
- type OperationEditResponse as OperationEditResponse,
type OperationListParams as OperationListParams,
type OperationBulkEditParams as OperationBulkEditParams,
- type OperationEditParams as OperationEditParams,
};
}
diff --git a/src/resources/api-gateway/discovery/index.ts b/src/resources/api-gateway/discovery/index.ts
index a2a9fd29a6..43c900321b 100644
--- a/src/resources/api-gateway/discovery/index.ts
+++ b/src/resources/api-gateway/discovery/index.ts
@@ -10,8 +10,6 @@ export {
export {
Operations,
type OperationBulkEditResponse,
- type OperationEditResponse,
type OperationListParams,
type OperationBulkEditParams,
- type OperationEditParams,
} from './operations';
diff --git a/src/resources/api-gateway/discovery/operations.ts b/src/resources/api-gateway/discovery/operations.ts
index f7b4a5fd74..f8802bbaf0 100644
--- a/src/resources/api-gateway/discovery/operations.ts
+++ b/src/resources/api-gateway/discovery/operations.ts
@@ -59,32 +59,6 @@ export class Operations extends APIResource {
}) as Core.APIPromise<{ result: OperationBulkEditResponse }>
)._thenUnwrap((obj) => obj.result);
}
-
- /**
- * Update the `state` on a discovered operation
- *
- * @example
- * ```ts
- * const response =
- * await client.apiGateway.discovery.operations.edit(
- * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
- * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
- * );
- * ```
- */
- edit(
- operationId: string,
- params: OperationEditParams,
- options?: Core.RequestOptions,
- ): Core.APIPromise {
- const { zone_id, ...body } = params;
- return (
- this._client.patch(`/zones/${zone_id}/api_gateway/discovery/operations/${operationId}`, {
- body,
- ...options,
- }) as Core.APIPromise<{ result: OperationEditResponse }>
- )._thenUnwrap((obj) => obj.result);
- }
}
export type OperationBulkEditResponse = { [key: string]: OperationBulkEditResponse.item };
@@ -104,17 +78,6 @@ export namespace OperationBulkEditResponse {
}
}
-export interface OperationEditResponse {
- /**
- * State of operation in API Discovery
- *
- * - `review` - Operation is not saved into API Shield Endpoint Management
- * - `saved` - Operation is saved into API Shield Endpoint Management
- * - `ignored` - Operation is marked as ignored
- */
- state?: 'review' | 'saved' | 'ignored';
-}
-
export interface OperationListParams extends V4PagePaginationArrayParams {
/**
* Path param: Identifier.
@@ -202,28 +165,11 @@ export namespace OperationBulkEditParams {
}
}
-export interface OperationEditParams {
- /**
- * Path param: Identifier.
- */
- zone_id: string;
-
- /**
- * Body param: Mark state of operation in API Discovery
- *
- * - `review` - Mark operation as for review
- * - `ignored` - Mark operation as ignored
- */
- state?: 'review' | 'ignored';
-}
-
export declare namespace Operations {
export {
type OperationBulkEditResponse as OperationBulkEditResponse,
- type OperationEditResponse as OperationEditResponse,
type OperationListParams as OperationListParams,
type OperationBulkEditParams as OperationBulkEditParams,
- type OperationEditParams as OperationEditParams,
};
}
diff --git a/tests/api-resources/api-gateway/discovery/operations.test.ts b/tests/api-resources/api-gateway/discovery/operations.test.ts
index f1de475ff3..2c591aed66 100644
--- a/tests/api-resources/api-gateway/discovery/operations.test.ts
+++ b/tests/api-resources/api-gateway/discovery/operations.test.ts
@@ -65,25 +65,4 @@ describe('resource operations', () => {
},
});
});
-
- test('edit: only required params', async () => {
- const responsePromise = client.apiGateway.discovery.operations.edit(
- 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
- { zone_id: '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);
- });
-
- test('edit: required and optional params', async () => {
- const response = await client.apiGateway.discovery.operations.edit(
- 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
- { zone_id: '023e105f4ecef8ad9ca31a8372d0c353', state: 'review' },
- );
- });
});
From 5513ec7b2e9b298dc6ee5a89ab2538447e8690bf Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 14 May 2026 14:13:31 +0000
Subject: [PATCH 38/73] feat: feat(api): add advanced_tcp_protection endpoint
mappings
* feat(api): add advanced_tcp_protection endpoint mappings for APIX-639
---
.stats.yml | 4 +-
api.md | 2 +
scripts/detect-breaking-changes | 17 +
src/index.ts | 5 +
src/resources/ddos-protection.ts | 3 +
.../advanced-tcp-protection.ts | 3 +
.../advanced-tcp-protection.ts | 93 +++++
.../advanced-tcp-protection/allowlist.ts | 3 +
.../allowlist/allowlist.ts | 277 +++++++++++++
.../allowlist/index.ts | 21 +
.../allowlist/items.ts | 233 +++++++++++
.../advanced-tcp-protection/index.ts | 35 ++
.../advanced-tcp-protection/prefixes.ts | 3 +
.../advanced-tcp-protection/prefixes/index.ts | 24 ++
.../advanced-tcp-protection/prefixes/items.ts | 233 +++++++++++
.../prefixes/prefixes.ts | 377 ++++++++++++++++++
.../advanced-tcp-protection/status.ts | 87 ++++
.../advanced-tcp-protection/syn-protection.ts | 3 +
.../syn-protection/filters.ts | 3 +
.../syn-protection/filters/filters.ts | 266 ++++++++++++
.../syn-protection/filters/index.ts | 21 +
.../syn-protection/filters/items.ts | 224 +++++++++++
.../syn-protection/index.ts | 23 ++
.../syn-protection/rules.ts | 3 +
.../syn-protection/rules/index.ts | 21 +
.../syn-protection/rules/items.ts | 287 +++++++++++++
.../syn-protection/rules/rules.ts | 337 ++++++++++++++++
.../syn-protection/syn-protection.ts | 59 +++
.../tcp-flow-protection.ts | 3 +
.../tcp-flow-protection/filters.ts | 3 +
.../tcp-flow-protection/filters/filters.ts | 266 ++++++++++++
.../tcp-flow-protection/filters/index.ts | 21 +
.../tcp-flow-protection/filters/items.ts | 224 +++++++++++
.../tcp-flow-protection/index.ts | 23 ++
.../tcp-flow-protection/rules.ts | 3 +
.../tcp-flow-protection/rules/index.ts | 21 +
.../tcp-flow-protection/rules/items.ts | 271 +++++++++++++
.../tcp-flow-protection/rules/rules.ts | 320 +++++++++++++++
.../tcp-flow-protection.ts | 59 +++
src/resources/ddos-protection/api.md | 189 +++++++++
.../ddos-protection/ddos-protection.ts | 16 +
src/resources/ddos-protection/index.ts | 4 +
src/resources/index.ts | 1 +
.../allowlist/allowlist.test.ts | 79 ++++
.../allowlist/items.test.ts | 79 ++++
.../prefixes/items.test.ts | 79 ++++
.../prefixes/prefixes.test.ts | 112 ++++++
.../advanced-tcp-protection/status.test.ts | 52 +++
.../syn-protection/filters/filters.test.ts | 78 ++++
.../syn-protection/filters/items.test.ts | 79 ++++
.../syn-protection/rules/items.test.ts | 81 ++++
.../syn-protection/rules/rules.test.ts | 84 ++++
.../filters/filters.test.ts | 78 ++++
.../tcp-flow-protection/filters/items.test.ts | 80 ++++
.../tcp-flow-protection/rules/items.test.ts | 80 ++++
.../tcp-flow-protection/rules/rules.test.ts | 83 ++++
56 files changed, 5133 insertions(+), 2 deletions(-)
create mode 100644 src/resources/ddos-protection.ts
create mode 100644 src/resources/ddos-protection/advanced-tcp-protection.ts
create mode 100644 src/resources/ddos-protection/advanced-tcp-protection/advanced-tcp-protection.ts
create mode 100644 src/resources/ddos-protection/advanced-tcp-protection/allowlist.ts
create mode 100644 src/resources/ddos-protection/advanced-tcp-protection/allowlist/allowlist.ts
create mode 100644 src/resources/ddos-protection/advanced-tcp-protection/allowlist/index.ts
create mode 100644 src/resources/ddos-protection/advanced-tcp-protection/allowlist/items.ts
create mode 100644 src/resources/ddos-protection/advanced-tcp-protection/index.ts
create mode 100644 src/resources/ddos-protection/advanced-tcp-protection/prefixes.ts
create mode 100644 src/resources/ddos-protection/advanced-tcp-protection/prefixes/index.ts
create mode 100644 src/resources/ddos-protection/advanced-tcp-protection/prefixes/items.ts
create mode 100644 src/resources/ddos-protection/advanced-tcp-protection/prefixes/prefixes.ts
create mode 100644 src/resources/ddos-protection/advanced-tcp-protection/status.ts
create mode 100644 src/resources/ddos-protection/advanced-tcp-protection/syn-protection.ts
create mode 100644 src/resources/ddos-protection/advanced-tcp-protection/syn-protection/filters.ts
create mode 100644 src/resources/ddos-protection/advanced-tcp-protection/syn-protection/filters/filters.ts
create mode 100644 src/resources/ddos-protection/advanced-tcp-protection/syn-protection/filters/index.ts
create mode 100644 src/resources/ddos-protection/advanced-tcp-protection/syn-protection/filters/items.ts
create mode 100644 src/resources/ddos-protection/advanced-tcp-protection/syn-protection/index.ts
create mode 100644 src/resources/ddos-protection/advanced-tcp-protection/syn-protection/rules.ts
create mode 100644 src/resources/ddos-protection/advanced-tcp-protection/syn-protection/rules/index.ts
create mode 100644 src/resources/ddos-protection/advanced-tcp-protection/syn-protection/rules/items.ts
create mode 100644 src/resources/ddos-protection/advanced-tcp-protection/syn-protection/rules/rules.ts
create mode 100644 src/resources/ddos-protection/advanced-tcp-protection/syn-protection/syn-protection.ts
create mode 100644 src/resources/ddos-protection/advanced-tcp-protection/tcp-flow-protection.ts
create mode 100644 src/resources/ddos-protection/advanced-tcp-protection/tcp-flow-protection/filters.ts
create mode 100644 src/resources/ddos-protection/advanced-tcp-protection/tcp-flow-protection/filters/filters.ts
create mode 100644 src/resources/ddos-protection/advanced-tcp-protection/tcp-flow-protection/filters/index.ts
create mode 100644 src/resources/ddos-protection/advanced-tcp-protection/tcp-flow-protection/filters/items.ts
create mode 100644 src/resources/ddos-protection/advanced-tcp-protection/tcp-flow-protection/index.ts
create mode 100644 src/resources/ddos-protection/advanced-tcp-protection/tcp-flow-protection/rules.ts
create mode 100644 src/resources/ddos-protection/advanced-tcp-protection/tcp-flow-protection/rules/index.ts
create mode 100644 src/resources/ddos-protection/advanced-tcp-protection/tcp-flow-protection/rules/items.ts
create mode 100644 src/resources/ddos-protection/advanced-tcp-protection/tcp-flow-protection/rules/rules.ts
create mode 100644 src/resources/ddos-protection/advanced-tcp-protection/tcp-flow-protection/tcp-flow-protection.ts
create mode 100644 src/resources/ddos-protection/api.md
create mode 100644 src/resources/ddos-protection/ddos-protection.ts
create mode 100644 src/resources/ddos-protection/index.ts
create mode 100644 tests/api-resources/ddos-protection/advanced-tcp-protection/allowlist/allowlist.test.ts
create mode 100644 tests/api-resources/ddos-protection/advanced-tcp-protection/allowlist/items.test.ts
create mode 100644 tests/api-resources/ddos-protection/advanced-tcp-protection/prefixes/items.test.ts
create mode 100644 tests/api-resources/ddos-protection/advanced-tcp-protection/prefixes/prefixes.test.ts
create mode 100644 tests/api-resources/ddos-protection/advanced-tcp-protection/status.test.ts
create mode 100644 tests/api-resources/ddos-protection/advanced-tcp-protection/syn-protection/filters/filters.test.ts
create mode 100644 tests/api-resources/ddos-protection/advanced-tcp-protection/syn-protection/filters/items.test.ts
create mode 100644 tests/api-resources/ddos-protection/advanced-tcp-protection/syn-protection/rules/items.test.ts
create mode 100644 tests/api-resources/ddos-protection/advanced-tcp-protection/syn-protection/rules/rules.test.ts
create mode 100644 tests/api-resources/ddos-protection/advanced-tcp-protection/tcp-flow-protection/filters/filters.test.ts
create mode 100644 tests/api-resources/ddos-protection/advanced-tcp-protection/tcp-flow-protection/filters/items.test.ts
create mode 100644 tests/api-resources/ddos-protection/advanced-tcp-protection/tcp-flow-protection/rules/items.test.ts
create mode 100644 tests/api-resources/ddos-protection/advanced-tcp-protection/tcp-flow-protection/rules/rules.test.ts
diff --git a/.stats.yml b/.stats.yml
index d984d6119a..d6a4984cd6 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 2223
+configured_endpoints: 2262
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
openapi_spec_hash: 75233fc92a536588b23158e9a3d0ed90
-config_hash: a0d2c4abe971a3caafcc4324d98d7106
+config_hash: 554d1342364a8f4cc148dba5d7d8c997
diff --git a/api.md b/api.md
index dffd6a3c44..5bfb9e5cad 100644
--- a/api.md
+++ b/api.md
@@ -129,6 +129,8 @@ Types:
# [MagicTransit](src/resources/magic-transit/api.md)
+# [DDoSProtection](src/resources/ddos-protection/api.md)
+
# [MagicNetworkMonitoring](src/resources/magic-network-monitoring/api.md)
# [MagicCloudNetworking](src/resources/magic-cloud-networking/api.md)
diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes
index f3ab109852..fab3dc6204 100755
--- a/scripts/detect-breaking-changes
+++ b/scripts/detect-breaking-changes
@@ -337,6 +337,23 @@ TEST_PATHS=(
tests/api-resources/magic-transit/pcaps/pcaps.test.ts
tests/api-resources/magic-transit/pcaps/ownership.test.ts
tests/api-resources/magic-transit/pcaps/download.test.ts
+ tests/api-resources/ddos-protection/ddos-protection.test.ts
+ tests/api-resources/ddos-protection/advanced-tcp-protection/advanced-tcp-protection.test.ts
+ tests/api-resources/ddos-protection/advanced-tcp-protection/allowlist/allowlist.test.ts
+ tests/api-resources/ddos-protection/advanced-tcp-protection/allowlist/items.test.ts
+ tests/api-resources/ddos-protection/advanced-tcp-protection/prefixes/prefixes.test.ts
+ tests/api-resources/ddos-protection/advanced-tcp-protection/prefixes/items.test.ts
+ tests/api-resources/ddos-protection/advanced-tcp-protection/syn-protection/syn-protection.test.ts
+ tests/api-resources/ddos-protection/advanced-tcp-protection/syn-protection/filters/filters.test.ts
+ tests/api-resources/ddos-protection/advanced-tcp-protection/syn-protection/filters/items.test.ts
+ tests/api-resources/ddos-protection/advanced-tcp-protection/syn-protection/rules/rules.test.ts
+ tests/api-resources/ddos-protection/advanced-tcp-protection/syn-protection/rules/items.test.ts
+ tests/api-resources/ddos-protection/advanced-tcp-protection/tcp-flow-protection/tcp-flow-protection.test.ts
+ tests/api-resources/ddos-protection/advanced-tcp-protection/tcp-flow-protection/filters/filters.test.ts
+ tests/api-resources/ddos-protection/advanced-tcp-protection/tcp-flow-protection/filters/items.test.ts
+ tests/api-resources/ddos-protection/advanced-tcp-protection/tcp-flow-protection/rules/rules.test.ts
+ tests/api-resources/ddos-protection/advanced-tcp-protection/tcp-flow-protection/rules/items.test.ts
+ tests/api-resources/ddos-protection/advanced-tcp-protection/status.test.ts
tests/api-resources/magic-network-monitoring/magic-network-monitoring.test.ts
tests/api-resources/magic-network-monitoring/vpc-flows/vpc-flows.test.ts
tests/api-resources/magic-network-monitoring/vpc-flows/tokens.test.ts
diff --git a/src/index.ts b/src/index.ts
index e8558e34ce..8e74e9dde1 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -51,6 +51,7 @@ import { CustomNameservers } from './resources/custom-nameservers/custom-nameser
import { CustomPages } from './resources/custom-pages/custom-pages';
import { D1Resource } from './resources/d1/d1';
import { DCVDelegation } from './resources/dcv-delegation/dcv-delegation';
+import { DDoSProtection } from './resources/ddos-protection/ddos-protection';
import { Diagnostics } from './resources/diagnostics/diagnostics';
import { DNSFirewall } from './resources/dns-firewall/dns-firewall';
import { DNS } from './resources/dns/dns';
@@ -328,6 +329,7 @@ export class Cloudflare extends Core.APIClient {
images: API.Images = new API.Images(this);
intel: API.Intel = new API.Intel(this);
magicTransit: API.MagicTransit = new API.MagicTransit(this);
+ DDoSProtection: API.DDoSProtection = new API.DDoSProtection(this);
magicNetworkMonitoring: API.MagicNetworkMonitoring = new API.MagicNetworkMonitoring(this);
magicCloudNetworking: API.MagicCloudNetworking = new API.MagicCloudNetworking(this);
networkInterconnects: API.NetworkInterconnects = new API.NetworkInterconnects(this);
@@ -577,6 +579,7 @@ Cloudflare.Diagnostics = Diagnostics;
Cloudflare.Images = Images;
Cloudflare.Intel = Intel;
Cloudflare.MagicTransit = MagicTransit;
+Cloudflare.DDoSProtection = DDoSProtection;
Cloudflare.MagicNetworkMonitoring = MagicNetworkMonitoring;
Cloudflare.MagicCloudNetworking = MagicCloudNetworking;
Cloudflare.NetworkInterconnects = NetworkInterconnects;
@@ -772,6 +775,8 @@ export declare namespace Cloudflare {
export { MagicTransit as MagicTransit };
+ export { DDoSProtection as DDoSProtection };
+
export { MagicNetworkMonitoring as MagicNetworkMonitoring };
export { MagicCloudNetworking as MagicCloudNetworking };
diff --git a/src/resources/ddos-protection.ts b/src/resources/ddos-protection.ts
new file mode 100644
index 0000000000..294ab1e017
--- /dev/null
+++ b/src/resources/ddos-protection.ts
@@ -0,0 +1,3 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+export * from './ddos-protection/index';
diff --git a/src/resources/ddos-protection/advanced-tcp-protection.ts b/src/resources/ddos-protection/advanced-tcp-protection.ts
new file mode 100644
index 0000000000..6a0445e3a1
--- /dev/null
+++ b/src/resources/ddos-protection/advanced-tcp-protection.ts
@@ -0,0 +1,3 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+export * from './advanced-tcp-protection/index';
diff --git a/src/resources/ddos-protection/advanced-tcp-protection/advanced-tcp-protection.ts b/src/resources/ddos-protection/advanced-tcp-protection/advanced-tcp-protection.ts
new file mode 100644
index 0000000000..01e9b16e88
--- /dev/null
+++ b/src/resources/ddos-protection/advanced-tcp-protection/advanced-tcp-protection.ts
@@ -0,0 +1,93 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import { APIResource } from '../../../resource';
+import * as StatusAPI from './status';
+import { Status, StatusEditParams, StatusEditResponse, StatusGetParams, StatusGetResponse } from './status';
+import * as AllowlistAPI from './allowlist/allowlist';
+import {
+ Allowlist,
+ AllowlistBulkDeleteParams,
+ AllowlistBulkDeleteResponse,
+ AllowlistCreateParams,
+ AllowlistCreateResponse,
+ AllowlistListParams,
+ AllowlistListResponse,
+ AllowlistListResponsesV4PagePaginationArray,
+} from './allowlist/allowlist';
+import * as PrefixesAPI from './prefixes/prefixes';
+import {
+ PrefixBulkCreateParams,
+ PrefixBulkCreateResponse,
+ PrefixBulkCreateResponsesSinglePage,
+ PrefixBulkDeleteParams,
+ PrefixBulkDeleteResponse,
+ PrefixCreateParams,
+ PrefixCreateResponse,
+ PrefixListParams,
+ PrefixListResponse,
+ PrefixListResponsesV4PagePaginationArray,
+ Prefixes,
+} from './prefixes/prefixes';
+import * as SynProtectionAPI from './syn-protection/syn-protection';
+import { SynProtection } from './syn-protection/syn-protection';
+import * as TCPFlowProtectionAPI from './tcp-flow-protection/tcp-flow-protection';
+import { TCPFlowProtection } from './tcp-flow-protection/tcp-flow-protection';
+
+export class AdvancedTCPProtection extends APIResource {
+ allowlist: AllowlistAPI.Allowlist = new AllowlistAPI.Allowlist(this._client);
+ prefixes: PrefixesAPI.Prefixes = new PrefixesAPI.Prefixes(this._client);
+ synProtection: SynProtectionAPI.SynProtection = new SynProtectionAPI.SynProtection(this._client);
+ tcpFlowProtection: TCPFlowProtectionAPI.TCPFlowProtection = new TCPFlowProtectionAPI.TCPFlowProtection(
+ this._client,
+ );
+ status: StatusAPI.Status = new StatusAPI.Status(this._client);
+}
+
+AdvancedTCPProtection.Allowlist = Allowlist;
+AdvancedTCPProtection.AllowlistListResponsesV4PagePaginationArray =
+ AllowlistListResponsesV4PagePaginationArray;
+AdvancedTCPProtection.Prefixes = Prefixes;
+AdvancedTCPProtection.PrefixListResponsesV4PagePaginationArray = PrefixListResponsesV4PagePaginationArray;
+AdvancedTCPProtection.PrefixBulkCreateResponsesSinglePage = PrefixBulkCreateResponsesSinglePage;
+AdvancedTCPProtection.SynProtection = SynProtection;
+AdvancedTCPProtection.TCPFlowProtection = TCPFlowProtection;
+AdvancedTCPProtection.Status = Status;
+
+export declare namespace AdvancedTCPProtection {
+ export {
+ Allowlist as Allowlist,
+ type AllowlistCreateResponse as AllowlistCreateResponse,
+ type AllowlistListResponse as AllowlistListResponse,
+ type AllowlistBulkDeleteResponse as AllowlistBulkDeleteResponse,
+ AllowlistListResponsesV4PagePaginationArray as AllowlistListResponsesV4PagePaginationArray,
+ type AllowlistCreateParams as AllowlistCreateParams,
+ type AllowlistListParams as AllowlistListParams,
+ type AllowlistBulkDeleteParams as AllowlistBulkDeleteParams,
+ };
+
+ export {
+ Prefixes as Prefixes,
+ type PrefixCreateResponse as PrefixCreateResponse,
+ type PrefixListResponse as PrefixListResponse,
+ type PrefixBulkCreateResponse as PrefixBulkCreateResponse,
+ type PrefixBulkDeleteResponse as PrefixBulkDeleteResponse,
+ PrefixListResponsesV4PagePaginationArray as PrefixListResponsesV4PagePaginationArray,
+ PrefixBulkCreateResponsesSinglePage as PrefixBulkCreateResponsesSinglePage,
+ type PrefixCreateParams as PrefixCreateParams,
+ type PrefixListParams as PrefixListParams,
+ type PrefixBulkCreateParams as PrefixBulkCreateParams,
+ type PrefixBulkDeleteParams as PrefixBulkDeleteParams,
+ };
+
+ export { SynProtection as SynProtection };
+
+ export { TCPFlowProtection as TCPFlowProtection };
+
+ export {
+ Status as Status,
+ type StatusEditResponse as StatusEditResponse,
+ type StatusGetResponse as StatusGetResponse,
+ type StatusEditParams as StatusEditParams,
+ type StatusGetParams as StatusGetParams,
+ };
+}
diff --git a/src/resources/ddos-protection/advanced-tcp-protection/allowlist.ts b/src/resources/ddos-protection/advanced-tcp-protection/allowlist.ts
new file mode 100644
index 0000000000..f62e4081ef
--- /dev/null
+++ b/src/resources/ddos-protection/advanced-tcp-protection/allowlist.ts
@@ -0,0 +1,3 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+export * from './allowlist/index';
diff --git a/src/resources/ddos-protection/advanced-tcp-protection/allowlist/allowlist.ts b/src/resources/ddos-protection/advanced-tcp-protection/allowlist/allowlist.ts
new file mode 100644
index 0000000000..0358755ddb
--- /dev/null
+++ b/src/resources/ddos-protection/advanced-tcp-protection/allowlist/allowlist.ts
@@ -0,0 +1,277 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import { APIResource } from '../../../../resource';
+import * as Core from '../../../../core';
+import * as ItemsAPI from './items';
+import {
+ ItemDeleteParams,
+ ItemDeleteResponse,
+ ItemEditParams,
+ ItemEditResponse,
+ ItemGetParams,
+ ItemGetResponse,
+ Items,
+} from './items';
+import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../../pagination';
+
+export class Allowlist extends APIResource {
+ items: ItemsAPI.Items = new ItemsAPI.Items(this._client);
+
+ /**
+ * Create an allowlist prefix for an account.
+ *
+ * @example
+ * ```ts
+ * const allowlist =
+ * await client.DDoSProtection.advancedTCPProtection.allowlist.create(
+ * {
+ * account_id: '023e105f4ecef8ad9ca31a8372d0c353',
+ * comment: 'comment',
+ * enabled: true,
+ * prefix: 'prefix',
+ * },
+ * );
+ * ```
+ */
+ create(
+ params: AllowlistCreateParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ const { account_id, ...body } = params;
+ return (
+ this._client.post(`/accounts/${account_id}/magic/advanced_tcp_protection/configs/allowlist`, {
+ body,
+ ...options,
+ }) as Core.APIPromise<{ result: AllowlistCreateResponse }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+
+ /**
+ * List all allowlist prefixes for an account.
+ *
+ * @example
+ * ```ts
+ * // Automatically fetches more pages as needed.
+ * for await (const allowlistListResponse of client.DDoSProtection.advancedTCPProtection.allowlist.list(
+ * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
+ * )) {
+ * // ...
+ * }
+ * ```
+ */
+ list(
+ params: AllowlistListParams,
+ options?: Core.RequestOptions,
+ ): Core.PagePromise {
+ const { account_id, ...query } = params;
+ return this._client.getAPIList(
+ `/accounts/${account_id}/magic/advanced_tcp_protection/configs/allowlist`,
+ AllowlistListResponsesV4PagePaginationArray,
+ { query, ...options },
+ );
+ }
+
+ /**
+ * Delete all allowlist prefixes for an account.
+ *
+ * @example
+ * ```ts
+ * const response =
+ * await client.DDoSProtection.advancedTCPProtection.allowlist.bulkDelete(
+ * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
+ * );
+ * ```
+ */
+ bulkDelete(
+ params: AllowlistBulkDeleteParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ const { account_id } = params;
+ return this._client.delete(
+ `/accounts/${account_id}/magic/advanced_tcp_protection/configs/allowlist`,
+ options,
+ );
+ }
+}
+
+export class AllowlistListResponsesV4PagePaginationArray extends V4PagePaginationArray {}
+
+export interface AllowlistCreateResponse {
+ /**
+ * The unique ID of the allowlist prefix.
+ */
+ id: string;
+
+ /**
+ * An optional comment describing the allowlist prefix.
+ */
+ comment: string;
+
+ /**
+ * The creation timestamp of the allowlist prefix.
+ */
+ created_on: string;
+
+ /**
+ * Whether to enable the allowlist prefix into effect. Defaults to false.
+ */
+ enabled: boolean;
+
+ /**
+ * The last modification timestamp of the allowlist prefix.
+ */
+ modified_on: string;
+
+ /**
+ * The allowlist prefix in CIDR format.
+ */
+ prefix: string;
+}
+
+export interface AllowlistListResponse {
+ /**
+ * The unique ID of the allowlist prefix.
+ */
+ id: string;
+
+ /**
+ * An optional comment describing the allowlist prefix.
+ */
+ comment: string;
+
+ /**
+ * The creation timestamp of the allowlist prefix.
+ */
+ created_on: string;
+
+ /**
+ * Whether to enable the allowlist prefix into effect. Defaults to false.
+ */
+ enabled: boolean;
+
+ /**
+ * The last modification timestamp of the allowlist prefix.
+ */
+ modified_on: string;
+
+ /**
+ * The allowlist prefix in CIDR format.
+ */
+ prefix: string;
+}
+
+export interface AllowlistBulkDeleteResponse {
+ errors: Array;
+
+ messages: Array;
+
+ /**
+ * Whether the API call was successful.
+ */
+ success: true;
+}
+
+export namespace AllowlistBulkDeleteResponse {
+ export interface Error {
+ code: number;
+
+ message: string;
+
+ documentation_url?: string;
+
+ source?: Error.Source;
+ }
+
+ export namespace Error {
+ export interface Source {
+ pointer?: string;
+ }
+ }
+
+ export interface Message {
+ code: number;
+
+ message: string;
+
+ documentation_url?: string;
+
+ source?: Message.Source;
+ }
+
+ export namespace Message {
+ export interface Source {
+ pointer?: string;
+ }
+ }
+}
+
+export interface AllowlistCreateParams {
+ /**
+ * Path param: Identifier.
+ */
+ account_id: string;
+
+ /**
+ * Body param: An comment describing the allowlist prefix.
+ */
+ comment: string;
+
+ /**
+ * Body param: Whether to enable the allowlist prefix into effect.
+ */
+ enabled: boolean;
+
+ /**
+ * Body param: The allowlist prefix to add in CIDR format.
+ */
+ prefix: string;
+}
+
+export interface AllowlistListParams extends V4PagePaginationArrayParams {
+ /**
+ * Path param: Identifier.
+ */
+ account_id: string;
+
+ /**
+ * Query param: The direction of ordering (ASC or DESC). Defaults to 'ASC'.
+ */
+ direction?: string;
+
+ /**
+ * Query param: The field to order by. Defaults to 'prefix'.
+ */
+ order?: string;
+}
+
+export interface AllowlistBulkDeleteParams {
+ /**
+ * Identifier.
+ */
+ account_id: string;
+}
+
+Allowlist.AllowlistListResponsesV4PagePaginationArray = AllowlistListResponsesV4PagePaginationArray;
+Allowlist.Items = Items;
+
+export declare namespace Allowlist {
+ export {
+ type AllowlistCreateResponse as AllowlistCreateResponse,
+ type AllowlistListResponse as AllowlistListResponse,
+ type AllowlistBulkDeleteResponse as AllowlistBulkDeleteResponse,
+ AllowlistListResponsesV4PagePaginationArray as AllowlistListResponsesV4PagePaginationArray,
+ type AllowlistCreateParams as AllowlistCreateParams,
+ type AllowlistListParams as AllowlistListParams,
+ type AllowlistBulkDeleteParams as AllowlistBulkDeleteParams,
+ };
+
+ export {
+ Items as Items,
+ type ItemDeleteResponse as ItemDeleteResponse,
+ type ItemEditResponse as ItemEditResponse,
+ type ItemGetResponse as ItemGetResponse,
+ type ItemDeleteParams as ItemDeleteParams,
+ type ItemEditParams as ItemEditParams,
+ type ItemGetParams as ItemGetParams,
+ };
+}
diff --git a/src/resources/ddos-protection/advanced-tcp-protection/allowlist/index.ts b/src/resources/ddos-protection/advanced-tcp-protection/allowlist/index.ts
new file mode 100644
index 0000000000..45f1e1f951
--- /dev/null
+++ b/src/resources/ddos-protection/advanced-tcp-protection/allowlist/index.ts
@@ -0,0 +1,21 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+export {
+ AllowlistListResponsesV4PagePaginationArray,
+ Allowlist,
+ type AllowlistCreateResponse,
+ type AllowlistListResponse,
+ type AllowlistBulkDeleteResponse,
+ type AllowlistCreateParams,
+ type AllowlistListParams,
+ type AllowlistBulkDeleteParams,
+} from './allowlist';
+export {
+ Items,
+ type ItemDeleteResponse,
+ type ItemEditResponse,
+ type ItemGetResponse,
+ type ItemDeleteParams,
+ type ItemEditParams,
+ type ItemGetParams,
+} from './items';
diff --git a/src/resources/ddos-protection/advanced-tcp-protection/allowlist/items.ts b/src/resources/ddos-protection/advanced-tcp-protection/allowlist/items.ts
new file mode 100644
index 0000000000..e6665a694e
--- /dev/null
+++ b/src/resources/ddos-protection/advanced-tcp-protection/allowlist/items.ts
@@ -0,0 +1,233 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import { APIResource } from '../../../../resource';
+import * as Core from '../../../../core';
+
+export class Items extends APIResource {
+ /**
+ * Delete the allowlist prefix for an account given a UUID.
+ *
+ * @example
+ * ```ts
+ * const item =
+ * await client.DDoSProtection.advancedTCPProtection.allowlist.items.delete(
+ * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
+ * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
+ * );
+ * ```
+ */
+ delete(
+ prefixId: string,
+ params: ItemDeleteParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ const { account_id } = params;
+ return this._client.delete(
+ `/accounts/${account_id}/magic/advanced_tcp_protection/configs/allowlist/${prefixId}`,
+ options,
+ );
+ }
+
+ /**
+ * Update an allowlist prefix specified by the given UUID.
+ *
+ * @example
+ * ```ts
+ * const response =
+ * await client.DDoSProtection.advancedTCPProtection.allowlist.items.edit(
+ * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
+ * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
+ * );
+ * ```
+ */
+ edit(
+ prefixId: string,
+ params: ItemEditParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ const { account_id, ...body } = params;
+ return (
+ this._client.patch(
+ `/accounts/${account_id}/magic/advanced_tcp_protection/configs/allowlist/${prefixId}`,
+ { body, ...options },
+ ) as Core.APIPromise<{ result: ItemEditResponse }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+
+ /**
+ * Get an allowlist prefix specified by the given UUID.
+ *
+ * @example
+ * ```ts
+ * const item =
+ * await client.DDoSProtection.advancedTCPProtection.allowlist.items.get(
+ * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
+ * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
+ * );
+ * ```
+ */
+ get(
+ prefixId: string,
+ params: ItemGetParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ const { account_id } = params;
+ return (
+ this._client.get(
+ `/accounts/${account_id}/magic/advanced_tcp_protection/configs/allowlist/${prefixId}`,
+ options,
+ ) as Core.APIPromise<{ result: ItemGetResponse }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+}
+
+export interface ItemDeleteResponse {
+ errors: Array;
+
+ messages: Array;
+
+ /**
+ * Whether the API call was successful.
+ */
+ success: true;
+}
+
+export namespace ItemDeleteResponse {
+ export interface Error {
+ code: number;
+
+ message: string;
+
+ documentation_url?: string;
+
+ source?: Error.Source;
+ }
+
+ export namespace Error {
+ export interface Source {
+ pointer?: string;
+ }
+ }
+
+ export interface Message {
+ code: number;
+
+ message: string;
+
+ documentation_url?: string;
+
+ source?: Message.Source;
+ }
+
+ export namespace Message {
+ export interface Source {
+ pointer?: string;
+ }
+ }
+}
+
+export interface ItemEditResponse {
+ /**
+ * The unique ID of the allowlist prefix.
+ */
+ id: string;
+
+ /**
+ * An optional comment describing the allowlist prefix.
+ */
+ comment: string;
+
+ /**
+ * The creation timestamp of the allowlist prefix.
+ */
+ created_on: string;
+
+ /**
+ * Whether to enable the allowlist prefix into effect. Defaults to false.
+ */
+ enabled: boolean;
+
+ /**
+ * The last modification timestamp of the allowlist prefix.
+ */
+ modified_on: string;
+
+ /**
+ * The allowlist prefix in CIDR format.
+ */
+ prefix: string;
+}
+
+export interface ItemGetResponse {
+ /**
+ * The unique ID of the allowlist prefix.
+ */
+ id: string;
+
+ /**
+ * An optional comment describing the allowlist prefix.
+ */
+ comment: string;
+
+ /**
+ * The creation timestamp of the allowlist prefix.
+ */
+ created_on: string;
+
+ /**
+ * Whether to enable the allowlist prefix into effect. Defaults to false.
+ */
+ enabled: boolean;
+
+ /**
+ * The last modification timestamp of the allowlist prefix.
+ */
+ modified_on: string;
+
+ /**
+ * The allowlist prefix in CIDR format.
+ */
+ prefix: string;
+}
+
+export interface ItemDeleteParams {
+ /**
+ * Identifier.
+ */
+ account_id: string;
+}
+
+export interface ItemEditParams {
+ /**
+ * Path param: Identifier.
+ */
+ account_id: string;
+
+ /**
+ * Body param: A comment describing the allowlist prefix. Optional.
+ */
+ comment?: string;
+
+ /**
+ * Body param: Whether to enable the allowlist prefix into effect. Optional.
+ */
+ enabled?: boolean;
+}
+
+export interface ItemGetParams {
+ /**
+ * Identifier.
+ */
+ account_id: string;
+}
+
+export declare namespace Items {
+ export {
+ type ItemDeleteResponse as ItemDeleteResponse,
+ type ItemEditResponse as ItemEditResponse,
+ type ItemGetResponse as ItemGetResponse,
+ type ItemDeleteParams as ItemDeleteParams,
+ type ItemEditParams as ItemEditParams,
+ type ItemGetParams as ItemGetParams,
+ };
+}
diff --git a/src/resources/ddos-protection/advanced-tcp-protection/index.ts b/src/resources/ddos-protection/advanced-tcp-protection/index.ts
new file mode 100644
index 0000000000..29af64875f
--- /dev/null
+++ b/src/resources/ddos-protection/advanced-tcp-protection/index.ts
@@ -0,0 +1,35 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+export { AdvancedTCPProtection } from './advanced-tcp-protection';
+export {
+ AllowlistListResponsesV4PagePaginationArray,
+ Allowlist,
+ type AllowlistCreateResponse,
+ type AllowlistListResponse,
+ type AllowlistBulkDeleteResponse,
+ type AllowlistCreateParams,
+ type AllowlistListParams,
+ type AllowlistBulkDeleteParams,
+} from './allowlist/index';
+export {
+ PrefixListResponsesV4PagePaginationArray,
+ PrefixBulkCreateResponsesSinglePage,
+ Prefixes,
+ type PrefixCreateResponse,
+ type PrefixListResponse,
+ type PrefixBulkCreateResponse,
+ type PrefixBulkDeleteResponse,
+ type PrefixCreateParams,
+ type PrefixListParams,
+ type PrefixBulkCreateParams,
+ type PrefixBulkDeleteParams,
+} from './prefixes/index';
+export {
+ Status,
+ type StatusEditResponse,
+ type StatusGetResponse,
+ type StatusEditParams,
+ type StatusGetParams,
+} from './status';
+export { SynProtection } from './syn-protection/index';
+export { TCPFlowProtection } from './tcp-flow-protection/index';
diff --git a/src/resources/ddos-protection/advanced-tcp-protection/prefixes.ts b/src/resources/ddos-protection/advanced-tcp-protection/prefixes.ts
new file mode 100644
index 0000000000..68828b7e91
--- /dev/null
+++ b/src/resources/ddos-protection/advanced-tcp-protection/prefixes.ts
@@ -0,0 +1,3 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+export * from './prefixes/index';
diff --git a/src/resources/ddos-protection/advanced-tcp-protection/prefixes/index.ts b/src/resources/ddos-protection/advanced-tcp-protection/prefixes/index.ts
new file mode 100644
index 0000000000..203cdf872a
--- /dev/null
+++ b/src/resources/ddos-protection/advanced-tcp-protection/prefixes/index.ts
@@ -0,0 +1,24 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+export {
+ Items,
+ type ItemDeleteResponse,
+ type ItemEditResponse,
+ type ItemGetResponse,
+ type ItemDeleteParams,
+ type ItemEditParams,
+ type ItemGetParams,
+} from './items';
+export {
+ PrefixListResponsesV4PagePaginationArray,
+ PrefixBulkCreateResponsesSinglePage,
+ Prefixes,
+ type PrefixCreateResponse,
+ type PrefixListResponse,
+ type PrefixBulkCreateResponse,
+ type PrefixBulkDeleteResponse,
+ type PrefixCreateParams,
+ type PrefixListParams,
+ type PrefixBulkCreateParams,
+ type PrefixBulkDeleteParams,
+} from './prefixes';
diff --git a/src/resources/ddos-protection/advanced-tcp-protection/prefixes/items.ts b/src/resources/ddos-protection/advanced-tcp-protection/prefixes/items.ts
new file mode 100644
index 0000000000..ccab2800e1
--- /dev/null
+++ b/src/resources/ddos-protection/advanced-tcp-protection/prefixes/items.ts
@@ -0,0 +1,233 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import { APIResource } from '../../../../resource';
+import * as Core from '../../../../core';
+
+export class Items extends APIResource {
+ /**
+ * Delete the prefix for an account given a UUID.
+ *
+ * @example
+ * ```ts
+ * const item =
+ * await client.DDoSProtection.advancedTCPProtection.prefixes.items.delete(
+ * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
+ * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
+ * );
+ * ```
+ */
+ delete(
+ prefixId: string,
+ params: ItemDeleteParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ const { account_id } = params;
+ return this._client.delete(
+ `/accounts/${account_id}/magic/advanced_tcp_protection/configs/prefixes/${prefixId}`,
+ options,
+ );
+ }
+
+ /**
+ * Update a prefix specified by the given UUID.
+ *
+ * @example
+ * ```ts
+ * const response =
+ * await client.DDoSProtection.advancedTCPProtection.prefixes.items.edit(
+ * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
+ * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
+ * );
+ * ```
+ */
+ edit(
+ prefixId: string,
+ params: ItemEditParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ const { account_id, ...body } = params;
+ return (
+ this._client.patch(
+ `/accounts/${account_id}/magic/advanced_tcp_protection/configs/prefixes/${prefixId}`,
+ { body, ...options },
+ ) as Core.APIPromise<{ result: ItemEditResponse }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+
+ /**
+ * Get a prefix specified by the given UUID.
+ *
+ * @example
+ * ```ts
+ * const item =
+ * await client.DDoSProtection.advancedTCPProtection.prefixes.items.get(
+ * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
+ * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
+ * );
+ * ```
+ */
+ get(
+ prefixId: string,
+ params: ItemGetParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ const { account_id } = params;
+ return (
+ this._client.get(
+ `/accounts/${account_id}/magic/advanced_tcp_protection/configs/prefixes/${prefixId}`,
+ options,
+ ) as Core.APIPromise<{ result: ItemGetResponse }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+}
+
+export interface ItemDeleteResponse {
+ errors: Array;
+
+ messages: Array;
+
+ /**
+ * Whether the API call was successful.
+ */
+ success: true;
+}
+
+export namespace ItemDeleteResponse {
+ export interface Error {
+ code: number;
+
+ message: string;
+
+ documentation_url?: string;
+
+ source?: Error.Source;
+ }
+
+ export namespace Error {
+ export interface Source {
+ pointer?: string;
+ }
+ }
+
+ export interface Message {
+ code: number;
+
+ message: string;
+
+ documentation_url?: string;
+
+ source?: Message.Source;
+ }
+
+ export namespace Message {
+ export interface Source {
+ pointer?: string;
+ }
+ }
+}
+
+export interface ItemEditResponse {
+ /**
+ * The unique ID of the prefix.
+ */
+ id: string;
+
+ /**
+ * A comment describing the prefix.
+ */
+ comment: string;
+
+ /**
+ * The creation timestamp of the prefix.
+ */
+ created_on: string;
+
+ /**
+ * Whether to exclude the prefix from protection.
+ */
+ excluded: boolean;
+
+ /**
+ * The last modification timestamp of the prefix.
+ */
+ modified_on: string;
+
+ /**
+ * The prefix in CIDR format.
+ */
+ prefix: string;
+}
+
+export interface ItemGetResponse {
+ /**
+ * The unique ID of the prefix.
+ */
+ id: string;
+
+ /**
+ * A comment describing the prefix.
+ */
+ comment: string;
+
+ /**
+ * The creation timestamp of the prefix.
+ */
+ created_on: string;
+
+ /**
+ * Whether to exclude the prefix from protection.
+ */
+ excluded: boolean;
+
+ /**
+ * The last modification timestamp of the prefix.
+ */
+ modified_on: string;
+
+ /**
+ * The prefix in CIDR format.
+ */
+ prefix: string;
+}
+
+export interface ItemDeleteParams {
+ /**
+ * Identifier.
+ */
+ account_id: string;
+}
+
+export interface ItemEditParams {
+ /**
+ * Path param: Identifier.
+ */
+ account_id: string;
+
+ /**
+ * Body param: A new comment for the prefix. Optional.
+ */
+ comment?: string;
+
+ /**
+ * Body param: Whether to exclude the prefix from protection. Optional.
+ */
+ excluded?: boolean;
+}
+
+export interface ItemGetParams {
+ /**
+ * Identifier.
+ */
+ account_id: string;
+}
+
+export declare namespace Items {
+ export {
+ type ItemDeleteResponse as ItemDeleteResponse,
+ type ItemEditResponse as ItemEditResponse,
+ type ItemGetResponse as ItemGetResponse,
+ type ItemDeleteParams as ItemDeleteParams,
+ type ItemEditParams as ItemEditParams,
+ type ItemGetParams as ItemGetParams,
+ };
+}
diff --git a/src/resources/ddos-protection/advanced-tcp-protection/prefixes/prefixes.ts b/src/resources/ddos-protection/advanced-tcp-protection/prefixes/prefixes.ts
new file mode 100644
index 0000000000..ab79619a45
--- /dev/null
+++ b/src/resources/ddos-protection/advanced-tcp-protection/prefixes/prefixes.ts
@@ -0,0 +1,377 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import { APIResource } from '../../../../resource';
+import * as Core from '../../../../core';
+import * as ItemsAPI from './items';
+import {
+ ItemDeleteParams,
+ ItemDeleteResponse,
+ ItemEditParams,
+ ItemEditResponse,
+ ItemGetParams,
+ ItemGetResponse,
+ Items,
+} from './items';
+import { SinglePage, V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../../pagination';
+
+export class Prefixes extends APIResource {
+ items: ItemsAPI.Items = new ItemsAPI.Items(this._client);
+
+ /**
+ * Create a prefix for an account.
+ *
+ * @example
+ * ```ts
+ * const prefix =
+ * await client.DDoSProtection.advancedTCPProtection.prefixes.create(
+ * {
+ * account_id: '023e105f4ecef8ad9ca31a8372d0c353',
+ * comment: 'comment',
+ * excluded: true,
+ * prefix: '192.0.2.0/24',
+ * },
+ * );
+ * ```
+ */
+ create(params: PrefixCreateParams, options?: Core.RequestOptions): Core.APIPromise {
+ const { account_id, ...body } = params;
+ return (
+ this._client.post(`/accounts/${account_id}/magic/advanced_tcp_protection/configs/prefixes`, {
+ body,
+ ...options,
+ }) as Core.APIPromise<{ result: PrefixCreateResponse }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+
+ /**
+ * List all prefixes for an account.
+ *
+ * @example
+ * ```ts
+ * // Automatically fetches more pages as needed.
+ * for await (const prefixListResponse of client.DDoSProtection.advancedTCPProtection.prefixes.list(
+ * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
+ * )) {
+ * // ...
+ * }
+ * ```
+ */
+ list(
+ params: PrefixListParams,
+ options?: Core.RequestOptions,
+ ): Core.PagePromise {
+ const { account_id, ...query } = params;
+ return this._client.getAPIList(
+ `/accounts/${account_id}/magic/advanced_tcp_protection/configs/prefixes`,
+ PrefixListResponsesV4PagePaginationArray,
+ { query, ...options },
+ );
+ }
+
+ /**
+ * Create multiple prefixes for an account.
+ *
+ * @example
+ * ```ts
+ * // Automatically fetches more pages as needed.
+ * for await (const prefixBulkCreateResponse of client.DDoSProtection.advancedTCPProtection.prefixes.bulkCreate(
+ * {
+ * account_id: '023e105f4ecef8ad9ca31a8372d0c353',
+ * body: [
+ * {
+ * comment: 'comment',
+ * excluded: true,
+ * prefix: '192.0.2.0/24',
+ * },
+ * ],
+ * },
+ * )) {
+ * // ...
+ * }
+ * ```
+ */
+ bulkCreate(
+ params: PrefixBulkCreateParams,
+ options?: Core.RequestOptions,
+ ): Core.PagePromise {
+ const { account_id, body } = params;
+ return this._client.getAPIList(
+ `/accounts/${account_id}/magic/advanced_tcp_protection/configs/prefixes/bulk`,
+ PrefixBulkCreateResponsesSinglePage,
+ { body: body, method: 'post', ...options },
+ );
+ }
+
+ /**
+ * Delete all prefixes for an account.
+ *
+ * @example
+ * ```ts
+ * const response =
+ * await client.DDoSProtection.advancedTCPProtection.prefixes.bulkDelete(
+ * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
+ * );
+ * ```
+ */
+ bulkDelete(
+ params: PrefixBulkDeleteParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ const { account_id } = params;
+ return this._client.delete(
+ `/accounts/${account_id}/magic/advanced_tcp_protection/configs/prefixes`,
+ options,
+ );
+ }
+}
+
+export class PrefixListResponsesV4PagePaginationArray extends V4PagePaginationArray {}
+
+export class PrefixBulkCreateResponsesSinglePage extends SinglePage {}
+
+export interface PrefixCreateResponse {
+ /**
+ * The unique ID of the prefix.
+ */
+ id: string;
+
+ /**
+ * A comment describing the prefix.
+ */
+ comment: string;
+
+ /**
+ * The creation timestamp of the prefix.
+ */
+ created_on: string;
+
+ /**
+ * Whether to exclude the prefix from protection.
+ */
+ excluded: boolean;
+
+ /**
+ * The last modification timestamp of the prefix.
+ */
+ modified_on: string;
+
+ /**
+ * The prefix in CIDR format.
+ */
+ prefix: string;
+}
+
+export interface PrefixListResponse {
+ /**
+ * The unique ID of the prefix.
+ */
+ id: string;
+
+ /**
+ * A comment describing the prefix.
+ */
+ comment: string;
+
+ /**
+ * The creation timestamp of the prefix.
+ */
+ created_on: string;
+
+ /**
+ * Whether to exclude the prefix from protection.
+ */
+ excluded: boolean;
+
+ /**
+ * The last modification timestamp of the prefix.
+ */
+ modified_on: string;
+
+ /**
+ * The prefix in CIDR format.
+ */
+ prefix: string;
+}
+
+export interface PrefixBulkCreateResponse {
+ /**
+ * The unique ID of the prefix.
+ */
+ id: string;
+
+ /**
+ * A comment describing the prefix.
+ */
+ comment: string;
+
+ /**
+ * The creation timestamp of the prefix.
+ */
+ created_on: string;
+
+ /**
+ * Whether to exclude the prefix from protection.
+ */
+ excluded: boolean;
+
+ /**
+ * The last modification timestamp of the prefix.
+ */
+ modified_on: string;
+
+ /**
+ * The prefix in CIDR format.
+ */
+ prefix: string;
+}
+
+export interface PrefixBulkDeleteResponse {
+ errors: Array;
+
+ messages: Array;
+
+ /**
+ * Whether the API call was successful.
+ */
+ success: true;
+}
+
+export namespace PrefixBulkDeleteResponse {
+ export interface Error {
+ code: number;
+
+ message: string;
+
+ documentation_url?: string;
+
+ source?: Error.Source;
+ }
+
+ export namespace Error {
+ export interface Source {
+ pointer?: string;
+ }
+ }
+
+ export interface Message {
+ code: number;
+
+ message: string;
+
+ documentation_url?: string;
+
+ source?: Message.Source;
+ }
+
+ export namespace Message {
+ export interface Source {
+ pointer?: string;
+ }
+ }
+}
+
+export interface PrefixCreateParams {
+ /**
+ * Path param: Identifier.
+ */
+ account_id: string;
+
+ /**
+ * Body param: A comment describing the prefix.
+ */
+ comment: string;
+
+ /**
+ * Body param: Whether to exclude the prefix from protection.
+ */
+ excluded: boolean;
+
+ /**
+ * Body param: The prefix to add in CIDR format.
+ */
+ prefix: string;
+}
+
+export interface PrefixListParams extends V4PagePaginationArrayParams {
+ /**
+ * Path param: Identifier.
+ */
+ account_id: string;
+
+ /**
+ * Query param: The direction of ordering (ASC or DESC). Defaults to 'ASC'.
+ */
+ direction?: string;
+
+ /**
+ * Query param: The field to order by. Defaults to 'prefix'.
+ */
+ order?: string;
+}
+
+export interface PrefixBulkCreateParams {
+ /**
+ * Path param: Identifier.
+ */
+ account_id: string;
+
+ /**
+ * Body param
+ */
+ body: Array;
+}
+
+export namespace PrefixBulkCreateParams {
+ export interface Body {
+ /**
+ * A comment describing the prefix.
+ */
+ comment: string;
+
+ /**
+ * Whether to exclude the prefix from protection.
+ */
+ excluded: boolean;
+
+ /**
+ * The prefix to add in CIDR format.
+ */
+ prefix: string;
+ }
+}
+
+export interface PrefixBulkDeleteParams {
+ /**
+ * Identifier.
+ */
+ account_id: string;
+}
+
+Prefixes.PrefixListResponsesV4PagePaginationArray = PrefixListResponsesV4PagePaginationArray;
+Prefixes.PrefixBulkCreateResponsesSinglePage = PrefixBulkCreateResponsesSinglePage;
+Prefixes.Items = Items;
+
+export declare namespace Prefixes {
+ export {
+ type PrefixCreateResponse as PrefixCreateResponse,
+ type PrefixListResponse as PrefixListResponse,
+ type PrefixBulkCreateResponse as PrefixBulkCreateResponse,
+ type PrefixBulkDeleteResponse as PrefixBulkDeleteResponse,
+ PrefixListResponsesV4PagePaginationArray as PrefixListResponsesV4PagePaginationArray,
+ PrefixBulkCreateResponsesSinglePage as PrefixBulkCreateResponsesSinglePage,
+ type PrefixCreateParams as PrefixCreateParams,
+ type PrefixListParams as PrefixListParams,
+ type PrefixBulkCreateParams as PrefixBulkCreateParams,
+ type PrefixBulkDeleteParams as PrefixBulkDeleteParams,
+ };
+
+ export {
+ Items as Items,
+ type ItemDeleteResponse as ItemDeleteResponse,
+ type ItemEditResponse as ItemEditResponse,
+ type ItemGetResponse as ItemGetResponse,
+ type ItemDeleteParams as ItemDeleteParams,
+ type ItemEditParams as ItemEditParams,
+ type ItemGetParams as ItemGetParams,
+ };
+}
diff --git a/src/resources/ddos-protection/advanced-tcp-protection/status.ts b/src/resources/ddos-protection/advanced-tcp-protection/status.ts
new file mode 100644
index 0000000000..b77001bba5
--- /dev/null
+++ b/src/resources/ddos-protection/advanced-tcp-protection/status.ts
@@ -0,0 +1,87 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import { APIResource } from '../../../resource';
+import * as Core from '../../../core';
+
+export class Status extends APIResource {
+ /**
+ * Update the protection status of the account.
+ *
+ * @example
+ * ```ts
+ * const response =
+ * await client.DDoSProtection.advancedTCPProtection.status.edit(
+ * {
+ * account_id: '023e105f4ecef8ad9ca31a8372d0c353',
+ * enabled: true,
+ * },
+ * );
+ * ```
+ */
+ edit(params: StatusEditParams, options?: Core.RequestOptions): Core.APIPromise {
+ const { account_id, ...body } = params;
+ return (
+ this._client.patch(
+ `/accounts/${account_id}/magic/advanced_tcp_protection/configs/tcp_protection_status`,
+ { body, ...options },
+ ) as Core.APIPromise<{ result: StatusEditResponse }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+
+ /**
+ * Get the protection status of the account.
+ *
+ * @example
+ * ```ts
+ * const status =
+ * await client.DDoSProtection.advancedTCPProtection.status.get(
+ * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
+ * );
+ * ```
+ */
+ get(params: StatusGetParams, options?: Core.RequestOptions): Core.APIPromise {
+ const { account_id } = params;
+ return (
+ this._client.get(
+ `/accounts/${account_id}/magic/advanced_tcp_protection/configs/tcp_protection_status`,
+ options,
+ ) as Core.APIPromise<{ result: StatusGetResponse }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+}
+
+export interface StatusEditResponse {
+ enabled: boolean;
+}
+
+export interface StatusGetResponse {
+ enabled: boolean;
+}
+
+export interface StatusEditParams {
+ /**
+ * Path param: Identifier.
+ */
+ account_id: string;
+
+ /**
+ * Body param: Enables or disables protection.
+ */
+ enabled: boolean;
+}
+
+export interface StatusGetParams {
+ /**
+ * Identifier.
+ */
+ account_id: string;
+}
+
+export declare namespace Status {
+ export {
+ type StatusEditResponse as StatusEditResponse,
+ type StatusGetResponse as StatusGetResponse,
+ type StatusEditParams as StatusEditParams,
+ type StatusGetParams as StatusGetParams,
+ };
+}
diff --git a/src/resources/ddos-protection/advanced-tcp-protection/syn-protection.ts b/src/resources/ddos-protection/advanced-tcp-protection/syn-protection.ts
new file mode 100644
index 0000000000..854a17a299
--- /dev/null
+++ b/src/resources/ddos-protection/advanced-tcp-protection/syn-protection.ts
@@ -0,0 +1,3 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+export * from './syn-protection/index';
diff --git a/src/resources/ddos-protection/advanced-tcp-protection/syn-protection/filters.ts b/src/resources/ddos-protection/advanced-tcp-protection/syn-protection/filters.ts
new file mode 100644
index 0000000000..27c1404188
--- /dev/null
+++ b/src/resources/ddos-protection/advanced-tcp-protection/syn-protection/filters.ts
@@ -0,0 +1,3 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+export * from './filters/index';
diff --git a/src/resources/ddos-protection/advanced-tcp-protection/syn-protection/filters/filters.ts b/src/resources/ddos-protection/advanced-tcp-protection/syn-protection/filters/filters.ts
new file mode 100644
index 0000000000..f1466697f3
--- /dev/null
+++ b/src/resources/ddos-protection/advanced-tcp-protection/syn-protection/filters/filters.ts
@@ -0,0 +1,266 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import { APIResource } from '../../../../../resource';
+import * as Core from '../../../../../core';
+import * as ItemsAPI from './items';
+import {
+ ItemDeleteParams,
+ ItemDeleteResponse,
+ ItemEditParams,
+ ItemEditResponse,
+ ItemGetParams,
+ ItemGetResponse,
+ Items,
+} from './items';
+import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../../../pagination';
+
+export class Filters extends APIResource {
+ items: ItemsAPI.Items = new ItemsAPI.Items(this._client);
+
+ /**
+ * Create a SYN Protection filter for an account.
+ *
+ * @example
+ * ```ts
+ * const filter =
+ * await client.DDoSProtection.advancedTCPProtection.synProtection.filters.create(
+ * {
+ * account_id: '023e105f4ecef8ad9ca31a8372d0c353',
+ * expression:
+ * 'ip.dst in { 192.0.2.0/24 198.51.100.0/24 } and tcp.srcport in { 80 443 10000..65535 }',
+ * mode: 'mode',
+ * },
+ * );
+ * ```
+ */
+ create(params: FilterCreateParams, options?: Core.RequestOptions): Core.APIPromise {
+ const { account_id, ...body } = params;
+ return (
+ this._client.post(
+ `/accounts/${account_id}/magic/advanced_tcp_protection/configs/syn_protection/filters`,
+ { body, ...options },
+ ) as Core.APIPromise<{ result: FilterCreateResponse }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+
+ /**
+ * List all SYN Protection filters for an account.
+ *
+ * @example
+ * ```ts
+ * // Automatically fetches more pages as needed.
+ * for await (const filterListResponse of client.DDoSProtection.advancedTCPProtection.synProtection.filters.list(
+ * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
+ * )) {
+ * // ...
+ * }
+ * ```
+ */
+ list(
+ params: FilterListParams,
+ options?: Core.RequestOptions,
+ ): Core.PagePromise {
+ const { account_id, ...query } = params;
+ return this._client.getAPIList(
+ `/accounts/${account_id}/magic/advanced_tcp_protection/configs/syn_protection/filters`,
+ FilterListResponsesV4PagePaginationArray,
+ { query, ...options },
+ );
+ }
+
+ /**
+ * Delete all SYN Protection filters for an account.
+ *
+ * @example
+ * ```ts
+ * const response =
+ * await client.DDoSProtection.advancedTCPProtection.synProtection.filters.bulkDelete(
+ * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
+ * );
+ * ```
+ */
+ bulkDelete(
+ params: FilterBulkDeleteParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ const { account_id } = params;
+ return this._client.delete(
+ `/accounts/${account_id}/magic/advanced_tcp_protection/configs/syn_protection/filters`,
+ options,
+ );
+ }
+}
+
+export class FilterListResponsesV4PagePaginationArray extends V4PagePaginationArray {}
+
+export interface FilterCreateResponse {
+ /**
+ * The unique ID of the expression filter.
+ */
+ id: string;
+
+ /**
+ * The creation timestamp of the expression filter.
+ */
+ created_on: string;
+
+ /**
+ * The filter expression.
+ */
+ expression: string;
+
+ /**
+ * The filter's mode. Must be one of 'enabled', 'disabled', 'monitoring'.
+ */
+ mode: string;
+
+ /**
+ * The last modification timestamp of the expression filter.
+ */
+ modified_on: string;
+}
+
+export interface FilterListResponse {
+ /**
+ * The unique ID of the expression filter.
+ */
+ id: string;
+
+ /**
+ * The creation timestamp of the expression filter.
+ */
+ created_on: string;
+
+ /**
+ * The filter expression.
+ */
+ expression: string;
+
+ /**
+ * The filter's mode. Must be one of 'enabled', 'disabled', 'monitoring'.
+ */
+ mode: string;
+
+ /**
+ * The last modification timestamp of the expression filter.
+ */
+ modified_on: string;
+}
+
+export interface FilterBulkDeleteResponse {
+ errors: Array;
+
+ messages: Array;
+
+ /**
+ * Whether the API call was successful.
+ */
+ success: true;
+}
+
+export namespace FilterBulkDeleteResponse {
+ export interface Error {
+ code: number;
+
+ message: string;
+
+ documentation_url?: string;
+
+ source?: Error.Source;
+ }
+
+ export namespace Error {
+ export interface Source {
+ pointer?: string;
+ }
+ }
+
+ export interface Message {
+ code: number;
+
+ message: string;
+
+ documentation_url?: string;
+
+ source?: Message.Source;
+ }
+
+ export namespace Message {
+ export interface Source {
+ pointer?: string;
+ }
+ }
+}
+
+export interface FilterCreateParams {
+ /**
+ * Path param: Identifier.
+ */
+ account_id: string;
+
+ /**
+ * Body param: The filter expression.
+ */
+ expression: string;
+
+ /**
+ * Body param: The filter's mode. Must be one of 'enabled', 'disabled',
+ * 'monitoring'.
+ */
+ mode: string;
+}
+
+export interface FilterListParams extends V4PagePaginationArrayParams {
+ /**
+ * Path param: Identifier.
+ */
+ account_id: string;
+
+ /**
+ * Query param: The direction of ordering (ASC or DESC). Defaults to 'ASC'.
+ */
+ direction?: string;
+
+ /**
+ * Query param: The mode of the filters to get. Optional. Valid values: 'enabled',
+ * 'disabled', 'monitoring'.
+ */
+ mode?: string;
+
+ /**
+ * Query param: The field to order by. Defaults to 'prefix'.
+ */
+ order?: string;
+}
+
+export interface FilterBulkDeleteParams {
+ /**
+ * Identifier.
+ */
+ account_id: string;
+}
+
+Filters.FilterListResponsesV4PagePaginationArray = FilterListResponsesV4PagePaginationArray;
+Filters.Items = Items;
+
+export declare namespace Filters {
+ export {
+ type FilterCreateResponse as FilterCreateResponse,
+ type FilterListResponse as FilterListResponse,
+ type FilterBulkDeleteResponse as FilterBulkDeleteResponse,
+ FilterListResponsesV4PagePaginationArray as FilterListResponsesV4PagePaginationArray,
+ type FilterCreateParams as FilterCreateParams,
+ type FilterListParams as FilterListParams,
+ type FilterBulkDeleteParams as FilterBulkDeleteParams,
+ };
+
+ export {
+ Items as Items,
+ type ItemDeleteResponse as ItemDeleteResponse,
+ type ItemEditResponse as ItemEditResponse,
+ type ItemGetResponse as ItemGetResponse,
+ type ItemDeleteParams as ItemDeleteParams,
+ type ItemEditParams as ItemEditParams,
+ type ItemGetParams as ItemGetParams,
+ };
+}
diff --git a/src/resources/ddos-protection/advanced-tcp-protection/syn-protection/filters/index.ts b/src/resources/ddos-protection/advanced-tcp-protection/syn-protection/filters/index.ts
new file mode 100644
index 0000000000..38cc9322f0
--- /dev/null
+++ b/src/resources/ddos-protection/advanced-tcp-protection/syn-protection/filters/index.ts
@@ -0,0 +1,21 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+export {
+ FilterListResponsesV4PagePaginationArray,
+ Filters,
+ type FilterCreateResponse,
+ type FilterListResponse,
+ type FilterBulkDeleteResponse,
+ type FilterCreateParams,
+ type FilterListParams,
+ type FilterBulkDeleteParams,
+} from './filters';
+export {
+ Items,
+ type ItemDeleteResponse,
+ type ItemEditResponse,
+ type ItemGetResponse,
+ type ItemDeleteParams,
+ type ItemEditParams,
+ type ItemGetParams,
+} from './items';
diff --git a/src/resources/ddos-protection/advanced-tcp-protection/syn-protection/filters/items.ts b/src/resources/ddos-protection/advanced-tcp-protection/syn-protection/filters/items.ts
new file mode 100644
index 0000000000..dc0c23d382
--- /dev/null
+++ b/src/resources/ddos-protection/advanced-tcp-protection/syn-protection/filters/items.ts
@@ -0,0 +1,224 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import { APIResource } from '../../../../../resource';
+import * as Core from '../../../../../core';
+
+export class Items extends APIResource {
+ /**
+ * Delete a SYN Protection filter specified by the given UUID.
+ *
+ * @example
+ * ```ts
+ * const item =
+ * await client.DDoSProtection.advancedTCPProtection.synProtection.filters.items.delete(
+ * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
+ * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
+ * );
+ * ```
+ */
+ delete(
+ filterId: string,
+ params: ItemDeleteParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ const { account_id } = params;
+ return this._client.delete(
+ `/accounts/${account_id}/magic/advanced_tcp_protection/configs/syn_protection/filters/${filterId}`,
+ options,
+ );
+ }
+
+ /**
+ * Update a SYN Protection filter specified by the given UUID.
+ *
+ * @example
+ * ```ts
+ * const response =
+ * await client.DDoSProtection.advancedTCPProtection.synProtection.filters.items.edit(
+ * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
+ * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
+ * );
+ * ```
+ */
+ edit(
+ filterId: string,
+ params: ItemEditParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ const { account_id, ...body } = params;
+ return (
+ this._client.patch(
+ `/accounts/${account_id}/magic/advanced_tcp_protection/configs/syn_protection/filters/${filterId}`,
+ { body, ...options },
+ ) as Core.APIPromise<{ result: ItemEditResponse }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+
+ /**
+ * Get a SYN Protection filter specified by the given UUID.
+ *
+ * @example
+ * ```ts
+ * const item =
+ * await client.DDoSProtection.advancedTCPProtection.synProtection.filters.items.get(
+ * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
+ * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
+ * );
+ * ```
+ */
+ get(
+ filterId: string,
+ params: ItemGetParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ const { account_id } = params;
+ return (
+ this._client.get(
+ `/accounts/${account_id}/magic/advanced_tcp_protection/configs/syn_protection/filters/${filterId}`,
+ options,
+ ) as Core.APIPromise<{ result: ItemGetResponse }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+}
+
+export interface ItemDeleteResponse {
+ errors: Array;
+
+ messages: Array;
+
+ /**
+ * Whether the API call was successful.
+ */
+ success: true;
+}
+
+export namespace ItemDeleteResponse {
+ export interface Error {
+ code: number;
+
+ message: string;
+
+ documentation_url?: string;
+
+ source?: Error.Source;
+ }
+
+ export namespace Error {
+ export interface Source {
+ pointer?: string;
+ }
+ }
+
+ export interface Message {
+ code: number;
+
+ message: string;
+
+ documentation_url?: string;
+
+ source?: Message.Source;
+ }
+
+ export namespace Message {
+ export interface Source {
+ pointer?: string;
+ }
+ }
+}
+
+export interface ItemEditResponse {
+ /**
+ * The unique ID of the expression filter.
+ */
+ id: string;
+
+ /**
+ * The creation timestamp of the expression filter.
+ */
+ created_on: string;
+
+ /**
+ * The filter expression.
+ */
+ expression: string;
+
+ /**
+ * The filter's mode. Must be one of 'enabled', 'disabled', 'monitoring'.
+ */
+ mode: string;
+
+ /**
+ * The last modification timestamp of the expression filter.
+ */
+ modified_on: string;
+}
+
+export interface ItemGetResponse {
+ /**
+ * The unique ID of the expression filter.
+ */
+ id: string;
+
+ /**
+ * The creation timestamp of the expression filter.
+ */
+ created_on: string;
+
+ /**
+ * The filter expression.
+ */
+ expression: string;
+
+ /**
+ * The filter's mode. Must be one of 'enabled', 'disabled', 'monitoring'.
+ */
+ mode: string;
+
+ /**
+ * The last modification timestamp of the expression filter.
+ */
+ modified_on: string;
+}
+
+export interface ItemDeleteParams {
+ /**
+ * Identifier.
+ */
+ account_id: string;
+}
+
+export interface ItemEditParams {
+ /**
+ * Path param: Identifier.
+ */
+ account_id: string;
+
+ /**
+ * Body param: The new filter expression. Optional.
+ */
+ expression?: string;
+
+ /**
+ * Body param: The new mode for the filter. Optional. Must be one of 'enabled',
+ * 'disabled', 'monitoring'.
+ */
+ mode?: string;
+}
+
+export interface ItemGetParams {
+ /**
+ * Identifier.
+ */
+ account_id: string;
+}
+
+export declare namespace Items {
+ export {
+ type ItemDeleteResponse as ItemDeleteResponse,
+ type ItemEditResponse as ItemEditResponse,
+ type ItemGetResponse as ItemGetResponse,
+ type ItemDeleteParams as ItemDeleteParams,
+ type ItemEditParams as ItemEditParams,
+ type ItemGetParams as ItemGetParams,
+ };
+}
diff --git a/src/resources/ddos-protection/advanced-tcp-protection/syn-protection/index.ts b/src/resources/ddos-protection/advanced-tcp-protection/syn-protection/index.ts
new file mode 100644
index 0000000000..c21f6c8ed1
--- /dev/null
+++ b/src/resources/ddos-protection/advanced-tcp-protection/syn-protection/index.ts
@@ -0,0 +1,23 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+export {
+ FilterListResponsesV4PagePaginationArray,
+ Filters,
+ type FilterCreateResponse,
+ type FilterListResponse,
+ type FilterBulkDeleteResponse,
+ type FilterCreateParams,
+ type FilterListParams,
+ type FilterBulkDeleteParams,
+} from './filters/index';
+export {
+ RuleListResponsesV4PagePaginationArray,
+ Rules,
+ type RuleCreateResponse,
+ type RuleListResponse,
+ type RuleBulkDeleteResponse,
+ type RuleCreateParams,
+ type RuleListParams,
+ type RuleBulkDeleteParams,
+} from './rules/index';
+export { SynProtection } from './syn-protection';
diff --git a/src/resources/ddos-protection/advanced-tcp-protection/syn-protection/rules.ts b/src/resources/ddos-protection/advanced-tcp-protection/syn-protection/rules.ts
new file mode 100644
index 0000000000..073142c337
--- /dev/null
+++ b/src/resources/ddos-protection/advanced-tcp-protection/syn-protection/rules.ts
@@ -0,0 +1,3 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+export * from './rules/index';
diff --git a/src/resources/ddos-protection/advanced-tcp-protection/syn-protection/rules/index.ts b/src/resources/ddos-protection/advanced-tcp-protection/syn-protection/rules/index.ts
new file mode 100644
index 0000000000..52f332b1ed
--- /dev/null
+++ b/src/resources/ddos-protection/advanced-tcp-protection/syn-protection/rules/index.ts
@@ -0,0 +1,21 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+export {
+ Items,
+ type ItemDeleteResponse,
+ type ItemEditResponse,
+ type ItemGetResponse,
+ type ItemDeleteParams,
+ type ItemEditParams,
+ type ItemGetParams,
+} from './items';
+export {
+ RuleListResponsesV4PagePaginationArray,
+ Rules,
+ type RuleCreateResponse,
+ type RuleListResponse,
+ type RuleBulkDeleteResponse,
+ type RuleCreateParams,
+ type RuleListParams,
+ type RuleBulkDeleteParams,
+} from './rules';
diff --git a/src/resources/ddos-protection/advanced-tcp-protection/syn-protection/rules/items.ts b/src/resources/ddos-protection/advanced-tcp-protection/syn-protection/rules/items.ts
new file mode 100644
index 0000000000..47ee26a1a6
--- /dev/null
+++ b/src/resources/ddos-protection/advanced-tcp-protection/syn-protection/rules/items.ts
@@ -0,0 +1,287 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import { APIResource } from '../../../../../resource';
+import * as Core from '../../../../../core';
+
+export class Items extends APIResource {
+ /**
+ * Delete a SYN Protection rule specified by the given UUID.
+ *
+ * @example
+ * ```ts
+ * const item =
+ * await client.DDoSProtection.advancedTCPProtection.synProtection.rules.items.delete(
+ * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
+ * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
+ * );
+ * ```
+ */
+ delete(
+ ruleId: string,
+ params: ItemDeleteParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ const { account_id } = params;
+ return this._client.delete(
+ `/accounts/${account_id}/magic/advanced_tcp_protection/configs/syn_protection/rules/${ruleId}`,
+ options,
+ );
+ }
+
+ /**
+ * Update a SYN Protection rule specified by the given UUID.
+ *
+ * @example
+ * ```ts
+ * const response =
+ * await client.DDoSProtection.advancedTCPProtection.synProtection.rules.items.edit(
+ * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
+ * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
+ * );
+ * ```
+ */
+ edit(
+ ruleId: string,
+ params: ItemEditParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ const { account_id, ...body } = params;
+ return (
+ this._client.patch(
+ `/accounts/${account_id}/magic/advanced_tcp_protection/configs/syn_protection/rules/${ruleId}`,
+ { body, ...options },
+ ) as Core.APIPromise<{ result: ItemEditResponse }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+
+ /**
+ * Get a SYN Protection rule specified by the given UUID.
+ *
+ * @example
+ * ```ts
+ * const item =
+ * await client.DDoSProtection.advancedTCPProtection.synProtection.rules.items.get(
+ * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
+ * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
+ * );
+ * ```
+ */
+ get(
+ ruleId: string,
+ params: ItemGetParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise {
+ const { account_id } = params;
+ return (
+ this._client.get(
+ `/accounts/${account_id}/magic/advanced_tcp_protection/configs/syn_protection/rules/${ruleId}`,
+ options,
+ ) as Core.APIPromise<{ result: ItemGetResponse }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+}
+
+export interface ItemDeleteResponse {
+ errors: Array;
+
+ messages: Array;
+
+ /**
+ * Whether the API call was successful.
+ */
+ success: true;
+}
+
+export namespace ItemDeleteResponse {
+ export interface Error {
+ code: number;
+
+ message: string;
+
+ documentation_url?: string;
+
+ source?: Error.Source;
+ }
+
+ export namespace Error {
+ export interface Source {
+ pointer?: string;
+ }
+ }
+
+ export interface Message {
+ code: number;
+
+ message: string;
+
+ documentation_url?: string;
+
+ source?: Message.Source;
+ }
+
+ export namespace Message {
+ export interface Source {
+ pointer?: string;
+ }
+ }
+}
+
+export interface ItemEditResponse {
+ /**
+ * The unique ID of the SYN Protection rule.
+ */
+ id: string;
+
+ /**
+ * The burst sensitivity. Must be one of 'low', 'medium', 'high'.
+ */
+ burst_sensitivity: string;
+
+ /**
+ * The creation timestamp of the SYN Protection rule.
+ */
+ created_on: string;
+
+ /**
+ * The type of mitigation for SYN Protection. Must be one of 'challenge' or
+ * 'retransmit'.
+ */
+ mitigation_type: string;
+
+ /**
+ * The mode for SYN Protection. Must be one of 'enabled', 'disabled', 'monitoring'.
+ */
+ mode: string;
+
+ /**
+ * The last modification timestamp of the SYN Protection rule.
+ */
+ modified_on: string;
+
+ /**
+ * The name of the SYN Protection rule. Value is relative to the 'scope' setting.
+ * For 'global' scope, name should be 'global'. For either the 'region' or
+ * 'datacenter' scope, name should be the actual name of the region or datacenter,
+ * e.g., 'wnam' or 'lax'.
+ */
+ name: string;
+
+ /**
+ * The rate sensitivity. Must be one of 'low', 'medium', 'high'.
+ */
+ rate_sensitivity: string;
+
+ /**
+ * The scope for the SYN Protection rule. Must be one of 'global', 'region', or
+ * 'datacenter'.
+ */
+ scope: string;
+}
+
+export interface ItemGetResponse {
+ /**
+ * The unique ID of the SYN Protection rule.
+ */
+ id: string;
+
+ /**
+ * The burst sensitivity. Must be one of 'low', 'medium', 'high'.
+ */
+ burst_sensitivity: string;
+
+ /**
+ * The creation timestamp of the SYN Protection rule.
+ */
+ created_on: string;
+
+ /**
+ * The type of mitigation for SYN Protection. Must be one of 'challenge' or
+ * 'retransmit'.
+ */
+ mitigation_type: string;
+
+ /**
+ * The mode for SYN Protection. Must be one of 'enabled', 'disabled', 'monitoring'.
+ */
+ mode: string;
+
+ /**
+ * The last modification timestamp of the SYN Protection rule.
+ */
+ modified_on: string;
+
+ /**
+ * The name of the SYN Protection rule. Value is relative to the 'scope' setting.
+ * For 'global' scope, name should be 'global'. For either the 'region' or
+ * 'datacenter' scope, name should be the actual name of the region or datacenter,
+ * e.g., 'wnam' or 'lax'.
+ */
+ name: string;
+
+ /**
+ * The rate sensitivity. Must be one of 'low', 'medium', 'high'.
+ */
+ rate_sensitivity: string;
+
+ /**
+ * The scope for the SYN Protection rule. Must be one of 'global', 'region', or
+ * 'datacenter'.
+ */
+ scope: string;
+}
+
+export interface ItemDeleteParams {
+ /**
+ * Identifier.
+ */
+ account_id: string;
+}
+
+export interface ItemEditParams {
+ /**
+ * Path param: Identifier.
+ */
+ account_id: string;
+
+ /**
+ * Body param: The new burst sensitivity. Optional. Must be one of 'low', 'medium',
+ * 'high'.
+ */
+ burst_sensitivity?: string;
+
+ /**
+ * Body param: The new mitigation type. Optional. Must be one of 'challenge' or
+ * 'retransmit'.
+ */
+ mitigation_type?: string;
+
+ /**
+ * Body param: The new mode for SYN Protection. Optional. Must be one of 'enabled',
+ * 'disabled', 'monitoring'.
+ */
+ mode?: string;
+
+ /**
+ * Body param: The new rate sensitivity. Optional. Must be one of 'low', 'medium',
+ * 'high'.
+ */
+ rate_sensitivity?: string;
+}
+
+export interface ItemGetParams {
+ /**
+ * Identifier.
+ */
+ account_id: string;
+}
+
+export declare namespace Items {
+ export {
+ type ItemDeleteResponse as ItemDeleteResponse,
+ type ItemEditResponse as ItemEditResponse,
+ type ItemGetResponse as ItemGetResponse,
+ type ItemDeleteParams as ItemDeleteParams,
+ type ItemEditParams as ItemEditParams,
+ type ItemGetParams as ItemGetParams,
+ };
+}
diff --git a/src/resources/ddos-protection/advanced-tcp-protection/syn-protection/rules/rules.ts b/src/resources/ddos-protection/advanced-tcp-protection/syn-protection/rules/rules.ts
new file mode 100644
index 0000000000..c3ab1e8b5e
--- /dev/null
+++ b/src/resources/ddos-protection/advanced-tcp-protection/syn-protection/rules/rules.ts
@@ -0,0 +1,337 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import { APIResource } from '../../../../../resource';
+import * as Core from '../../../../../core';
+import * as ItemsAPI from './items';
+import {
+ ItemDeleteParams,
+ ItemDeleteResponse,
+ ItemEditParams,
+ ItemEditResponse,
+ ItemGetParams,
+ ItemGetResponse,
+ Items,
+} from './items';
+import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../../../pagination';
+
+export class Rules extends APIResource {
+ items: ItemsAPI.Items = new ItemsAPI.Items(this._client);
+
+ /**
+ * Create a SYN Protection rule for an account.
+ *
+ * @example
+ * ```ts
+ * const rule =
+ * await client.DDoSProtection.advancedTCPProtection.synProtection.rules.create(
+ * {
+ * account_id: '023e105f4ecef8ad9ca31a8372d0c353',
+ * burst_sensitivity: 'burst_sensitivity',
+ * mode: 'mode',
+ * name: 'name',
+ * rate_sensitivity: 'rate_sensitivity',
+ * scope: 'scope',
+ * },
+ * );
+ * ```
+ */
+ create(params: RuleCreateParams, options?: Core.RequestOptions): Core.APIPromise {
+ const { account_id, ...body } = params;
+ return (
+ this._client.post(
+ `/accounts/${account_id}/magic/advanced_tcp_protection/configs/syn_protection/rules`,
+ { body, ...options },
+ ) as Core.APIPromise<{ result: RuleCreateResponse }>
+ )._thenUnwrap((obj) => obj.result);
+ }
+
+ /**
+ * List all SYN Protection rules for an account.
+ *
+ * @example
+ * ```ts
+ * // Automatically fetches more pages as needed.
+ * for await (const ruleListResponse of client.DDoSProtection.advancedTCPProtection.synProtection.rules.list(
+ * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
+ * )) {
+ * // ...
+ * }
+ * ```
+ */
+ list(
+ params: RuleListParams,
+ options?: Core.RequestOptions,
+ ): Core.PagePromise {
+ const { account_id, ...query } = params;
+ return this._client.getAPIList(
+ `/accounts/${account_id}/magic/advanced_tcp_protection/configs/syn_protection/rules`,
+ RuleListResponsesV4PagePaginationArray,
+ { query, ...options },
+ );
+ }
+
+ /**
+ * Delete all SYN Protection rules for an account.
+ *
+ * @example
+ * ```ts
+ * const response =
+ * await client.DDoSProtection.advancedTCPProtection.synProtection.rules.bulkDelete(
+ * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
+ * );
+ * ```
+ */
+ bulkDelete(
+ params: RuleBulkDeleteParams,
+ options?: Core.RequestOptions,
+ ): Core.APIPromise