diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 0722c756e37..830150bcdce 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -2,12 +2,14 @@ name: CI
on:
push:
- branches-ignore:
- - 'generated'
- - 'codegen/**'
- - 'integrated/**'
- - 'stl-preview-head/**'
- - 'stl-preview-base/**'
+ branches:
+ - '**'
+ - '!integrated/**'
+ - '!stl-preview-head/**'
+ - '!stl-preview-base/**'
+ - '!generated'
+ - '!codegen/**'
+ - 'codegen/stl/**'
pull_request:
branches-ignore:
- 'stl-preview-head/**'
@@ -22,7 +24,7 @@ jobs:
timeout-minutes: 10
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/cloudflare-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
- if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
+ if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
steps:
- uses: actions/checkout@v6
@@ -41,7 +43,7 @@ jobs:
run: ./scripts/lint
build:
- if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
+ if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
timeout-minutes: 10
name: build
permissions:
@@ -66,14 +68,18 @@ jobs:
run: rye build
- name: Get GitHub OIDC Token
- if: github.repository == 'stainless-sdks/cloudflare-python'
+ if: |-
+ github.repository == 'stainless-sdks/cloudflare-python' &&
+ !startsWith(github.ref, 'refs/heads/stl/')
id: github-oidc
- uses: actions/github-script@v6
+ uses: actions/github-script@v8
with:
script: core.setOutput('github_token', await core.getIDToken());
- name: Upload tarball
- if: github.repository == 'stainless-sdks/cloudflare-python'
+ if: |-
+ github.repository == 'stainless-sdks/cloudflare-python' &&
+ !startsWith(github.ref, 'refs/heads/stl/')
env:
URL: https://pkg.stainless.com/s
AUTH: ${{ steps.github-oidc.outputs.github_token }}
@@ -106,7 +112,7 @@ jobs:
timeout-minutes: 10
name: examples
runs-on: ${{ github.repository == 'stainless-sdks/cloudflare-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
- if: github.repository == 'cloudflare/cloudflare-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork)
+ if: github.repository == 'cloudflare/cloudflare-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
steps:
- uses: actions/checkout@v6
@@ -128,5 +134,4 @@ jobs:
CLOUDFLARE_ZONE_ID: 0da42c8d2132a9ddaf714f9e7c920711
CLOUDFLARE_API_KEY: ${{ secrets.CLOUDFLARE_API_KEY }}
run: |
- rye run python ./examples/ai/demo.py
rye run python ./examples/dns/record.py
diff --git a/.gitignore b/.gitignore
index 95ceb189aa4..3824f4c485f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
.prism.log
+.stdy.log
_dev
__pycache__
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 1aa8e3f282a..2c9fce78b18 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "5.0.0-beta.1"
+ ".": "5.0.0-beta.2"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 2dc0294f22e..99f947826a0 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 2015
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-83f49bc3fa9273ef989d3e8bcd27f6fdaa7d04ae2519a91f4878f46acc501bb9.yml
-openapi_spec_hash: 3f4be3af6f51eea4787dc8345f9ca9c1
-config_hash: 9d1829ed664bb3efa8638f98bb32cf46
+configured_endpoints: 2184
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3d7d43f051a510c54ae71adb4b85cbb422565a40942cde4de0c3f8eb6ba8023b.yml
+openapi_spec_hash: e85824f16c3ba923a34e514c06dac7cd
+config_hash: a84b6a70b6374c30a50b477fe248eb3a
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 13307919a9f..76f06d9abbc 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,250 @@
# Changelog
+## 5.0.0-beta.2 (2026-04-20)
+
+Full Changelog: [v5.0.0-beta.1...v5.0.0-beta.2](https://github.com/cloudflare/cloudflare-python/compare/v5.0.0-beta.1...v5.0.0-beta.2)
+
+### Features
+
+* **abuse_reports:** update generated types and methods ([61ae69f](https://github.com/cloudflare/cloudflare-python/commit/61ae69f88c2bac2630a3079b597fddebde8d7e86))
+* **accounts:** update generated types and methods ([2f2af75](https://github.com/cloudflare/cloudflare-python/commit/2f2af75446c7c0221a741efec0889021630c4df0))
+* **acm:** update generated types and methods ([d8104ee](https://github.com/cloudflare/cloudflare-python/commit/d8104ee12cc4e761de3e7383521d32c651f629bb))
+* **addressing:** update generated types and methods ([c757ba5](https://github.com/cloudflare/cloudflare-python/commit/c757ba583b145117b5853634c3c252cad80bde95))
+* **ai_gateway:** update generated types and methods ([c8d5a84](https://github.com/cloudflare/cloudflare-python/commit/c8d5a84c121daf1c66aabb6a096b310eba1db6d3))
+* **aisearch:** update generated types and methods ([b7ff8f4](https://github.com/cloudflare/cloudflare-python/commit/b7ff8f4d3f648d336c9ff829aff880ccf39fdc9d))
+* **ai:** update generated types and methods ([5a22559](https://github.com/cloudflare/cloudflare-python/commit/5a225597b00b5401da05629e8bb83a14745efa98))
+* **alerting:** update generated types and methods ([5e6647d](https://github.com/cloudflare/cloudflare-python/commit/5e6647de2717658c966b2d0d4e59fab61786ddef))
+* **api_gateway:** update generated types and methods ([352a544](https://github.com/cloudflare/cloudflare-python/commit/352a5444bb6799051921c19fde91528791f0b24d))
+* **argo:** update generated types and methods ([069e3d1](https://github.com/cloudflare/cloudflare-python/commit/069e3d16be241815d48d7aab9f2e14641eb1ce50))
+* **audit_logs:** add audit_logs resource ([3b7936f](https://github.com/cloudflare/cloudflare-python/commit/3b7936fe88e54e3a06d1acf0f902a05294a56062))
+* **billing:** update generated types and methods ([a33015c](https://github.com/cloudflare/cloudflare-python/commit/a33015c9c2f68478da4108116f0ab0d5b1b9e028))
+* **botnet_feed:** update generated types and methods ([87570c2](https://github.com/cloudflare/cloudflare-python/commit/87570c243da6e0c2633e44c823c8093818972702))
+* **brand_protection:** update generated types and methods ([deb9bfc](https://github.com/cloudflare/cloudflare-python/commit/deb9bfc72663bbd0317006b6c1c779c778c50bb7))
+* **browser_rendering:** update generated types and methods ([03c87c3](https://github.com/cloudflare/cloudflare-python/commit/03c87c3ec6e46da5315da231c53fa4f1893ced06))
+* **cache:** update generated types and methods ([0aebb39](https://github.com/cloudflare/cloudflare-python/commit/0aebb39b96ba8b7c01693047fe76c684fb8e8031))
+* **calls:** update generated types and methods ([bdda465](https://github.com/cloudflare/cloudflare-python/commit/bdda465058157f28de77f97be48da1265da19a5f))
+* **certificate_authorities:** update generated types and methods ([6c547f2](https://github.com/cloudflare/cloudflare-python/commit/6c547f272d2880317d23e03876ecab05c7731f5e))
+* chore: skip failing tests from TypeScript CI run 24427365644 ([9f455bc](https://github.com/cloudflare/cloudflare-python/commit/9f455bcb4b3b928b9aa260238249fb8b74965ba9))
+* chore: skip prism PUT test for workers domain ([4c4fb7a](https://github.com/cloudflare/cloudflare-python/commit/4c4fb7a862f291e00fcf3c71b8792f2d96068e0c))
+* chore(zero_trust_device_ip_profile): skip go prism tests ([2358e0a](https://github.com/cloudflare/cloudflare-python/commit/2358e0af7d1023765832e67d1bf727b68eee4eb3))
+* **cloud_connector:** update generated types and methods ([d8fc035](https://github.com/cloudflare/cloudflare-python/commit/d8fc0352dee6b1a23184c80b081dd5405ef46616))
+* **cloudforce_one:** update generated types and methods ([191bf4b](https://github.com/cloudflare/cloudflare-python/commit/191bf4b1caf8d9fcab53699d84733b5ce4edf774))
+* **connectivity:** update generated types and methods ([ca1d6d2](https://github.com/cloudflare/cloudflare-python/commit/ca1d6d25fa1e035ee89b3c952f6f28819b9f9ee7))
+* **content_scanning:** update generated types and methods ([71987d0](https://github.com/cloudflare/cloudflare-python/commit/71987d04b411eafc12664fbe8ad153fb4d48a841))
+* **custom_certificates:** update generated types and methods ([9e10c25](https://github.com/cloudflare/cloudflare-python/commit/9e10c25984210f7022c4f2bd98f16c22ab636bf9))
+* **custom_hostnames:** update generated types and methods ([5097baf](https://github.com/cloudflare/cloudflare-python/commit/5097baf9b4260d06ad2b9cd4b641528308005d9f))
+* **custom_pages:** update generated types and methods ([10c791e](https://github.com/cloudflare/cloudflare-python/commit/10c791ef8fa4cf6732ee93c43554c9b060d69797))
+* **d1:** update generated types and methods ([d7801b2](https://github.com/cloudflare/cloudflare-python/commit/d7801b2c3c038932c7113c4ca84d277c009ea7c3))
+* **diagnostics:** update generated types and methods ([dd9dc45](https://github.com/cloudflare/cloudflare-python/commit/dd9dc4511c91977a1dbfd374e4fd688bb1c67d1e))
+* **dns_firewall:** update generated types and methods ([be295a7](https://github.com/cloudflare/cloudflare-python/commit/be295a77db39c222e9f79a4c0182bc89bff476b2))
+* **dns:** update generated types and methods ([a11dee2](https://github.com/cloudflare/cloudflare-python/commit/a11dee2acf35796fff74f0602d25c37093f6f27a))
+* **durable_objects:** update generated types and methods ([5ed7ab2](https://github.com/cloudflare/cloudflare-python/commit/5ed7ab2ab78c2c44ff60224d90cd8fef3c8c9105))
+* **email_routing:** update generated types and methods ([316a3b0](https://github.com/cloudflare/cloudflare-python/commit/316a3b03d669a0d41e84e0f5e0efd193930c77bd))
+* **email_security:** update generated types and methods ([9e189e5](https://github.com/cloudflare/cloudflare-python/commit/9e189e5c7cbb05bad1362edba815b1f0e6288c99))
+* **email_sending:** update generated types and methods ([cd9cdde](https://github.com/cloudflare/cloudflare-python/commit/cd9cdde85558b9ddfb4c333872b32bb63676b788))
+* feat: add billable usage PayGo endpoint to billing resource ([8270297](https://github.com/cloudflare/cloudflare-python/commit/8270297ac9ed0af06b09b8c84aa8d4d6a450b430))
+* feat: add dns_records/usage endpoints (DNS-12466) ([00c000e](https://github.com/cloudflare/cloudflare-python/commit/00c000ed5337fb3b1f6569b628b07c12d8dd488b))
+* feat: BRAPI-1051 add browser rendering devtools methods ([9ad597b](https://github.com/cloudflare/cloudflare-python/commit/9ad597b91f7c1f4b2877064cb01d3a09853ae3a8))
+* feat: DISCO-101 add google_tag_gateway resource ([f79025e](https://github.com/cloudflare/cloudflare-python/commit/f79025ea53c69c9eef458ce68f4ccee0b55b6d6d))
+* feat: GIN-1439: Add gateway PAC files ([89ad3ec](https://github.com/cloudflare/cloudflare-python/commit/89ad3ecda80085641644c675ebd4581d5688edf8))
+* feat(api_gateway): WAM-1196: add stainless SDK bindings for labels endpoints ([860f0f1](https://github.com/cloudflare/cloudflare-python/commit/860f0f159cac4d087761b4b20528600fd426f073))
+* feat(brand_protection): add v2 endpoints ([c525e9c](https://github.com/cloudflare/cloudflare-python/commit/c525e9c04e2901e4457a61a54a4f9eaca141f935))
+* feat(custom_origin_trust_store): enable custom_origin_trust_store ([2309442](https://github.com/cloudflare/cloudflare-python/commit/23094425d29e7fffdd5bf82d326aa7ec7e929f6f))
+* feat(dex): add DEX rules ([1e9c242](https://github.com/cloudflare/cloudflare-python/commit/1e9c2423aed148c30b92b5a3d25b3d62252f4137))
+* feat(email_security): Add phishguard reports endpoint ([e7c939e](https://github.com/cloudflare/cloudflare-python/commit/e7c939ecfa41ca7c825b3d4ff592c62619d26c31))
+* feat(email_sending): EMAIL-1451: add send/send_raw endpoints and move email resources to Workers & Pages nav ([fb77d7b](https://github.com/cloudflare/cloudflare-python/commit/fb77d7b6b49838d3b3046ab617cb76cee45633b8))
+* feat(ip_profile): onboard new terraform resource cloudflare_zero_trust_device_ip_profile ([fe2b21d](https://github.com/cloudflare/cloudflare-python/commit/fe2b21d02c0cd4ecbf5216714907cfb95f374083))
+* feat(radar): Add Botnet and PQ Endpoints to developer docs ([ec3681f](https://github.com/cloudflare/cloudflare-python/commit/ec3681f12a7c0335a60b0778190c80b72f76422b))
+* feat(stainless): add WARP Connector connections and failover endpoints ([7a5d5f8](https://github.com/cloudflare/cloudflare-python/commit/7a5d5f808ed9d6856ac24cbe9c73c774a74b6190))
+* feat(stainless): AUTH-7071 Complete Access Users endpoint ([52a4415](https://github.com/cloudflare/cloudflare-python/commit/52a4415eb345c4316b353404bfe9bf228573a197))
+* feat(stainless): TUN-10249 Add WARP Subnet endpoints ([3accc56](https://github.com/cloudflare/cloudflare-python/commit/3accc56c43e04292b700ea573d036872a8e9cb7b))
+* feat(tags): GRM-385 add resource_tagging routes ([e6917d2](https://github.com/cloudflare/cloudflare-python/commit/e6917d2724f84bfac4693c6625d11ee0f5361f03))
+* feat(terraform): add custom_page_asset resource for custom assets ([719a778](https://github.com/cloudflare/cloudflare-python/commit/719a77818a7f4d011ea6bb7d6c1bbac55a20c661))
+* feat(vulnerability_scanner): add Stainless config for Vulnerability Scanner API ([1b779d6](https://github.com/cloudflare/cloudflare-python/commit/1b779d607af47049ff708be0f27b3a0b17f94815))
+* feat(workers): WO-989 Adds Workers>Observability>Destinations resources ([c1fdeae](https://github.com/cloudflare/cloudflare-python/commit/c1fdeae1ec8cb33145101286fcd97576e36f532d))
+* feat(zero_trust_device_subnet): onboard new terraform resource cloudflare_zero_trust_device_subnet ([bcafc86](https://github.com/cloudflare/cloudflare-python/commit/bcafc86a702e490d04adbf58fd34cd6b3396d897))
+* feat(zones): onboard zone environments endpoints for SDK generation ([2431f72](https://github.com/cloudflare/cloudflare-python/commit/2431f723be3cb06c78c5b5a7e2de21615f636c53))
+* **firewall:** update generated types and methods ([937aa80](https://github.com/cloudflare/cloudflare-python/commit/937aa80e5455b098bf1ff0b62e50eaae3a91fcd4))
+* fix: add 'rdp' as an initialism ([6242c20](https://github.com/cloudflare/cloudflare-python/commit/6242c20ec596748717cddaadd9999738cb924b8f))
+* fix: broken reference for the queues 'consumer' model ([3f5cf39](https://github.com/cloudflare/cloudflare-python/commit/3f5cf39405b6b38fc594ce348d93a6e7da92c276))
+* **google_tag_gateway:** update generated types and methods ([86fe312](https://github.com/cloudflare/cloudflare-python/commit/86fe312c538a58e669c1af8b20d47326361a92c4))
+* **healthchecks:** update generated types and methods ([33a9be1](https://github.com/cloudflare/cloudflare-python/commit/33a9be1fd32249114c60b603a3ca32fb720b2ff6))
+* **hostnames:** update generated types and methods ([7acc871](https://github.com/cloudflare/cloudflare-python/commit/7acc8716348e41ac4c83a259d6d540f2a54a106d))
+* **hyperdrive:** update generated types and methods ([63d8085](https://github.com/cloudflare/cloudflare-python/commit/63d80856752c064b856091a4ce13db883232ca2f))
+* **iam:** update generated types and methods ([28f60ab](https://github.com/cloudflare/cloudflare-python/commit/28f60ab9b84a27d969d4f7d807d3eeccae90a458))
+* **images:** update generated types and methods ([95e3af2](https://github.com/cloudflare/cloudflare-python/commit/95e3af24e70682f14c499d3bc6c49cde593b47b0))
+* **intel:** update generated types and methods ([687bf99](https://github.com/cloudflare/cloudflare-python/commit/687bf99cac26f8e5214d43cedb74186298928bf7))
+* **kv:** update generated types and methods ([fccefbd](https://github.com/cloudflare/cloudflare-python/commit/fccefbdf122df102ef5ad1a4b07bcbedcd3c30d3))
+* **leaked_credential_checks:** update generated types and methods ([ffdcb83](https://github.com/cloudflare/cloudflare-python/commit/ffdcb83287c1c4bd2ba0752e2a475649007a7e29))
+* **load_balancers:** update generated types and methods ([a77c864](https://github.com/cloudflare/cloudflare-python/commit/a77c864ae578d8ef4420bbee6d7d74341d8887f5))
+* **logpush:** update generated types and methods ([b006349](https://github.com/cloudflare/cloudflare-python/commit/b006349927b3d9f59dd96947808f83d62231b09f))
+* **logs:** update generated types and methods ([d670d48](https://github.com/cloudflare/cloudflare-python/commit/d670d486a653463a728993bf0b5db4200b0893a8))
+* **magic_cloud_networking:** update generated types and methods ([43cfdad](https://github.com/cloudflare/cloudflare-python/commit/43cfdad893f017a7751806f9742143d2e3fc460a))
+* **magic_network_monitoring:** update generated types and methods ([868860b](https://github.com/cloudflare/cloudflare-python/commit/868860b1f805fc34d37546632f7b2e8d3200f6bb))
+* **magic_transit:** update generated types and methods ([9ed1208](https://github.com/cloudflare/cloudflare-python/commit/9ed1208cfb40ce41c9bb674f14e1352c5069f23e))
+* **mtls_certificates:** update generated types and methods ([24018ec](https://github.com/cloudflare/cloudflare-python/commit/24018ecf105522f6f89f54aa386bf9f385359d8e))
+* **network_interconnects:** update generated types and methods ([41f7ad4](https://github.com/cloudflare/cloudflare-python/commit/41f7ad4adf210adcecc1d399ec428edbd1bee3b6))
+* **organizations:** update generated types and methods ([b378c7b](https://github.com/cloudflare/cloudflare-python/commit/b378c7b4237088128e67acdba08b222d5a2aebe3))
+* **origin_tls_client_auth:** update generated types and methods ([642de28](https://github.com/cloudflare/cloudflare-python/commit/642de28dc90e3210b9283087dbd1ba33e877f5dd))
+* **page_shield:** update generated types and methods ([b2238d5](https://github.com/cloudflare/cloudflare-python/commit/b2238d59b9a8d0b5f9f6def092edf3ffd966fa04))
+* **pages:** update generated types and methods ([b18193e](https://github.com/cloudflare/cloudflare-python/commit/b18193efba8ecd7a146218255c653978839558b3))
+* **pipelines:** update generated types and methods ([e3eb9a6](https://github.com/cloudflare/cloudflare-python/commit/e3eb9a63da1491b9befc3f100cd7919705b39303))
+* **queues:** update generated types and methods ([a247d9b](https://github.com/cloudflare/cloudflare-python/commit/a247d9b92186cba6d22e988d180fb6d2ba0d8d31))
+* **r2_data_catalog:** update generated types and methods ([7b8e076](https://github.com/cloudflare/cloudflare-python/commit/7b8e076d07092a6db186e82428c858585a3a3983))
+* **r2:** update generated types and methods ([56957ac](https://github.com/cloudflare/cloudflare-python/commit/56957ac938144745180e90543b0ea11b7edeaa0c))
+* **radar:** Add Botnet Threat Feed endpoint ([ec3681f](https://github.com/cloudflare/cloudflare-python/commit/ec3681f12a7c0335a60b0778190c80b72f76422b))
+* **radar:** update generated types and methods ([9f00441](https://github.com/cloudflare/cloudflare-python/commit/9f0044191dfc0ee76f5583f229e6ff27395ae0ef))
+* **realtime_kit:** update generated types and methods ([4cfa1ce](https://github.com/cloudflare/cloudflare-python/commit/4cfa1cead752afbbba7861d17c6359595f75ccd2))
+* **registrar:** update generated types and methods ([ad8ffc4](https://github.com/cloudflare/cloudflare-python/commit/ad8ffc441dc901734b749218b7cad5d3f0ee6970))
+* **request_tracers:** update generated types and methods ([31e2a3e](https://github.com/cloudflare/cloudflare-python/commit/31e2a3e8d9aec07f4b09865a266852ccb8b669d9))
+* **resource_sharing:** update generated types and methods ([457890b](https://github.com/cloudflare/cloudflare-python/commit/457890bc7a094a15aefc2ca95deb5ba14a5f7ba0))
+* **resource_tagging:** update generated types and methods ([48e2e90](https://github.com/cloudflare/cloudflare-python/commit/48e2e9045a7e7838e0ad5f3dbed0832e2d20dbb5))
+* **rules:** update generated types and methods ([235e7dc](https://github.com/cloudflare/cloudflare-python/commit/235e7dc0dc4524c96126aa240ed0c66f694827dd))
+* **rum:** update generated types and methods ([b96c59e](https://github.com/cloudflare/cloudflare-python/commit/b96c59e50d4c0a83f94eac2619e4cbe4f6284c54))
+* **schema_validation:** update generated types and methods ([8782ae0](https://github.com/cloudflare/cloudflare-python/commit/8782ae00d4ea2207da677e3edec98fe716a27d5c))
+* **secrets_store:** update generated types and methods ([cb21d25](https://github.com/cloudflare/cloudflare-python/commit/cb21d254e78a74d3093cbf0311fccbd82daab2c2))
+* **snippets:** update generated types and methods ([3ce6375](https://github.com/cloudflare/cloudflare-python/commit/3ce6375a4684cb495f8418d94c7bf536b35aaa32))
+* **spectrum:** update generated types and methods ([7b5c34d](https://github.com/cloudflare/cloudflare-python/commit/7b5c34db2ed28f89366507a7b8e67fdaf3b82988))
+* **speed:** update generated types and methods ([139a796](https://github.com/cloudflare/cloudflare-python/commit/139a79651f79c0f40198cb7231af366b75cecb57))
+* **ssl:** update generated types and methods ([0728e37](https://github.com/cloudflare/cloudflare-python/commit/0728e372087f7ce5c0ed41573da37c78ecf7cec4))
+* **stream:** update generated types and methods ([fc9fb2f](https://github.com/cloudflare/cloudflare-python/commit/fc9fb2f895c5de968f67c62bb599a6792be9fa8f))
+* test: skip prism tests for endpoints with non-JSON content types ([631d664](https://github.com/cloudflare/cloudflare-python/commit/631d664d36c72148726a7261839ad0f6d24b7ac4))
+* **token_validation:** update generated types and methods ([b15e58c](https://github.com/cloudflare/cloudflare-python/commit/b15e58cb25423185960f944e449460fb8436bd91))
+* **turnstile:** update generated types and methods ([03fe8d7](https://github.com/cloudflare/cloudflare-python/commit/03fe8d79c012b80428ad3f03b4c4bd3a8740851d))
+* **url_scanner:** update generated types and methods ([a5fd174](https://github.com/cloudflare/cloudflare-python/commit/a5fd174668de611e9b659f3181de298a67544966))
+* **user:** update generated types and methods ([0f28133](https://github.com/cloudflare/cloudflare-python/commit/0f28133cd922e112ba3108d9bd01068cfa9db380))
+* **vectorize:** update generated types and methods ([0bc5c7f](https://github.com/cloudflare/cloudflare-python/commit/0bc5c7fb7e5b107603445c7998a0cdaf7613fdf8))
+* **vulnerability_scanner:** update generated types and methods ([0f7ca7d](https://github.com/cloudflare/cloudflare-python/commit/0f7ca7dc83e158daaabcde8ba7a3b67e566276b7))
+* **waiting_rooms:** update generated types and methods ([f6b3214](https://github.com/cloudflare/cloudflare-python/commit/f6b3214449b2a1582e3912858d5a89c649155e4a))
+* **web3:** update generated types and methods ([3f68dfa](https://github.com/cloudflare/cloudflare-python/commit/3f68dfa0ce70a5f77cdacebd6ece7fa3819a491e))
+* **workers_for_platforms:** update generated types and methods ([ffafd5d](https://github.com/cloudflare/cloudflare-python/commit/ffafd5d23de76e278ae03bcb238ac9a72cafd270))
+* **workers,registrar,custom_pages:** restore codegen updates previously excluded for test failures ([9227352](https://github.com/cloudflare/cloudflare-python/commit/92273529c938a0478e67e06cd87db60f74511a5a))
+* **workers:** update generated types and methods ([441d30b](https://github.com/cloudflare/cloudflare-python/commit/441d30b91259a744e4b1d10e9a5fd6acdf1e2a73))
+* **workflows:** update generated types and methods ([354ea78](https://github.com/cloudflare/cloudflare-python/commit/354ea7816d64622e2a11993e5112b1b17a5bd76a))
+* **zaraz:** update generated types and methods ([a5950ae](https://github.com/cloudflare/cloudflare-python/commit/a5950ae06aa088b0df607da9972d761b100ae667))
+* **zero_trust:** update generated types and methods ([7776375](https://github.com/cloudflare/cloudflare-python/commit/77763753c3a9832d9326235628ec3a73b48439dc))
+* **zones:** update generated types and methods ([105f469](https://github.com/cloudflare/cloudflare-python/commit/105f469c7737ca449edfd061310f33899133cff9))
+
+
+### Bug Fixes
+
+* **custom_pages:** skip assets tests missing required zone_id argument ([e943a09](https://github.com/cloudflare/cloudflare-python/commit/e943a09894e2d6194aebde836ab1b9b483db3a8b))
+* **dlp:** add missing model_rebuild/update_forward_refs for SharedEntryCustomEntry classes ([25ec10c](https://github.com/cloudflare/cloudflare-python/commit/25ec10c814d138f8dea08a79f9984b70abb58477))
+* move type: ignore[call-arg] to _get_api_list call site in ai/to_markdown.py ([9f00441](https://github.com/cloudflare/cloudflare-python/commit/9f0044191dfc0ee76f5583f229e6ff27395ae0ef))
+* move type: ignore[call-arg] to _get_api_list call site in to_markdown.py ([5a22559](https://github.com/cloudflare/cloudflare-python/commit/5a225597b00b5401da05629e8bb83a14745efa98))
+* remove duplicate notification_url field in webhook response types ([fc9fb2f](https://github.com/cloudflare/cloudflare-python/commit/fc9fb2f895c5de968f67c62bb599a6792be9fa8f))
+* **tests:** skip telemetry query and registrar edit tests failing against Prism ([31d87f3](https://github.com/cloudflare/cloudflare-python/commit/31d87f361f8248e43ff00729337ca90cda392131))
+* **workers:** make RunQueryParametersNeedleValue a BaseModel with arbitrary_types_allowed ([6b7efbc](https://github.com/cloudflare/cloudflare-python/commit/6b7efbc51e6189ba18225c57637015f050060683))
+
+
+### Chores
+
+* **api:** update composite API spec ([c02d710](https://github.com/cloudflare/cloudflare-python/commit/c02d710e259ef33205b761c419f2b2b172157ad6))
+* **api:** update composite API spec ([3e1d5c7](https://github.com/cloudflare/cloudflare-python/commit/3e1d5c778a5de33dc1ad2fd26aa78b732416c31c))
+* **api:** update composite API spec ([9a30563](https://github.com/cloudflare/cloudflare-python/commit/9a305635bae85d74c1c6af97c759650bde736643))
+* **api:** update composite API spec ([3d71f02](https://github.com/cloudflare/cloudflare-python/commit/3d71f02b020dc813bd1cce4d6c77388de351460d))
+* **api:** update composite API spec ([4e8e589](https://github.com/cloudflare/cloudflare-python/commit/4e8e589a9969c6892baa2ff557773e1e912ca9e0))
+* **api:** update composite API spec ([754ad7f](https://github.com/cloudflare/cloudflare-python/commit/754ad7f8184bf795d51919c487ef74a6e47e8dc5))
+* **api:** update composite API spec ([d42da57](https://github.com/cloudflare/cloudflare-python/commit/d42da57b965971e800097ac308fbf682e2b7c3f5))
+* **api:** update composite API spec ([95522e9](https://github.com/cloudflare/cloudflare-python/commit/95522e93b274c89217f02a261d115515d659f2c7))
+* **api:** update composite API spec ([2ce3689](https://github.com/cloudflare/cloudflare-python/commit/2ce3689126c5e7bcfa6f3a11dc133f00f5387b4c))
+* **api:** update composite API spec ([28d543f](https://github.com/cloudflare/cloudflare-python/commit/28d543f2f52bff8ac78808c756ccd3c541b82b90))
+* **api:** update composite API spec ([8b72e87](https://github.com/cloudflare/cloudflare-python/commit/8b72e87eb8f0b09ffe197743a87e46b611ea9ec2))
+* **api:** update composite API spec ([fdf5570](https://github.com/cloudflare/cloudflare-python/commit/fdf5570c0b9c3df1b513898ad59eb4c55a5ad30b))
+* **api:** update composite API spec ([d1f482b](https://github.com/cloudflare/cloudflare-python/commit/d1f482be93944c05a78226686e832b24f9950c36))
+* **api:** update composite API spec ([d75f3a2](https://github.com/cloudflare/cloudflare-python/commit/d75f3a2760630e7befd52bda2a92a2b74f5f2616))
+* **api:** update composite API spec ([adeda00](https://github.com/cloudflare/cloudflare-python/commit/adeda00e8482cdf9e9d13e7bd4c34f4c7528d4e2))
+* **api:** update composite API spec ([203088b](https://github.com/cloudflare/cloudflare-python/commit/203088b6a445eb8a013e3643b14e10ca4238232c))
+* **api:** update composite API spec ([0086545](https://github.com/cloudflare/cloudflare-python/commit/008654589347eaa623eb8e3b313622022f030950))
+* **api:** update composite API spec ([f4a0a19](https://github.com/cloudflare/cloudflare-python/commit/f4a0a19a41293845fe38358d6031a3731daaffb4))
+* **api:** update composite API spec ([0369387](https://github.com/cloudflare/cloudflare-python/commit/0369387bbe584eb365eabbfe3392a093c86cbd66))
+* **api:** update composite API spec ([5b6114b](https://github.com/cloudflare/cloudflare-python/commit/5b6114bc37980df58854f00724f170a33a5074e9))
+* **api:** update composite API spec ([8f69d18](https://github.com/cloudflare/cloudflare-python/commit/8f69d182def57d624b846e04cff575c537d62eea))
+* **api:** update composite API spec ([9796acc](https://github.com/cloudflare/cloudflare-python/commit/9796acc0c6df8b7c0ed81c856f13261f2ea1f791))
+* **api:** update composite API spec ([25a89d1](https://github.com/cloudflare/cloudflare-python/commit/25a89d1811402419ae70fe78871ab8bb888b5e0f))
+* **api:** update composite API spec ([e234d53](https://github.com/cloudflare/cloudflare-python/commit/e234d5343ad81d6905129e4c6ec3f07b0aeb8f82))
+* **api:** update composite API spec ([c7719a0](https://github.com/cloudflare/cloudflare-python/commit/c7719a06dd0e9884723d7c98fa66055cb2eb62a4))
+* **api:** update composite API spec ([45b3efc](https://github.com/cloudflare/cloudflare-python/commit/45b3efc4af265c81f4aea49d1e6ae03572980329))
+* **api:** update composite API spec ([5afb2e7](https://github.com/cloudflare/cloudflare-python/commit/5afb2e763a97b79333ee365da0db5b903118071e))
+* **api:** update composite API spec ([8150ef4](https://github.com/cloudflare/cloudflare-python/commit/8150ef4ad1fd337d854c5b5483dedcfbd2d069cc))
+* **api:** update composite API spec ([9352ebc](https://github.com/cloudflare/cloudflare-python/commit/9352ebc561cb9661587c031751b8f42b85eab71c))
+* **api:** update composite API spec ([0fe8dc4](https://github.com/cloudflare/cloudflare-python/commit/0fe8dc490fdde03280fe32dd5b75d9aeb9188db9))
+* **api:** update composite API spec ([af117cb](https://github.com/cloudflare/cloudflare-python/commit/af117cb74283fab864e31f85a2ef8395af7d1adf))
+* **api:** update composite API spec ([3904470](https://github.com/cloudflare/cloudflare-python/commit/3904470ef747c948691a83fdc476932a2ba0c5b8))
+* **api:** update composite API spec ([f8c67c4](https://github.com/cloudflare/cloudflare-python/commit/f8c67c4c29c8dd7e7d94dabfbd612183ae78c01d))
+* **api:** update composite API spec ([60894d8](https://github.com/cloudflare/cloudflare-python/commit/60894d8701f76c3a8e70abb629c4cd34bc444ac0))
+* **api:** update composite API spec ([47ddd9a](https://github.com/cloudflare/cloudflare-python/commit/47ddd9a333531f7544753bfba970cd0012b31c01))
+* **api:** update composite API spec ([3d240b0](https://github.com/cloudflare/cloudflare-python/commit/3d240b01604f05ca3c92bd363b020f27bd945528))
+* **api:** update composite API spec ([44e1823](https://github.com/cloudflare/cloudflare-python/commit/44e1823f8feb0fb034769031f9d206e0421eb561))
+* **api:** update composite API spec ([e5d5273](https://github.com/cloudflare/cloudflare-python/commit/e5d527368b23cf55ec1196d93b462f26cdc4b39c))
+* **api:** update composite API spec ([49429f6](https://github.com/cloudflare/cloudflare-python/commit/49429f6e9bf3fe66115a8ae43b91a312a492dd45))
+* **api:** update composite API spec ([fa3d248](https://github.com/cloudflare/cloudflare-python/commit/fa3d248e63b0b7c3e040cdcb8c1f274249e84c23))
+* **api:** update composite API spec ([6afb257](https://github.com/cloudflare/cloudflare-python/commit/6afb257bcc35e6a38893979698f7a54c74b7cacb))
+* **api:** update composite API spec ([0a18e81](https://github.com/cloudflare/cloudflare-python/commit/0a18e8185a721fa0149cc173a6fa2b02293e04a2))
+* **api:** update composite API spec ([7f41ef1](https://github.com/cloudflare/cloudflare-python/commit/7f41ef1bbcf1bcd706e4f5a98cbaf284d67320d8))
+* **api:** update composite API spec ([236f6c4](https://github.com/cloudflare/cloudflare-python/commit/236f6c4fe37bd13689b3df2a0dbebd8fc49b502c))
+* **api:** update composite API spec ([f6cef98](https://github.com/cloudflare/cloudflare-python/commit/f6cef98c40e46c03fa300c918d20ee2ca700e6d8))
+* **api:** update composite API spec ([5170136](https://github.com/cloudflare/cloudflare-python/commit/5170136a7b47a4e630c36427724d209a93bf5296))
+* **api:** update composite API spec ([f5688fd](https://github.com/cloudflare/cloudflare-python/commit/f5688fd294dd002327e47155c598012d02fb55bd))
+* **api:** update composite API spec ([a129f4c](https://github.com/cloudflare/cloudflare-python/commit/a129f4c84ae6d67d76651a1162dcc05733f80ce0))
+* **api:** update composite API spec ([f2397ba](https://github.com/cloudflare/cloudflare-python/commit/f2397ba200da7f5174656239e2a1732847a09a5a))
+* **api:** update composite API spec ([b9a8b40](https://github.com/cloudflare/cloudflare-python/commit/b9a8b405a35e989ef2e19f38c946858aa204c697))
+* **api:** update composite API spec ([69b040b](https://github.com/cloudflare/cloudflare-python/commit/69b040bbc5547c2c748d986a349c1874ad4250bb))
+* **api:** update composite API spec ([93a4c51](https://github.com/cloudflare/cloudflare-python/commit/93a4c51a8d0db3fdd2147e331d334fc4c6a5a9cb))
+* **api:** update composite API spec ([09212fa](https://github.com/cloudflare/cloudflare-python/commit/09212fa7f6ad13b721082c29dce73dfe69ab98a6))
+* **api:** update composite API spec ([9bbb013](https://github.com/cloudflare/cloudflare-python/commit/9bbb013c8d03c2899b68edb0d1d7a84a872efa01))
+* **api:** update composite API spec ([b3c3741](https://github.com/cloudflare/cloudflare-python/commit/b3c37419ac2cb280c19a96733c955f2d2470af5d))
+* **api:** update composite API spec ([41b73af](https://github.com/cloudflare/cloudflare-python/commit/41b73affcfc1d3542980b18917a9e6e621b7a77c))
+* **api:** update composite API spec ([3b3b332](https://github.com/cloudflare/cloudflare-python/commit/3b3b3320068337d79fd87f276af4d2cce93065a5))
+* **api:** update composite API spec ([1057e25](https://github.com/cloudflare/cloudflare-python/commit/1057e2589a57703baab6c4e71a3c43f41f127f0d))
+* **api:** update composite API spec ([707a709](https://github.com/cloudflare/cloudflare-python/commit/707a70972d4f6cf9d9b122b691b148c0b2d9debf))
+* **api:** update composite API spec ([c4576f7](https://github.com/cloudflare/cloudflare-python/commit/c4576f7b7e0a4f4f21daf76c983823374f7067b1))
+* **api:** update composite API spec ([5075977](https://github.com/cloudflare/cloudflare-python/commit/5075977e2a9681c52f83e1fbf607a83e10baa49d))
+* **api:** update composite API spec ([36b3662](https://github.com/cloudflare/cloudflare-python/commit/36b36626220b56978dadc67aef49cbf73ef4f1c2))
+* **api:** update composite API spec ([1b205b5](https://github.com/cloudflare/cloudflare-python/commit/1b205b570a1904c93b6f1a6b3c754ea706e7c5c2))
+* **api:** update composite API spec ([e05c02f](https://github.com/cloudflare/cloudflare-python/commit/e05c02fac47f9be9300477f002a61077fac988c0))
+* **api:** update composite API spec ([d7fb232](https://github.com/cloudflare/cloudflare-python/commit/d7fb2328ee5e18376f162d5e36a41d2df4069f87))
+* **api:** update composite API spec ([ce6abd1](https://github.com/cloudflare/cloudflare-python/commit/ce6abd173eadbad5ec8f07a946eea35ba9585da7))
+* **api:** update composite API spec ([9dac694](https://github.com/cloudflare/cloudflare-python/commit/9dac69401712d457ac0b5bd01c215a033e84e529))
+* **api:** update composite API spec ([9c384f3](https://github.com/cloudflare/cloudflare-python/commit/9c384f3e631356c5e279eda869fec3295251a53c))
+* **api:** update composite API spec ([22abcb9](https://github.com/cloudflare/cloudflare-python/commit/22abcb99b9a961325ead049e3da68e4e9db502f2))
+* **api:** update composite API spec ([df8b0db](https://github.com/cloudflare/cloudflare-python/commit/df8b0dbdf37cdab598a5054be9e106caae87d398))
+* **api:** update composite API spec ([1c6ee63](https://github.com/cloudflare/cloudflare-python/commit/1c6ee6329d8c2e772f7e1d9199a9f386cfcd7590))
+* **api:** update composite API spec ([160c7be](https://github.com/cloudflare/cloudflare-python/commit/160c7be3b3123ce5e18d4a6526c013ea960e277d))
+* **api:** update composite API spec ([d0805c4](https://github.com/cloudflare/cloudflare-python/commit/d0805c4e4aafcd05da0ca2e91393a49544be2cfc))
+* **api:** update composite API spec ([31cc167](https://github.com/cloudflare/cloudflare-python/commit/31cc1676eeeef320495c7527252e92e0a8d4f972))
+* **api:** update composite API spec ([6d6d553](https://github.com/cloudflare/cloudflare-python/commit/6d6d5539bbcd680f4b7088ae907652f13654b293))
+* **api:** update composite API spec ([7871f72](https://github.com/cloudflare/cloudflare-python/commit/7871f72d038e64e238a37208ed3b2b426502ae40))
+* **api:** update composite API spec ([81877fb](https://github.com/cloudflare/cloudflare-python/commit/81877fbdfb72658e98d681562970c83a9726b965))
+* **api:** update composite API spec ([dd86a6d](https://github.com/cloudflare/cloudflare-python/commit/dd86a6d78421df0c111d6890c28cd44e1b6ac9bc))
+* **api:** update composite API spec ([4d0d80e](https://github.com/cloudflare/cloudflare-python/commit/4d0d80ec8abc912f36a3c903070d9b6bb3190b24))
+* **api:** update composite API spec ([77984d0](https://github.com/cloudflare/cloudflare-python/commit/77984d017d5233928992070f2bb2053aba7bdc99))
+* **api:** update composite API spec ([6135f31](https://github.com/cloudflare/cloudflare-python/commit/6135f31e65e5d7e4e3d0f2aad4061ffd9a1991b7))
+* **api:** update composite API spec ([f05b011](https://github.com/cloudflare/cloudflare-python/commit/f05b0113c65d29cd633a391f4dc0e8cd3f77d7c4))
+* **api:** update composite API spec ([d69da32](https://github.com/cloudflare/cloudflare-python/commit/d69da3279597672cfe526d542ebcf1fed45db06d))
+* **api:** update composite API spec ([0f390d2](https://github.com/cloudflare/cloudflare-python/commit/0f390d2655e10178e65f5eb59ccf363d18144378))
+* **api:** update composite API spec ([174f4ad](https://github.com/cloudflare/cloudflare-python/commit/174f4add3df8acfc85df10ad0d2cf1962c6de2e9))
+* **api:** update composite API spec ([90d7acd](https://github.com/cloudflare/cloudflare-python/commit/90d7acdb5dc0cb0e27e1dde183b46cc579233f37))
+* **api:** update composite API spec ([17bbdbb](https://github.com/cloudflare/cloudflare-python/commit/17bbdbb67606d49f7bfbc4979ec76ecb6b2e90ed))
+* **api:** update composite API spec ([7b7407c](https://github.com/cloudflare/cloudflare-python/commit/7b7407ca94a413c23a0e68882c00d430174b8740))
+* **api:** update composite API spec ([b0eb476](https://github.com/cloudflare/cloudflare-python/commit/b0eb476c790c319f7e2949d5f232bb726b3cd5bd))
+* **api:** update composite API spec ([79a09b5](https://github.com/cloudflare/cloudflare-python/commit/79a09b5304a8733b5eff39931f5f3b26d92d7cc9))
+* **api:** update composite API spec ([a0a0048](https://github.com/cloudflare/cloudflare-python/commit/a0a00481356d678ec42a357483e3da472a16d86d))
+* **api:** update composite API spec ([2b950cf](https://github.com/cloudflare/cloudflare-python/commit/2b950cfd2456c31b7c85174f23605cb9e8a470c0))
+* **api:** update composite API spec ([6e6f2f5](https://github.com/cloudflare/cloudflare-python/commit/6e6f2f55b1da2f39b4578fa86840f8687f5d4581))
+* **api:** update composite API spec ([146459d](https://github.com/cloudflare/cloudflare-python/commit/146459da763b77bcd858d6550ed77e8477bc6e24))
+* **api:** update composite API spec ([17a33ff](https://github.com/cloudflare/cloudflare-python/commit/17a33ff8bba4c8adceb155db74bc6a606a3a43cc))
+* **api:** update composite API spec ([09e3fb1](https://github.com/cloudflare/cloudflare-python/commit/09e3fb14dfba4fdf088feaa2d567e63065c5960e))
+* **api:** update composite API spec ([ad6565c](https://github.com/cloudflare/cloudflare-python/commit/ad6565c1373fc9c7fe70358fe1df4bbd4ef3f831))
+* **api:** update composite API spec ([dd1052d](https://github.com/cloudflare/cloudflare-python/commit/dd1052dec57ca99a90848910908b05680428b9a8))
+* **api:** update composite API spec ([20bfdf8](https://github.com/cloudflare/cloudflare-python/commit/20bfdf876f557f7b581728db112789cc583d7aa6))
+* **api:** update composite API spec ([bb37db8](https://github.com/cloudflare/cloudflare-python/commit/bb37db8de6c2e0b289b0a7eb60fcabf178f43a50))
+* **api:** update composite API spec ([e531924](https://github.com/cloudflare/cloudflare-python/commit/e531924080c7d5d184a0734932f08ee59b5d085f))
+* **api:** update composite API spec ([4727ace](https://github.com/cloudflare/cloudflare-python/commit/4727acec0eb9ce14c6a1d8ded3d69a00a3bf22c9))
+* exclude workers, registrar, custom_pages (pre-existing test failures) ([9e30fdc](https://github.com/cloudflare/cloudflare-python/commit/9e30fdccbd623a461cbc3d57e5f49dcd7650acd7))
+* remove example for route that no longer exists ([492dc26](https://github.com/cloudflare/cloudflare-python/commit/492dc264f6f411876abe46a6da6e0203429dc9f2))
+* sync shared codegen files from staging-next ([bb7b7b8](https://github.com/cloudflare/cloudflare-python/commit/bb7b7b8f23aa987bd24acb07dfd5ea36f34b9f64))
+
## 5.0.0-beta.1 (2026-02-13)
Full Changelog: [v4.3.1...v5.0.0-beta.1](https://github.com/cloudflare/cloudflare-python/compare/v4.3.1...v5.0.0-beta.1)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index f6d738cea14..320cdedd0ff 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -88,8 +88,7 @@ $ pip install ./path-to-wheel-file.whl
Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.
```sh
-# you will need npm installed
-$ npx prism mock path/to/your/openapi.yml
+$ ./scripts/mock
```
```sh
diff --git a/README.md b/README.md
index 9f9d4b169a7..c9b0fb08c36 100644
--- a/README.md
+++ b/README.md
@@ -13,8 +13,8 @@ It is generated with [Stainless](https://www.stainless.com/).
Use the Cloudflare MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.
-[](https://cursor.com/en-US/install-mcp?name=cloudflare-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImNsb3VkZmxhcmUtbWNwIl19)
-[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22cloudflare-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22cloudflare-mcp%22%5D%7D)
+[](https://cursor.com/en-US/install-mcp?name=cloudflare-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImNsb3VkZmxhcmUtbWNwIl0sImVudiI6eyJDTE9VREZMQVJFX0FQSV9UT0tFTiI6IlNuM2xaSlRCWDZra2c3T2RjQlVBeE9POTYzR0VJeUdRcW5GVE9GWVkiLCJDTE9VREZMQVJFX0FQSV9LRVkiOiIxNDRjOWRlZmFjMDQ5NjljN2JmYWQ4ZWZhYThlYTE5NCIsIkNMT1VERkxBUkVfRU1BSUwiOiJ1c2VyQGV4YW1wbGUuY29tIiwiQ0xPVURGTEFSRV9BUElfVVNFUl9TRVJWSUNFX0tFWSI6InYxLjAtMTQ0YzlkZWZhYzA0OTY5YzdiZmFkOGVmLTYzMWE0MWQwMDNhMzJkMjVmZTg3ODA4MWVmMzY1YzQ5NTAzZjdmYWRhNjAwZGE5MzVlMjg1MWExYzczMjYwODRiODVjYmY2NDI5YzRiODU5ZGU4NDc1NzMxZGM5MmE5YzMyOTYzMWU2ZDU5ZTZjNzNkYTdiMTk4NDk3MTcyYjRjZWZlMDcxZDkwZDBmNWQyNzE5IiwiQ0xPVURGTEFSRV9BQ0NPVU5UX0lEIjoiZjAzN2U1NmU4OTI5M2EwNTc3NDBkZTY4MWFjOWFjY3AiLCJDTE9VREZMQVJFX1pPTkVfSUQiOiJmMDM3ZTU2ZTg5MjkzYTA1Nzc0MGRlNjgxYWM5YWNjcCJ9fQ)
+[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22cloudflare-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22cloudflare-mcp%22%5D%2C%22env%22%3A%7B%22CLOUDFLARE_API_TOKEN%22%3A%22Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY%22%2C%22CLOUDFLARE_API_KEY%22%3A%22144c9defac04969c7bfad8efaa8ea194%22%2C%22CLOUDFLARE_EMAIL%22%3A%22user%40example.com%22%2C%22CLOUDFLARE_API_USER_SERVICE_KEY%22%3A%22v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719%22%2C%22CLOUDFLARE_ACCOUNT_ID%22%3A%22f037e56e89293a057740de681ac9accp%22%2C%22CLOUDFLARE_ZONE_ID%22%3A%22f037e56e89293a057740de681ac9accp%22%7D%7D)
> Note: You may need to set environment variables in your MCP client.
diff --git a/api.md b/api.md
index 890a848cb44..a7c08bd17f3 100644
--- a/api.md
+++ b/api.md
@@ -29,11083 +29,214 @@ from cloudflare.types import (
)
```
-# Accounts
+# [Accounts](src/cloudflare/resources/accounts/api.md)
-Types:
+# [Organizations](src/cloudflare/resources/organizations/api.md)
-```python
-from cloudflare.types.accounts import Account, AccountDeleteResponse
-```
-
-Methods:
-
-- client.accounts.create(\*\*params) -> Optional[Account]
-- client.accounts.update(\*, account_id, \*\*params) -> Optional[Account]
-- client.accounts.list(\*\*params) -> SyncV4PagePaginationArray[Account]
-- client.accounts.delete(\*, account_id) -> Optional[AccountDeleteResponse]
-- client.accounts.get(\*, account_id) -> Optional[Account]
-
-## Members
-
-Types:
-
-```python
-from cloudflare.types.accounts import Status, MemberDeleteResponse
-```
-
-Methods:
-
-- client.accounts.members.create(\*, account_id, \*\*params) -> Optional[Member]
-- client.accounts.members.update(member_id, \*, account_id, \*\*params) -> Optional[Member]
-- client.accounts.members.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[Member]
-- client.accounts.members.delete(member_id, \*, account_id) -> Optional[MemberDeleteResponse]
-- client.accounts.members.get(member_id, \*, account_id) -> Optional[Member]
-
-## Roles
-
-Methods:
-
-- client.accounts.roles.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[Role]
-- client.accounts.roles.get(role_id, \*, account_id) -> Optional[Role]
-
-## Subscriptions
-
-Types:
-
-```python
-from cloudflare.types.accounts import SubscriptionDeleteResponse
-```
-
-Methods:
-
-- client.accounts.subscriptions.create(\*, account_id, \*\*params) -> Subscription
-- client.accounts.subscriptions.update(subscription_identifier, \*, account_id, \*\*params) -> Subscription
-- client.accounts.subscriptions.delete(subscription_identifier, \*, account_id) -> SubscriptionDeleteResponse
-- client.accounts.subscriptions.get(\*, account_id) -> SyncSinglePage[Subscription]
-
-## Tokens
-
-Types:
-
-```python
-from cloudflare.types.accounts import TokenCreateResponse, TokenDeleteResponse, TokenVerifyResponse
-```
-
-Methods:
-
-- client.accounts.tokens.create(\*, account_id, \*\*params) -> Optional[TokenCreateResponse]
-- client.accounts.tokens.update(token_id, \*, account_id, \*\*params) -> Optional[Token]
-- client.accounts.tokens.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[Token]
-- client.accounts.tokens.delete(token_id, \*, account_id) -> Optional[TokenDeleteResponse]
-- client.accounts.tokens.get(token_id, \*, account_id) -> Optional[Token]
-- client.accounts.tokens.verify(\*, account_id) -> Optional[TokenVerifyResponse]
-
-### PermissionGroups
-
-Types:
-
-```python
-from cloudflare.types.accounts.tokens import PermissionGroupListResponse, PermissionGroupGetResponse
-```
-
-Methods:
-
-- client.accounts.tokens.permission_groups.list(\*, account_id, \*\*params) -> SyncSinglePage[PermissionGroupListResponse]
-- client.accounts.tokens.permission_groups.get(\*, account_id, \*\*params) -> Optional[PermissionGroupGetResponse]
-
-### Value
-
-Methods:
-
-- client.accounts.tokens.value.update(token_id, \*, account_id, \*\*params) -> str
-
-## Logs
-
-### Audit
-
-Types:
-
-```python
-from cloudflare.types.accounts.logs import AuditListResponse
-```
-
-Methods:
-
-- client.accounts.logs.audit.list(\*, account_id, \*\*params) -> SyncCursorPaginationAfter[AuditListResponse]
-
-# Organizations
-
-Types:
-
-```python
-from cloudflare.types.organizations import Organization, OrganizationDeleteResponse
-```
-
-Methods:
-
-- client.organizations.create(\*\*params) -> Organization
-- client.organizations.update(organization_id, \*\*params) -> Organization
-- client.organizations.list(\*\*params) -> SyncSinglePage[Organization]
-- client.organizations.delete(organization_id) -> OrganizationDeleteResponse
-- client.organizations.get(organization_id) -> Organization
-
-## OrganizationProfile
-
-Types:
-
-```python
-from cloudflare.types.organizations import OrganizationProfile
-```
-
-Methods:
-
-- client.organizations.organization_profile.update(organization_id, \*\*params) -> None
-- client.organizations.organization_profile.get(organization_id) -> Result
-
-# OriginCACertificates
-
-Types:
-
-```python
-from cloudflare.types.origin_ca_certificates import (
- OriginCACertificate,
- OriginCACertificateDeleteResponse,
-)
-```
-
-Methods:
-
-- client.origin_ca_certificates.create(\*\*params) -> Optional[OriginCACertificate]
-- client.origin_ca_certificates.list(\*\*params) -> SyncV4PagePaginationArray[OriginCACertificate]
-- client.origin_ca_certificates.delete(certificate_id) -> Optional[OriginCACertificateDeleteResponse]
-- client.origin_ca_certificates.get(certificate_id) -> Optional[OriginCACertificate]
-
-# IPs
-
-Types:
-
-```python
-from cloudflare.types.ips import IPs, IPListResponse
-```
-
-Methods:
-
-- client.ips.list(\*\*params) -> Optional[IPListResponse]
-
-# Memberships
-
-Types:
-
-```python
-from cloudflare.types.memberships import (
- Membership,
- MembershipUpdateResponse,
- MembershipDeleteResponse,
- MembershipGetResponse,
-)
-```
-
-Methods:
-
-- client.memberships.update(membership_id, \*\*params) -> Optional[MembershipUpdateResponse]
-- client.memberships.list(\*\*params) -> SyncV4PagePaginationArray[Membership]
-- client.memberships.delete(membership_id) -> Optional[MembershipDeleteResponse]
-- client.memberships.get(membership_id) -> Optional[MembershipGetResponse]
-
-# User
-
-Types:
-
-```python
-from cloudflare.types.user import UserEditResponse, UserGetResponse
-```
-
-Methods:
-
-- client.user.edit(\*\*params) -> Optional[UserEditResponse]
-- client.user.get() -> Optional[UserGetResponse]
-
-## AuditLogs
-
-Methods:
-
-- client.user.audit_logs.list(\*\*params) -> SyncV4PagePaginationArray[AuditLog]
-
-## Billing
-
-### History
-
-Types:
-
-```python
-from cloudflare.types.user.billing import BillingHistory
-```
-
-Methods:
-
-- client.user.billing.history.list(\*\*params) -> SyncV4PagePaginationArray[BillingHistory]
-
-### Profile
-
-Types:
-
-```python
-from cloudflare.types.user.billing import ProfileGetResponse
-```
-
-Methods:
-
-- client.user.billing.profile.get() -> ProfileGetResponse
-
-## Invites
-
-Types:
-
-```python
-from cloudflare.types.user import Invite
-```
-
-Methods:
-
-- client.user.invites.list() -> SyncSinglePage[Invite]
-- client.user.invites.edit(invite_id, \*\*params) -> Optional[Invite]
-- client.user.invites.get(invite_id) -> Optional[Invite]
-
-## Organizations
-
-Types:
-
-```python
-from cloudflare.types.user import Organization, OrganizationDeleteResponse
-```
-
-Methods:
-
-- client.user.organizations.list(\*\*params) -> SyncV4PagePaginationArray[Organization]
-- client.user.organizations.delete(organization_id) -> OrganizationDeleteResponse
-- client.user.organizations.get(organization_id) -> object
-
-## Subscriptions
-
-Types:
-
-```python
-from cloudflare.types.user import SubscriptionUpdateResponse, SubscriptionDeleteResponse
-```
-
-Methods:
-
-- client.user.subscriptions.update(identifier, \*\*params) -> SubscriptionUpdateResponse
-- client.user.subscriptions.delete(identifier) -> SubscriptionDeleteResponse
-- client.user.subscriptions.get() -> SyncSinglePage[Subscription]
-
-## Tokens
-
-Types:
-
-```python
-from cloudflare.types.user import TokenCreateResponse, TokenDeleteResponse, TokenVerifyResponse
-```
-
-Methods:
-
-- client.user.tokens.create(\*\*params) -> Optional[TokenCreateResponse]
-- client.user.tokens.update(token_id, \*\*params) -> Optional[Token]
-- client.user.tokens.list(\*\*params) -> SyncV4PagePaginationArray[Token]
-- client.user.tokens.delete(token_id) -> Optional[TokenDeleteResponse]
-- client.user.tokens.get(token_id) -> Optional[Token]
-- client.user.tokens.verify() -> Optional[TokenVerifyResponse]
-
-### PermissionGroups
-
-Types:
-
-```python
-from cloudflare.types.user.tokens import PermissionGroupListResponse
-```
-
-Methods:
-
-- client.user.tokens.permission_groups.list(\*\*params) -> SyncSinglePage[PermissionGroupListResponse]
-
-### Value
-
-Methods:
-
-- client.user.tokens.value.update(token_id, \*\*params) -> str
-
-# Zones
-
-Types:
-
-```python
-from cloudflare.types.zones import Type, Zone, ZoneDeleteResponse
-```
-
-Methods:
-
-- client.zones.create(\*\*params) -> Optional[Zone]
-- client.zones.list(\*\*params) -> SyncV4PagePaginationArray[Zone]
-- client.zones.delete(\*, zone_id) -> Optional[ZoneDeleteResponse]
-- client.zones.edit(\*, zone_id, \*\*params) -> Optional[Zone]
-- client.zones.get(\*, zone_id) -> Optional[Zone]
-
-## ActivationCheck
-
-Types:
-
-```python
-from cloudflare.types.zones import ActivationCheckTriggerResponse
-```
-
-Methods:
-
-- client.zones.activation_check.trigger(\*, zone_id) -> Optional[ActivationCheckTriggerResponse]
-
-## Settings
-
-Types:
-
-```python
-from cloudflare.types.zones import (
- AdvancedDDoS,
- Aegis,
- AlwaysOnline,
- AlwaysUseHTTPS,
- AutomaticHTTPSRewrites,
- AutomaticPlatformOptimization,
- Brotli,
- BrowserCacheTTL,
- BrowserCheck,
- CacheLevel,
- ChallengeTTL,
- Ciphers,
- DevelopmentMode,
- EarlyHints,
- EmailObfuscation,
- FontSettings,
- H2Prioritization,
- HotlinkProtection,
- HTTP2,
- HTTP3,
- ImageResizing,
- IPGeolocation,
- IPV6,
- MinTLSVersion,
- Mirage,
- NEL,
- OpportunisticEncryption,
- OpportunisticOnion,
- OrangeToOrange,
- OriginErrorPagePassThru,
- OriginMaxHTTPVersion,
- Polish,
- PrefetchPreload,
- ProxyReadTimeout,
- PseudoIPV4,
- ResponseBuffering,
- RocketLoader,
- SecurityHeaders,
- SecurityLevel,
- ServerSideExcludes,
- SortQueryStringForCache,
- SSL,
- SSLRecommender,
- TLS1_3,
- TLSClientAuth,
- TrueClientIPHeader,
- WAF,
- WebP,
- Websocket,
- ZeroRTT,
- SettingEditResponse,
- SettingGetResponse,
-)
-```
-
-Methods:
-
-- client.zones.settings.edit(setting_id, \*, zone_id, \*\*params) -> Optional[SettingEditResponse]
-- client.zones.settings.get(setting_id, \*, zone_id) -> Optional[SettingGetResponse]
-
-## CustomNameservers
-
-Types:
-
-```python
-from cloudflare.types.zones import CustomNameserverUpdateResponse, CustomNameserverGetResponse
-```
-
-Methods:
-
-- client.zones.custom_nameservers.update(\*, zone_id, \*\*params) -> SyncSinglePage[CustomNameserverUpdateResponse]
-- client.zones.custom_nameservers.get(\*, zone_id) -> CustomNameserverGetResponse
-
-## Holds
-
-Types:
-
-```python
-from cloudflare.types.zones import ZoneHold
-```
-
-Methods:
-
-- client.zones.holds.create(\*, zone_id, \*\*params) -> ZoneHold
-- client.zones.holds.delete(\*, zone_id, \*\*params) -> ZoneHold
-- client.zones.holds.edit(\*, zone_id, \*\*params) -> ZoneHold
-- client.zones.holds.get(\*, zone_id) -> ZoneHold
-
-## Subscriptions
-
-Types:
-
-```python
-from cloudflare.types.zones import (
- SubscriptionCreateResponse,
- SubscriptionUpdateResponse,
- SubscriptionGetResponse,
-)
-```
-
-Methods:
-
-- client.zones.subscriptions.create(\*, zone_id, \*\*params) -> SubscriptionCreateResponse
-- client.zones.subscriptions.update(\*, zone_id, \*\*params) -> SubscriptionUpdateResponse
-- client.zones.subscriptions.get(\*, zone_id) -> SubscriptionGetResponse
-
-## Plans
-
-Types:
-
-```python
-from cloudflare.types.zones import AvailableRatePlan
-```
-
-Methods:
-
-- client.zones.plans.list(\*, zone_id) -> SyncSinglePage[AvailableRatePlan]
-- client.zones.plans.get(plan_identifier, \*, zone_id) -> AvailableRatePlan
-
-## RatePlans
-
-Types:
-
-```python
-from cloudflare.types.zones import RatePlanGetResponse
-```
-
-Methods:
-
-- client.zones.rate_plans.get(\*, zone_id) -> SyncSinglePage[RatePlanGetResponse]
-
-# LoadBalancers
-
-Types:
-
-```python
-from cloudflare.types.load_balancers import (
- AdaptiveRouting,
- CheckRegion,
- DefaultPools,
- FilterOptions,
- Header,
- Host,
- LoadBalancer,
- LoadShedding,
- LocationStrategy,
- NotificationFilter,
- Origin,
- OriginSteering,
- RandomSteering,
- Rules,
- SessionAffinity,
- SessionAffinityAttributes,
- SteeringPolicy,
- LoadBalancerDeleteResponse,
-)
-```
-
-Methods:
-
-- client.load_balancers.create(\*, zone_id, \*\*params) -> LoadBalancer
-- client.load_balancers.update(load_balancer_id, \*, zone_id, \*\*params) -> LoadBalancer
-- client.load_balancers.list(\*, zone_id) -> SyncSinglePage[LoadBalancer]
-- client.load_balancers.delete(load_balancer_id, \*, zone_id) -> LoadBalancerDeleteResponse
-- client.load_balancers.edit(load_balancer_id, \*, zone_id, \*\*params) -> LoadBalancer
-- client.load_balancers.get(load_balancer_id, \*, zone_id) -> LoadBalancer
-
-## Monitors
-
-Types:
-
-```python
-from cloudflare.types.load_balancers import Monitor, MonitorDeleteResponse
-```
-
-Methods:
-
-- client.load_balancers.monitors.create(\*, account_id, \*\*params) -> Monitor
-- client.load_balancers.monitors.update(monitor_id, \*, account_id, \*\*params) -> Monitor
-- client.load_balancers.monitors.list(\*, account_id) -> SyncSinglePage[Monitor]
-- client.load_balancers.monitors.delete(monitor_id, \*, account_id) -> MonitorDeleteResponse
-- client.load_balancers.monitors.edit(monitor_id, \*, account_id, \*\*params) -> Monitor
-- client.load_balancers.monitors.get(monitor_id, \*, account_id) -> Monitor
-
-### Previews
-
-Types:
-
-```python
-from cloudflare.types.load_balancers.monitors import PreviewCreateResponse
-```
-
-Methods:
-
-- client.load_balancers.monitors.previews.create(monitor_id, \*, account_id, \*\*params) -> PreviewCreateResponse
-
-### References
-
-Types:
-
-```python
-from cloudflare.types.load_balancers.monitors import ReferenceGetResponse
-```
-
-Methods:
-
-- client.load_balancers.monitors.references.get(monitor_id, \*, account_id) -> SyncSinglePage[ReferenceGetResponse]
-
-## MonitorGroups
-
-Types:
-
-```python
-from cloudflare.types.load_balancers import MonitorGroup
-```
-
-Methods:
-
-- client.load_balancers.monitor_groups.create(\*, account_id, \*\*params) -> MonitorGroup
-- client.load_balancers.monitor_groups.update(monitor_group_id, \*, account_id, \*\*params) -> MonitorGroup
-- client.load_balancers.monitor_groups.list(\*, account_id) -> SyncSinglePage[MonitorGroup]
-- client.load_balancers.monitor_groups.delete(monitor_group_id, \*, account_id) -> MonitorGroup
-- client.load_balancers.monitor_groups.edit(monitor_group_id, \*, account_id, \*\*params) -> MonitorGroup
-- client.load_balancers.monitor_groups.get(monitor_group_id, \*, account_id) -> MonitorGroup
-
-## Pools
-
-Types:
-
-```python
-from cloudflare.types.load_balancers import Pool, PoolDeleteResponse
-```
-
-Methods:
-
-- client.load_balancers.pools.create(\*, account_id, \*\*params) -> Pool
-- client.load_balancers.pools.update(pool_id, \*, account_id, \*\*params) -> Pool
-- client.load_balancers.pools.list(\*, account_id, \*\*params) -> SyncSinglePage[Pool]
-- client.load_balancers.pools.delete(pool_id, \*, account_id) -> PoolDeleteResponse
-- client.load_balancers.pools.bulk_edit(\*, account_id, \*\*params) -> SyncSinglePage[Pool]
-- client.load_balancers.pools.edit(pool_id, \*, account_id, \*\*params) -> Pool
-- client.load_balancers.pools.get(pool_id, \*, account_id) -> Pool
-
-### Health
-
-Types:
-
-```python
-from cloudflare.types.load_balancers.pools import HealthCreateResponse, HealthGetResponse
-```
-
-Methods:
-
-- client.load_balancers.pools.health.create(pool_id, \*, account_id, \*\*params) -> HealthCreateResponse
-- client.load_balancers.pools.health.get(pool_id, \*, account_id) -> HealthGetResponse
-
-### References
-
-Types:
-
-```python
-from cloudflare.types.load_balancers.pools import ReferenceGetResponse
-```
-
-Methods:
-
-- client.load_balancers.pools.references.get(pool_id, \*, account_id) -> SyncSinglePage[ReferenceGetResponse]
-
-## Previews
-
-Types:
-
-```python
-from cloudflare.types.load_balancers import PreviewGetResponse
-```
-
-Methods:
-
-- client.load_balancers.previews.get(preview_id, \*, account_id) -> PreviewGetResponse
-
-## Regions
-
-Types:
-
-```python
-from cloudflare.types.load_balancers import RegionListResponse, RegionGetResponse
-```
-
-Methods:
-
-- client.load_balancers.regions.list(\*, account_id, \*\*params) -> RegionListResponse
-- client.load_balancers.regions.get(region_id, \*, account_id) -> RegionGetResponse
-
-## Searches
-
-Types:
-
-```python
-from cloudflare.types.load_balancers import SearchListResponse
-```
-
-Methods:
-
-- client.load_balancers.searches.list(\*, account_id, \*\*params) -> SyncV4PagePagination[SearchListResponse]
-
-# Cache
-
-Types:
-
-```python
-from cloudflare.types.cache import CachePurgeResponse
-```
-
-Methods:
-
-- client.cache.purge(\*, zone_id, \*\*params) -> Optional[CachePurgeResponse]
-
-## CacheReserve
-
-Types:
-
-```python
-from cloudflare.types.cache import (
- CacheReserve,
- CacheReserveClear,
- State,
- CacheReserveClearResponse,
- CacheReserveEditResponse,
- CacheReserveGetResponse,
- CacheReserveStatusResponse,
-)
-```
-
-Methods:
-
-- client.cache.cache_reserve.clear(\*, zone_id, \*\*params) -> Optional[CacheReserveClearResponse]
-- client.cache.cache_reserve.edit(\*, zone_id, \*\*params) -> Optional[CacheReserveEditResponse]
-- client.cache.cache_reserve.get(\*, zone_id) -> Optional[CacheReserveGetResponse]
-- client.cache.cache_reserve.status(\*, zone_id) -> Optional[CacheReserveStatusResponse]
-
-## SmartTieredCache
-
-Types:
-
-```python
-from cloudflare.types.cache import (
- SmartTieredCacheDeleteResponse,
- SmartTieredCacheEditResponse,
- SmartTieredCacheGetResponse,
-)
-```
-
-Methods:
-
-- client.cache.smart_tiered_cache.delete(\*, zone_id) -> Optional[SmartTieredCacheDeleteResponse]
-- client.cache.smart_tiered_cache.edit(\*, zone_id, \*\*params) -> Optional[SmartTieredCacheEditResponse]
-- client.cache.smart_tiered_cache.get(\*, zone_id) -> Optional[SmartTieredCacheGetResponse]
-
-## Variants
-
-Types:
-
-```python
-from cloudflare.types.cache import (
- CacheVariant,
- VariantDeleteResponse,
- VariantEditResponse,
- VariantGetResponse,
-)
-```
-
-Methods:
-
-- client.cache.variants.delete(\*, zone_id) -> Optional[VariantDeleteResponse]
-- client.cache.variants.edit(\*, zone_id, \*\*params) -> Optional[VariantEditResponse]
-- client.cache.variants.get(\*, zone_id) -> Optional[VariantGetResponse]
-
-## RegionalTieredCache
-
-Types:
-
-```python
-from cloudflare.types.cache import (
- RegionalTieredCache,
- RegionalTieredCacheEditResponse,
- RegionalTieredCacheGetResponse,
-)
-```
-
-Methods:
-
-- client.cache.regional_tiered_cache.edit(\*, zone_id, \*\*params) -> Optional[RegionalTieredCacheEditResponse]
-- client.cache.regional_tiered_cache.get(\*, zone_id) -> Optional[RegionalTieredCacheGetResponse]
-
-# SSL
-
-## Analyze
-
-Methods:
-
-- client.ssl.analyze.create(\*, zone_id, \*\*params) -> object
-
-## CertificatePacks
-
-Types:
-
-```python
-from cloudflare.types.ssl import (
- Host,
- RequestValidity,
- Status,
- ValidationMethod,
- CertificatePackCreateResponse,
- CertificatePackListResponse,
- CertificatePackDeleteResponse,
- CertificatePackEditResponse,
- CertificatePackGetResponse,
-)
-```
-
-Methods:
-
-- client.ssl.certificate_packs.create(\*, zone_id, \*\*params) -> Optional[CertificatePackCreateResponse]
-- client.ssl.certificate_packs.list(\*, zone_id, \*\*params) -> SyncSinglePage[CertificatePackListResponse]
-- client.ssl.certificate_packs.delete(certificate_pack_id, \*, zone_id) -> Optional[CertificatePackDeleteResponse]
-- client.ssl.certificate_packs.edit(certificate_pack_id, \*, zone_id, \*\*params) -> Optional[CertificatePackEditResponse]
-- client.ssl.certificate_packs.get(certificate_pack_id, \*, zone_id) -> Optional[CertificatePackGetResponse]
-
-### Quota
-
-Types:
-
-```python
-from cloudflare.types.ssl.certificate_packs import QuotaGetResponse
-```
-
-Methods:
-
-- client.ssl.certificate_packs.quota.get(\*, zone_id) -> Optional[QuotaGetResponse]
-
-## Recommendations
-
-Types:
-
-```python
-from cloudflare.types.ssl import RecommendationGetResponse
-```
-
-Methods:
-
-- client.ssl.recommendations.get(\*, zone_id) -> RecommendationGetResponse
-
-## Universal
-
-### Settings
-
-Types:
-
-```python
-from cloudflare.types.ssl.universal import UniversalSSLSettings
-```
-
-Methods:
-
-- client.ssl.universal.settings.edit(\*, zone_id, \*\*params) -> Optional[UniversalSSLSettings]
-- client.ssl.universal.settings.get(\*, zone_id) -> Optional[UniversalSSLSettings]
-
-## Verification
-
-Types:
-
-```python
-from cloudflare.types.ssl import Verification, VerificationEditResponse, VerificationGetResponse
-```
-
-Methods:
-
-- client.ssl.verification.edit(certificate_pack_id, \*, zone_id, \*\*params) -> Optional[VerificationEditResponse]
-- client.ssl.verification.get(\*, zone_id, \*\*params) -> Optional[VerificationGetResponse]
-
-# ACM
-
-## TotalTLS
-
-Types:
-
-```python
-from cloudflare.types.acm import (
- CertificateAuthority,
- TotalTLSUpdateResponse,
- TotalTLSEditResponse,
- TotalTLSGetResponse,
-)
-```
-
-Methods:
-
-- client.acm.total_tls.update(\*, zone_id, \*\*params) -> Optional[TotalTLSUpdateResponse]
-- client.acm.total_tls.edit(\*, zone_id, \*\*params) -> Optional[TotalTLSEditResponse]
-- client.acm.total_tls.get(\*, zone_id) -> Optional[TotalTLSGetResponse]
-
-# Argo
-
-## SmartRouting
-
-Types:
-
-```python
-from cloudflare.types.argo import SmartRoutingEditResponse, SmartRoutingGetResponse
-```
-
-Methods:
-
-- client.argo.smart_routing.edit(\*, zone_id, \*\*params) -> SmartRoutingEditResponse
-- client.argo.smart_routing.get(\*, zone_id) -> SmartRoutingGetResponse
-
-## TieredCaching
-
-Types:
-
-```python
-from cloudflare.types.argo import TieredCachingEditResponse, TieredCachingGetResponse
-```
-
-Methods:
-
-- client.argo.tiered_caching.edit(\*, zone_id, \*\*params) -> Optional[TieredCachingEditResponse]
-- client.argo.tiered_caching.get(\*, zone_id) -> Optional[TieredCachingGetResponse]
-
-# CertificateAuthorities
-
-## HostnameAssociations
-
-Types:
-
-```python
-from cloudflare.types.certificate_authorities import (
- HostnameAssociation,
- TLSHostnameAssociation,
- HostnameAssociationUpdateResponse,
- HostnameAssociationGetResponse,
-)
-```
-
-Methods:
-
-- client.certificate_authorities.hostname_associations.update(\*, zone_id, \*\*params) -> Optional[HostnameAssociationUpdateResponse]
-- client.certificate_authorities.hostname_associations.get(\*, zone_id, \*\*params) -> Optional[HostnameAssociationGetResponse]
-
-# ClientCertificates
-
-Types:
-
-```python
-from cloudflare.types.client_certificates import ClientCertificate
-```
-
-Methods:
-
-- client.client_certificates.create(\*, zone_id, \*\*params) -> Optional[ClientCertificate]
-- client.client_certificates.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[ClientCertificate]
-- client.client_certificates.delete(client_certificate_id, \*, zone_id) -> Optional[ClientCertificate]
-- client.client_certificates.edit(client_certificate_id, \*, zone_id, \*\*params) -> Optional[ClientCertificate]
-- client.client_certificates.get(client_certificate_id, \*, zone_id) -> Optional[ClientCertificate]
-
-# CustomCertificates
-
-Types:
-
-```python
-from cloudflare.types.custom_certificates import (
- CustomCertificate,
- GeoRestrictions,
- Status,
- CustomCertificateDeleteResponse,
-)
-```
-
-Methods:
-
-- client.custom_certificates.create(\*, zone_id, \*\*params) -> Optional[CustomCertificate]
-- client.custom_certificates.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[CustomCertificate]
-- client.custom_certificates.delete(custom_certificate_id, \*, zone_id) -> Optional[CustomCertificateDeleteResponse]
-- client.custom_certificates.edit(custom_certificate_id, \*, zone_id, \*\*params) -> Optional[CustomCertificate]
-- client.custom_certificates.get(custom_certificate_id, \*, zone_id) -> Optional[CustomCertificate]
-
-## Prioritize
-
-Methods:
-
-- client.custom_certificates.prioritize.update(\*, zone_id, \*\*params) -> SyncSinglePage[CustomCertificate]
-
-# CustomHostnames
-
-Types:
-
-```python
-from cloudflare.types.custom_hostnames import (
- BundleMethod,
- CustomHostname,
- DCVMethod,
- DomainValidationType,
- CustomHostnameCreateResponse,
- CustomHostnameListResponse,
- CustomHostnameDeleteResponse,
- CustomHostnameEditResponse,
- CustomHostnameGetResponse,
-)
-```
-
-Methods:
-
-- client.custom_hostnames.create(\*, zone_id, \*\*params) -> Optional[CustomHostnameCreateResponse]
-- client.custom_hostnames.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[CustomHostnameListResponse]
-- client.custom_hostnames.delete(custom_hostname_id, \*, zone_id) -> CustomHostnameDeleteResponse
-- client.custom_hostnames.edit(custom_hostname_id, \*, zone_id, \*\*params) -> Optional[CustomHostnameEditResponse]
-- client.custom_hostnames.get(custom_hostname_id, \*, zone_id) -> Optional[CustomHostnameGetResponse]
-
-## FallbackOrigin
-
-Types:
-
-```python
-from cloudflare.types.custom_hostnames import (
- FallbackOriginUpdateResponse,
- FallbackOriginDeleteResponse,
- FallbackOriginGetResponse,
-)
-```
-
-Methods:
-
-- client.custom_hostnames.fallback_origin.update(\*, zone_id, \*\*params) -> Optional[FallbackOriginUpdateResponse]
-- client.custom_hostnames.fallback_origin.delete(\*, zone_id) -> Optional[FallbackOriginDeleteResponse]
-- client.custom_hostnames.fallback_origin.get(\*, zone_id) -> Optional[FallbackOriginGetResponse]
-
-## CertificatePack
-
-### Certificates
-
-Types:
-
-```python
-from cloudflare.types.custom_hostnames.certificate_pack import (
- CertificateUpdateResponse,
- CertificateDeleteResponse,
-)
-```
-
-Methods:
-
-- client.custom_hostnames.certificate_pack.certificates.update(certificate_id, \*, zone_id, custom_hostname_id, certificate_pack_id, \*\*params) -> Optional[CertificateUpdateResponse]
-- client.custom_hostnames.certificate_pack.certificates.delete(certificate_id, \*, zone_id, custom_hostname_id, certificate_pack_id) -> CertificateDeleteResponse
-
-# CustomNameservers
-
-Types:
-
-```python
-from cloudflare.types.custom_nameservers import CustomNameserver, CustomNameserverDeleteResponse
-```
-
-Methods:
-
-- client.custom_nameservers.create(\*, account_id, \*\*params) -> Optional[CustomNameserver]
-- client.custom_nameservers.delete(custom_ns_id, \*, account_id) -> SyncSinglePage[CustomNameserverDeleteResponse]
-- client.custom_nameservers.get(\*, account_id) -> SyncSinglePage[CustomNameserver]
-
-# DNSFirewall
-
-Types:
-
-```python
-from cloudflare.types.dns_firewall import (
- AttackMitigation,
- FirewallIPs,
- UpstreamIPs,
- DNSFirewallCreateResponse,
- DNSFirewallListResponse,
- DNSFirewallDeleteResponse,
- DNSFirewallEditResponse,
- DNSFirewallGetResponse,
-)
-```
-
-Methods:
-
-- client.dns_firewall.create(\*, account_id, \*\*params) -> Optional[DNSFirewallCreateResponse]
-- client.dns_firewall.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[DNSFirewallListResponse]
-- client.dns_firewall.delete(dns_firewall_id, \*, account_id) -> Optional[DNSFirewallDeleteResponse]
-- client.dns_firewall.edit(dns_firewall_id, \*, account_id, \*\*params) -> Optional[DNSFirewallEditResponse]
-- client.dns_firewall.get(dns_firewall_id, \*, account_id) -> Optional[DNSFirewallGetResponse]
-
-## Analytics
-
-### Reports
-
-Methods:
-
-- client.dns_firewall.analytics.reports.get(dns_firewall_id, \*, account_id, \*\*params) -> Optional[Report]
-
-#### Bytimes
-
-Methods:
-
-- client.dns_firewall.analytics.reports.bytimes.get(dns_firewall_id, \*, account_id, \*\*params) -> Optional[ByTime]
-
-## ReverseDNS
-
-Types:
-
-```python
-from cloudflare.types.dns_firewall import ReverseDNSEditResponse, ReverseDNSGetResponse
-```
-
-Methods:
-
-- client.dns_firewall.reverse_dns.edit(dns_firewall_id, \*, account_id, \*\*params) -> Optional[ReverseDNSEditResponse]
-- client.dns_firewall.reverse_dns.get(dns_firewall_id, \*, account_id) -> Optional[ReverseDNSGetResponse]
-
-# DNS
-
-## DNSSEC
-
-Types:
-
-```python
-from cloudflare.types.dns import DNSSEC, DNSSECDeleteResponse
-```
-
-Methods:
-
-- client.dns.dnssec.delete(\*, zone_id) -> str
-- client.dns.dnssec.edit(\*, zone_id, \*\*params) -> Optional[DNSSEC]
-- client.dns.dnssec.get(\*, zone_id) -> Optional[DNSSEC]
-
-## Records
-
-Types:
-
-```python
-from cloudflare.types.dns import (
- ARecord,
- AAAARecord,
- BatchPatch,
- BatchPut,
- CAARecord,
- CERTRecord,
- CNAMERecord,
- DNSKEYRecord,
- DSRecord,
- HTTPSRecord,
- LOCRecord,
- MXRecord,
- NAPTRRecord,
- NSRecord,
- PTRRecord,
- Record,
- RecordResponse,
- RecordTags,
- SMIMEARecord,
- SRVRecord,
- SSHFPRecord,
- SVCBRecord,
- TLSARecord,
- TTL,
- TXTRecord,
- URIRecord,
- RecordDeleteResponse,
- RecordBatchResponse,
- RecordExportResponse,
- RecordImportResponse,
- RecordScanResponse,
- RecordScanReviewResponse,
- RecordScanTriggerResponse,
-)
-```
-
-Methods:
-
-- client.dns.records.create(\*, zone_id, \*\*params) -> Optional[RecordResponse]
-- client.dns.records.update(dns_record_id, \*, zone_id, \*\*params) -> Optional[RecordResponse]
-- client.dns.records.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[RecordResponse]
-- client.dns.records.delete(dns_record_id, \*, zone_id) -> Optional[RecordDeleteResponse]
-- client.dns.records.batch(\*, zone_id, \*\*params) -> Optional[RecordBatchResponse]
-- client.dns.records.edit(dns_record_id, \*, zone_id, \*\*params) -> Optional[RecordResponse]
-- client.dns.records.export(\*, zone_id) -> str
-- client.dns.records.get(dns_record_id, \*, zone_id) -> Optional[RecordResponse]
-- client.dns.records.import\_(\*, zone_id, \*\*params) -> Optional[RecordImportResponse]
-- client.dns.records.scan(\*, zone_id, \*\*params) -> Optional[RecordScanResponse]
-- client.dns.records.scan_list(\*, zone_id) -> SyncSinglePage[RecordResponse]
-- client.dns.records.scan_review(\*, zone_id, \*\*params) -> Optional[RecordScanReviewResponse]
-- client.dns.records.scan_trigger(\*, zone_id) -> RecordScanTriggerResponse
-
-## Settings
-
-### Zone
-
-Types:
-
-```python
-from cloudflare.types.dns.settings import ZoneEditResponse, ZoneGetResponse
-```
-
-Methods:
-
-- client.dns.settings.zone.edit(\*, zone_id, \*\*params) -> Optional[ZoneEditResponse]
-- client.dns.settings.zone.get(\*, zone_id) -> Optional[ZoneGetResponse]
-
-### Account
-
-Types:
-
-```python
-from cloudflare.types.dns.settings import AccountEditResponse, AccountGetResponse
-```
-
-Methods:
-
-- client.dns.settings.account.edit(\*, account_id, \*\*params) -> Optional[AccountEditResponse]
-- client.dns.settings.account.get(\*, account_id) -> Optional[AccountGetResponse]
-
-#### Views
-
-Types:
-
-```python
-from cloudflare.types.dns.settings.account import (
- ViewCreateResponse,
- ViewListResponse,
- ViewDeleteResponse,
- ViewEditResponse,
- ViewGetResponse,
-)
-```
-
-Methods:
-
-- client.dns.settings.account.views.create(\*, account_id, \*\*params) -> Optional[ViewCreateResponse]
-- client.dns.settings.account.views.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[ViewListResponse]
-- client.dns.settings.account.views.delete(view_id, \*, account_id) -> Optional[ViewDeleteResponse]
-- client.dns.settings.account.views.edit(view_id, \*, account_id, \*\*params) -> Optional[ViewEditResponse]
-- client.dns.settings.account.views.get(view_id, \*, account_id) -> Optional[ViewGetResponse]
-
-## Analytics
-
-### Reports
-
-Types:
-
-```python
-from cloudflare.types.dns.analytics import Report
-```
-
-Methods:
-
-- client.dns.analytics.reports.get(\*, zone_id, \*\*params) -> Optional[Report]
-
-#### Bytimes
-
-Types:
-
-```python
-from cloudflare.types.dns.analytics.reports import ByTime
-```
-
-Methods:
-
-- client.dns.analytics.reports.bytimes.get(\*, zone_id, \*\*params) -> Optional[ByTime]
-
-## ZoneTransfers
-
-### ForceAXFR
-
-Types:
-
-```python
-from cloudflare.types.dns.zone_transfers import ForceAXFR
-```
-
-Methods:
-
-- client.dns.zone_transfers.force_axfr.create(\*, zone_id, \*\*params) -> str
-
-### Incoming
-
-Types:
-
-```python
-from cloudflare.types.dns.zone_transfers import (
- Incoming,
- IncomingCreateResponse,
- IncomingUpdateResponse,
- IncomingDeleteResponse,
- IncomingGetResponse,
-)
-```
-
-Methods:
-
-- client.dns.zone_transfers.incoming.create(\*, zone_id, \*\*params) -> Optional[IncomingCreateResponse]
-- client.dns.zone_transfers.incoming.update(\*, zone_id, \*\*params) -> Optional[IncomingUpdateResponse]
-- client.dns.zone_transfers.incoming.delete(\*, zone_id) -> Optional[IncomingDeleteResponse]
-- client.dns.zone_transfers.incoming.get(\*, zone_id) -> Optional[IncomingGetResponse]
-
-### Outgoing
-
-Types:
-
-```python
-from cloudflare.types.dns.zone_transfers import (
- DisableTransfer,
- EnableTransfer,
- Outgoing,
- OutgoingStatus,
- OutgoingCreateResponse,
- OutgoingUpdateResponse,
- OutgoingDeleteResponse,
- OutgoingForceNotifyResponse,
- OutgoingGetResponse,
-)
-```
-
-Methods:
-
-- client.dns.zone_transfers.outgoing.create(\*, zone_id, \*\*params) -> Optional[OutgoingCreateResponse]
-- client.dns.zone_transfers.outgoing.update(\*, zone_id, \*\*params) -> Optional[OutgoingUpdateResponse]
-- client.dns.zone_transfers.outgoing.delete(\*, zone_id) -> Optional[OutgoingDeleteResponse]
-- client.dns.zone_transfers.outgoing.disable(\*, zone_id, \*\*params) -> str
-- client.dns.zone_transfers.outgoing.enable(\*, zone_id, \*\*params) -> str
-- client.dns.zone_transfers.outgoing.force_notify(\*, zone_id, \*\*params) -> str
-- client.dns.zone_transfers.outgoing.get(\*, zone_id) -> Optional[OutgoingGetResponse]
-
-#### Status
-
-Methods:
-
-- client.dns.zone_transfers.outgoing.status.get(\*, zone_id) -> str
-
-### ACLs
-
-Types:
-
-```python
-from cloudflare.types.dns.zone_transfers import ACL, ACLDeleteResponse
-```
-
-Methods:
-
-- client.dns.zone_transfers.acls.create(\*, account_id, \*\*params) -> Optional[ACL]
-- client.dns.zone_transfers.acls.update(acl_id, \*, account_id, \*\*params) -> Optional[ACL]
-- client.dns.zone_transfers.acls.list(\*, account_id) -> SyncSinglePage[ACL]
-- client.dns.zone_transfers.acls.delete(acl_id, \*, account_id) -> Optional[ACLDeleteResponse]
-- client.dns.zone_transfers.acls.get(acl_id, \*, account_id) -> Optional[ACL]
-
-### Peers
-
-Types:
-
-```python
-from cloudflare.types.dns.zone_transfers import Peer, PeerDeleteResponse
-```
-
-Methods:
-
-- client.dns.zone_transfers.peers.create(\*, account_id, \*\*params) -> Optional[Peer]
-- client.dns.zone_transfers.peers.update(peer_id, \*, account_id, \*\*params) -> Optional[Peer]
-- client.dns.zone_transfers.peers.list(\*, account_id) -> SyncSinglePage[Peer]
-- client.dns.zone_transfers.peers.delete(peer_id, \*, account_id) -> Optional[PeerDeleteResponse]
-- client.dns.zone_transfers.peers.get(peer_id, \*, account_id) -> Optional[Peer]
-
-### TSIGs
-
-Types:
-
-```python
-from cloudflare.types.dns.zone_transfers import TSIG, TSIGDeleteResponse
-```
-
-Methods:
-
-- client.dns.zone_transfers.tsigs.create(\*, account_id, \*\*params) -> Optional[TSIG]
-- client.dns.zone_transfers.tsigs.update(tsig_id, \*, account_id, \*\*params) -> Optional[TSIG]
-- client.dns.zone_transfers.tsigs.list(\*, account_id) -> SyncSinglePage[TSIG]
-- client.dns.zone_transfers.tsigs.delete(tsig_id, \*, account_id) -> Optional[TSIGDeleteResponse]
-- client.dns.zone_transfers.tsigs.get(tsig_id, \*, account_id) -> Optional[TSIG]
-
-# EmailSecurity
-
-## Investigate
-
-Types:
-
-```python
-from cloudflare.types.email_security import InvestigateListResponse, InvestigateGetResponse
-```
-
-Methods:
-
-- client.email_security.investigate.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[InvestigateListResponse]
-- client.email_security.investigate.get(postfix_id, \*, account_id) -> InvestigateGetResponse
-
-### Detections
-
-Types:
-
-```python
-from cloudflare.types.email_security.investigate import DetectionGetResponse
-```
-
-Methods:
-
-- client.email_security.investigate.detections.get(postfix_id, \*, account_id) -> DetectionGetResponse
-
-### Preview
-
-Types:
-
-```python
-from cloudflare.types.email_security.investigate import PreviewCreateResponse, PreviewGetResponse
-```
-
-Methods:
-
-- client.email_security.investigate.preview.create(\*, account_id, \*\*params) -> PreviewCreateResponse
-- client.email_security.investigate.preview.get(postfix_id, \*, account_id) -> PreviewGetResponse
-
-### Raw
-
-Types:
-
-```python
-from cloudflare.types.email_security.investigate import RawGetResponse
-```
-
-Methods:
-
-- client.email_security.investigate.raw.get(postfix_id, \*, account_id) -> RawGetResponse
-
-### Trace
-
-Types:
-
-```python
-from cloudflare.types.email_security.investigate import TraceGetResponse
-```
-
-Methods:
-
-- client.email_security.investigate.trace.get(postfix_id, \*, account_id) -> TraceGetResponse
-
-### Move
-
-Types:
-
-```python
-from cloudflare.types.email_security.investigate import MoveCreateResponse, MoveBulkResponse
-```
-
-Methods:
-
-- client.email_security.investigate.move.create(postfix_id, \*, account_id, \*\*params) -> SyncSinglePage[MoveCreateResponse]
-- client.email_security.investigate.move.bulk(\*, account_id, \*\*params) -> SyncSinglePage[MoveBulkResponse]
-
-### Reclassify
-
-Methods:
-
-- client.email_security.investigate.reclassify.create(postfix_id, \*, account_id, \*\*params) -> object
-
-### Release
-
-Types:
-
-```python
-from cloudflare.types.email_security.investigate import ReleaseBulkResponse
-```
-
-Methods:
-
-- client.email_security.investigate.release.bulk(\*, account_id, \*\*params) -> SyncSinglePage[ReleaseBulkResponse]
-
-## Settings
-
-### AllowPolicies
-
-Types:
-
-```python
-from cloudflare.types.email_security.settings import (
- AllowPolicyCreateResponse,
- AllowPolicyListResponse,
- AllowPolicyDeleteResponse,
- AllowPolicyEditResponse,
- AllowPolicyGetResponse,
-)
-```
-
-Methods:
-
-- client.email_security.settings.allow_policies.create(\*, account_id, \*\*params) -> AllowPolicyCreateResponse
-- client.email_security.settings.allow_policies.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[AllowPolicyListResponse]
-- client.email_security.settings.allow_policies.delete(policy_id, \*, account_id) -> AllowPolicyDeleteResponse
-- client.email_security.settings.allow_policies.edit(policy_id, \*, account_id, \*\*params) -> AllowPolicyEditResponse
-- client.email_security.settings.allow_policies.get(policy_id, \*, account_id) -> AllowPolicyGetResponse
-
-### BlockSenders
-
-Types:
-
-```python
-from cloudflare.types.email_security.settings import (
- BlockSenderCreateResponse,
- BlockSenderListResponse,
- BlockSenderDeleteResponse,
- BlockSenderEditResponse,
- BlockSenderGetResponse,
-)
-```
-
-Methods:
-
-- client.email_security.settings.block_senders.create(\*, account_id, \*\*params) -> BlockSenderCreateResponse
-- client.email_security.settings.block_senders.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[BlockSenderListResponse]
-- client.email_security.settings.block_senders.delete(pattern_id, \*, account_id) -> BlockSenderDeleteResponse
-- client.email_security.settings.block_senders.edit(pattern_id, \*, account_id, \*\*params) -> BlockSenderEditResponse
-- client.email_security.settings.block_senders.get(pattern_id, \*, account_id) -> BlockSenderGetResponse
-
-### Domains
-
-Types:
-
-```python
-from cloudflare.types.email_security.settings import (
- DomainListResponse,
- DomainDeleteResponse,
- DomainBulkDeleteResponse,
- DomainEditResponse,
- DomainGetResponse,
-)
-```
-
-Methods:
-
-- client.email_security.settings.domains.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[DomainListResponse]
-- client.email_security.settings.domains.delete(domain_id, \*, account_id) -> DomainDeleteResponse
-- client.email_security.settings.domains.bulk_delete(\*, account_id) -> SyncSinglePage[DomainBulkDeleteResponse]
-- client.email_security.settings.domains.edit(domain_id, \*, account_id, \*\*params) -> DomainEditResponse
-- client.email_security.settings.domains.get(domain_id, \*, account_id) -> DomainGetResponse
-
-### ImpersonationRegistry
-
-Types:
-
-```python
-from cloudflare.types.email_security.settings import (
- ImpersonationRegistryCreateResponse,
- ImpersonationRegistryListResponse,
- ImpersonationRegistryDeleteResponse,
- ImpersonationRegistryEditResponse,
- ImpersonationRegistryGetResponse,
-)
-```
-
-Methods:
-
-- client.email_security.settings.impersonation_registry.create(\*, account_id, \*\*params) -> ImpersonationRegistryCreateResponse
-- client.email_security.settings.impersonation_registry.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[ImpersonationRegistryListResponse]
-- client.email_security.settings.impersonation_registry.delete(display_name_id, \*, account_id) -> ImpersonationRegistryDeleteResponse
-- client.email_security.settings.impersonation_registry.edit(display_name_id, \*, account_id, \*\*params) -> ImpersonationRegistryEditResponse
-- client.email_security.settings.impersonation_registry.get(display_name_id, \*, account_id) -> ImpersonationRegistryGetResponse
-
-### TrustedDomains
-
-Types:
-
-```python
-from cloudflare.types.email_security.settings import (
- TrustedDomainCreateResponse,
- TrustedDomainListResponse,
- TrustedDomainDeleteResponse,
- TrustedDomainEditResponse,
- TrustedDomainGetResponse,
-)
-```
-
-Methods:
-
-- client.email_security.settings.trusted_domains.create(\*, account_id, \*\*params) -> TrustedDomainCreateResponse
-- client.email_security.settings.trusted_domains.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[TrustedDomainListResponse]
-- client.email_security.settings.trusted_domains.delete(trusted_domain_id, \*, account_id) -> TrustedDomainDeleteResponse
-- client.email_security.settings.trusted_domains.edit(trusted_domain_id, \*, account_id, \*\*params) -> TrustedDomainEditResponse
-- client.email_security.settings.trusted_domains.get(trusted_domain_id, \*, account_id) -> TrustedDomainGetResponse
-
-## Submissions
-
-Types:
-
-```python
-from cloudflare.types.email_security import SubmissionListResponse
-```
-
-Methods:
-
-- client.email_security.submissions.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[SubmissionListResponse]
-
-# EmailRouting
-
-Types:
-
-```python
-from cloudflare.types.email_routing import Settings
-```
-
-Methods:
-
-- client.email_routing.disable(\*, zone_id, \*\*params) -> Optional[Settings]
-- client.email_routing.enable(\*, zone_id, \*\*params) -> Optional[Settings]
-- client.email_routing.get(\*, zone_id) -> Optional[Settings]
-
-## DNS
-
-Types:
-
-```python
-from cloudflare.types.email_routing import DNSRecord, DNSGetResponse
-```
-
-Methods:
-
-- client.email_routing.dns.create(\*, zone_id, \*\*params) -> Optional[Settings]
-- client.email_routing.dns.delete(\*, zone_id) -> SyncSinglePage[DNSRecord]
-- client.email_routing.dns.edit(\*, zone_id, \*\*params) -> Optional[Settings]
-- client.email_routing.dns.get(\*, zone_id, \*\*params) -> DNSGetResponse
-
-## Rules
-
-Types:
-
-```python
-from cloudflare.types.email_routing import Action, EmailRoutingRule, Matcher
-```
-
-Methods:
-
-- client.email_routing.rules.create(\*, zone_id, \*\*params) -> Optional[EmailRoutingRule]
-- client.email_routing.rules.update(rule_identifier, \*, zone_id, \*\*params) -> Optional[EmailRoutingRule]
-- client.email_routing.rules.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[EmailRoutingRule]
-- client.email_routing.rules.delete(rule_identifier, \*, zone_id) -> Optional[EmailRoutingRule]
-- client.email_routing.rules.get(rule_identifier, \*, zone_id) -> Optional[EmailRoutingRule]
-
-### CatchAlls
-
-Types:
-
-```python
-from cloudflare.types.email_routing.rules import (
- CatchAllAction,
- CatchAllMatcher,
- CatchAllUpdateResponse,
- CatchAllGetResponse,
-)
-```
-
-Methods:
-
-- client.email_routing.rules.catch_alls.update(\*, zone_id, \*\*params) -> Optional[CatchAllUpdateResponse]
-- client.email_routing.rules.catch_alls.get(\*, zone_id) -> Optional[CatchAllGetResponse]
-
-## Addresses
-
-Types:
-
-```python
-from cloudflare.types.email_routing import Address
-```
-
-Methods:
-
-- client.email_routing.addresses.create(\*, account_id, \*\*params) -> Optional[Address]
-- client.email_routing.addresses.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[Address]
-- client.email_routing.addresses.delete(destination_address_identifier, \*, account_id) -> Optional[Address]
-- client.email_routing.addresses.get(destination_address_identifier, \*, account_id) -> Optional[Address]
-
-# Filters
-
-Types:
-
-```python
-from cloudflare.types.filters import FirewallFilter, FilterDeleteResponse, FilterBulkDeleteResponse
-```
-
-Methods:
-
-- client.filters.create(\*, zone_id, \*\*params) -> SyncSinglePage[FirewallFilter]
-- client.filters.update(filter_id, \*, zone_id, \*\*params) -> FirewallFilter
-- client.filters.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[FirewallFilter]
-- client.filters.delete(filter_id, \*, zone_id) -> FilterDeleteResponse
-- client.filters.bulk_delete(\*, zone_id, \*\*params) -> Optional[FilterBulkDeleteResponse]
-- client.filters.bulk_update(\*, zone_id, \*\*params) -> SyncSinglePage[FirewallFilter]
-- client.filters.get(filter_id, \*, zone_id) -> FirewallFilter
-
-# Firewall
-
-## Lockdowns
-
-Types:
-
-```python
-from cloudflare.types.firewall import (
- Configuration,
- Lockdown,
- LockdownCIDRConfiguration,
- LockdownIPConfiguration,
- LockdownURL,
- LockdownDeleteResponse,
-)
-```
-
-Methods:
-
-- client.firewall.lockdowns.create(\*, zone_id, \*\*params) -> Lockdown
-- client.firewall.lockdowns.update(lock_downs_id, \*, zone_id, \*\*params) -> Lockdown
-- client.firewall.lockdowns.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[Lockdown]
-- client.firewall.lockdowns.delete(lock_downs_id, \*, zone_id) -> Optional[LockdownDeleteResponse]
-- client.firewall.lockdowns.get(lock_downs_id, \*, zone_id) -> Lockdown
-
-## Rules
-
-Types:
-
-```python
-from cloudflare.types.firewall import DeletedFilter, FirewallRule, Product
-```
-
-Methods:
-
-- client.firewall.rules.create(\*, zone_id, \*\*params) -> SyncSinglePage[FirewallRule]
-- client.firewall.rules.update(rule_id, \*, zone_id, \*\*params) -> FirewallRule
-- client.firewall.rules.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[FirewallRule]
-- client.firewall.rules.delete(rule_id, \*, zone_id) -> FirewallRule
-- client.firewall.rules.bulk_delete(\*, zone_id) -> SyncSinglePage[FirewallRule]
-- client.firewall.rules.bulk_edit(\*, zone_id, \*\*params) -> SyncSinglePage[FirewallRule]
-- client.firewall.rules.bulk_update(\*, zone_id, \*\*params) -> SyncSinglePage[FirewallRule]
-- client.firewall.rules.edit(rule_id, \*, zone_id) -> SyncSinglePage[FirewallRule]
-- client.firewall.rules.get(rule_id, \*, zone_id) -> FirewallRule
-
-## AccessRules
-
-Types:
-
-```python
-from cloudflare.types.firewall import (
- AccessRuleCIDRConfiguration,
- AccessRuleIPConfiguration,
- ASNConfiguration,
- CountryConfiguration,
- IPV6Configuration,
- AccessRuleCreateResponse,
- AccessRuleListResponse,
- AccessRuleDeleteResponse,
- AccessRuleEditResponse,
- AccessRuleGetResponse,
-)
-```
-
-Methods:
-
-- client.firewall.access_rules.create(\*, account_id, zone_id, \*\*params) -> AccessRuleCreateResponse
-- client.firewall.access_rules.list(\*, account_id, zone_id, \*\*params) -> SyncV4PagePaginationArray[AccessRuleListResponse]
-- client.firewall.access_rules.delete(rule_id, \*, account_id, zone_id) -> Optional[AccessRuleDeleteResponse]
-- client.firewall.access_rules.edit(rule_id, \*, account_id, zone_id, \*\*params) -> AccessRuleEditResponse
-- client.firewall.access_rules.get(rule_id, \*, account_id, zone_id) -> AccessRuleGetResponse
-
-## UARules
-
-Types:
-
-```python
-from cloudflare.types.firewall import (
- UARuleCreateResponse,
- UARuleUpdateResponse,
- UARuleListResponse,
- UARuleDeleteResponse,
- UARuleGetResponse,
-)
-```
-
-Methods:
-
-- client.firewall.ua_rules.create(\*, zone_id, \*\*params) -> UARuleCreateResponse
-- client.firewall.ua_rules.update(ua_rule_id, \*, zone_id, \*\*params) -> UARuleUpdateResponse
-- client.firewall.ua_rules.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[UARuleListResponse]
-- client.firewall.ua_rules.delete(ua_rule_id, \*, zone_id) -> UARuleDeleteResponse
-- client.firewall.ua_rules.get(ua_rule_id, \*, zone_id) -> UARuleGetResponse
-
-## WAF
-
-### Overrides
-
-Types:
-
-```python
-from cloudflare.types.firewall.waf import (
- Override,
- OverrideURL,
- RewriteAction,
- WAFRule,
- OverrideDeleteResponse,
-)
-```
-
-Methods:
-
-- client.firewall.waf.overrides.create(\*, zone_id, \*\*params) -> Override
-- client.firewall.waf.overrides.update(overrides_id, \*, zone_id, \*\*params) -> Override
-- client.firewall.waf.overrides.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[Override]
-- client.firewall.waf.overrides.delete(overrides_id, \*, zone_id) -> Optional[OverrideDeleteResponse]
-- client.firewall.waf.overrides.get(overrides_id, \*, zone_id) -> Override
-
-### Packages
-
-Types:
-
-```python
-from cloudflare.types.firewall.waf import PackageGetResponse
-```
-
-Methods:
-
-- client.firewall.waf.packages.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[object]
-- client.firewall.waf.packages.get(package_id, \*, zone_id) -> PackageGetResponse
-
-#### Groups
-
-Types:
-
-```python
-from cloudflare.types.firewall.waf.packages import Group, GroupEditResponse, GroupGetResponse
-```
-
-Methods:
-
-- client.firewall.waf.packages.groups.list(package_id, \*, zone_id, \*\*params) -> SyncV4PagePaginationArray[Group]
-- client.firewall.waf.packages.groups.edit(group_id, \*, zone_id, package_id, \*\*params) -> GroupEditResponse
-- client.firewall.waf.packages.groups.get(group_id, \*, zone_id, package_id) -> GroupGetResponse
-
-#### Rules
-
-Types:
-
-```python
-from cloudflare.types.firewall.waf.packages import (
- AllowedModesAnomaly,
- WAFRuleGroup,
- RuleListResponse,
- RuleEditResponse,
- RuleGetResponse,
-)
-```
-
-Methods:
-
-- client.firewall.waf.packages.rules.list(package_id, \*, zone_id, \*\*params) -> SyncV4PagePaginationArray[RuleListResponse]
-- client.firewall.waf.packages.rules.edit(rule_id, \*, zone_id, package_id, \*\*params) -> RuleEditResponse
-- client.firewall.waf.packages.rules.get(rule_id, \*, zone_id, package_id) -> RuleGetResponse
-
-# Healthchecks
-
-Types:
-
-```python
-from cloudflare.types.healthchecks import (
- CheckRegion,
- Healthcheck,
- HTTPConfiguration,
- QueryHealthcheck,
- TCPConfiguration,
- HealthcheckDeleteResponse,
-)
-```
-
-Methods:
-
-- client.healthchecks.create(\*, zone_id, \*\*params) -> Healthcheck
-- client.healthchecks.update(healthcheck_id, \*, zone_id, \*\*params) -> Healthcheck
-- client.healthchecks.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[Healthcheck]
-- client.healthchecks.delete(healthcheck_id, \*, zone_id) -> HealthcheckDeleteResponse
-- client.healthchecks.edit(healthcheck_id, \*, zone_id, \*\*params) -> Healthcheck
-- client.healthchecks.get(healthcheck_id, \*, zone_id) -> Healthcheck
-
-## Previews
-
-Types:
-
-```python
-from cloudflare.types.healthchecks import PreviewDeleteResponse
-```
-
-Methods:
-
-- client.healthchecks.previews.create(\*, zone_id, \*\*params) -> Healthcheck
-- client.healthchecks.previews.delete(healthcheck_id, \*, zone_id) -> PreviewDeleteResponse
-- client.healthchecks.previews.get(healthcheck_id, \*, zone_id) -> Healthcheck
-
-# KeylessCertificates
-
-Types:
-
-```python
-from cloudflare.types.keyless_certificates import (
- KeylessCertificate,
- Tunnel,
- KeylessCertificateDeleteResponse,
-)
-```
-
-Methods:
-
-- client.keyless_certificates.create(\*, zone_id, \*\*params) -> Optional[KeylessCertificate]
-- client.keyless_certificates.list(\*, zone_id) -> SyncSinglePage[KeylessCertificate]
-- client.keyless_certificates.delete(keyless_certificate_id, \*, zone_id) -> Optional[KeylessCertificateDeleteResponse]
-- client.keyless_certificates.edit(keyless_certificate_id, \*, zone_id, \*\*params) -> Optional[KeylessCertificate]
-- client.keyless_certificates.get(keyless_certificate_id, \*, zone_id) -> Optional[KeylessCertificate]
-
-# Logpush
-
-## Datasets
-
-### Fields
-
-Methods:
-
-- client.logpush.datasets.fields.get(dataset_id, \*, account_id, zone_id) -> object
-
-### Jobs
-
-Methods:
-
-- client.logpush.datasets.jobs.get(dataset_id, \*, account_id, zone_id) -> SyncSinglePage[Optional[LogpushJob]]
-
-## Edge
-
-Types:
-
-```python
-from cloudflare.types.logpush import InstantLogpushJob
-```
-
-Methods:
-
-- client.logpush.edge.create(\*, zone_id, \*\*params) -> Optional[InstantLogpushJob]
-- client.logpush.edge.get(\*, zone_id) -> SyncSinglePage[Optional[InstantLogpushJob]]
-
-## Jobs
-
-Types:
-
-```python
-from cloudflare.types.logpush import LogpushJob, OutputOptions, JobDeleteResponse
-```
-
-Methods:
-
-- client.logpush.jobs.create(\*, account_id, zone_id, \*\*params) -> Optional[LogpushJob]
-- client.logpush.jobs.update(job_id, \*, account_id, zone_id, \*\*params) -> Optional[LogpushJob]
-- client.logpush.jobs.list(\*, account_id, zone_id) -> SyncSinglePage[Optional[LogpushJob]]
-- client.logpush.jobs.delete(job_id, \*, account_id, zone_id) -> Optional[JobDeleteResponse]
-- client.logpush.jobs.get(job_id, \*, account_id, zone_id) -> Optional[LogpushJob]
-
-## Ownership
-
-Types:
-
-```python
-from cloudflare.types.logpush import OwnershipValidation, OwnershipCreateResponse
-```
-
-Methods:
-
-- client.logpush.ownership.create(\*, account_id, zone_id, \*\*params) -> Optional[OwnershipCreateResponse]
-- client.logpush.ownership.validate(\*, account_id, zone_id, \*\*params) -> Optional[OwnershipValidation]
-
-## Validate
-
-Types:
-
-```python
-from cloudflare.types.logpush import (
- ValidateDestinationResponse,
- ValidateDestinationExistsResponse,
- ValidateOriginResponse,
-)
-```
-
-Methods:
-
-- client.logpush.validate.destination(\*, account_id, zone_id, \*\*params) -> Optional[ValidateDestinationResponse]
-- client.logpush.validate.destination_exists(\*, account_id, zone_id, \*\*params) -> Optional[ValidateDestinationExistsResponse]
-- client.logpush.validate.origin(\*, account_id, zone_id, \*\*params) -> Optional[ValidateOriginResponse]
-
-# Logs
-
-## Control
-
-### Retention
-
-Types:
-
-```python
-from cloudflare.types.logs.control import RetentionCreateResponse, RetentionGetResponse
-```
-
-Methods:
-
-- client.logs.control.retention.create(\*, zone_id, \*\*params) -> Optional[RetentionCreateResponse]
-- client.logs.control.retention.get(\*, zone_id) -> Optional[RetentionGetResponse]
-
-### Cmb
-
-#### Config
-
-Types:
-
-```python
-from cloudflare.types.logs.control.cmb import CmbConfig
-```
-
-Methods:
-
-- client.logs.control.cmb.config.create(\*, account_id, \*\*params) -> Optional[CmbConfig]
-- client.logs.control.cmb.config.delete(\*, account_id) -> object
-- client.logs.control.cmb.config.get(\*, account_id) -> Optional[CmbConfig]
-
-## RayID
-
-Types:
-
-```python
-from cloudflare.types.logs import RayIDGetResponse
-```
-
-Methods:
-
-- client.logs.rayid.get(rayid, \*, zone_id, \*\*params) -> RayIDGetResponse
-
-## Received
-
-Types:
-
-```python
-from cloudflare.types.logs import ReceivedGetResponse
-```
-
-Methods:
-
-- client.logs.received.get(\*, zone_id, \*\*params) -> ReceivedGetResponse
-
-### Fields
-
-Types:
-
-```python
-from cloudflare.types.logs.received import FieldGetResponse
-```
-
-Methods:
-
-- client.logs.received.fields.get(\*, zone_id) -> FieldGetResponse
-
-# OriginTLSClientAuth
-
-Types:
-
-```python
-from cloudflare.types.origin_tls_client_auth import (
- OriginTLSClientAuthCreateResponse,
- OriginTLSClientAuthListResponse,
- OriginTLSClientAuthDeleteResponse,
- OriginTLSClientAuthGetResponse,
-)
-```
-
-Methods:
-
-- client.origin_tls_client_auth.create(\*, zone_id, \*\*params) -> Optional[OriginTLSClientAuthCreateResponse]
-- client.origin_tls_client_auth.list(\*, zone_id) -> SyncSinglePage[OriginTLSClientAuthListResponse]
-- client.origin_tls_client_auth.delete(certificate_id, \*, zone_id) -> Optional[OriginTLSClientAuthDeleteResponse]
-- client.origin_tls_client_auth.get(certificate_id, \*, zone_id) -> Optional[OriginTLSClientAuthGetResponse]
-
-## ZoneCertificates
-
-Types:
-
-```python
-from cloudflare.types.origin_tls_client_auth import (
- ZoneAuthenticatedOriginPull,
- ZoneCertificateCreateResponse,
- ZoneCertificateListResponse,
- ZoneCertificateDeleteResponse,
- ZoneCertificateGetResponse,
-)
-```
-
-Methods:
-
-- client.origin_tls_client_auth.zone_certificates.create(\*, zone_id, \*\*params) -> Optional[ZoneCertificateCreateResponse]
-- client.origin_tls_client_auth.zone_certificates.list(\*, zone_id) -> SyncSinglePage[ZoneCertificateListResponse]
-- client.origin_tls_client_auth.zone_certificates.delete(certificate_id, \*, zone_id) -> Optional[ZoneCertificateDeleteResponse]
-- client.origin_tls_client_auth.zone_certificates.get(certificate_id, \*, zone_id) -> Optional[ZoneCertificateGetResponse]
-
-## Hostnames
-
-Types:
-
-```python
-from cloudflare.types.origin_tls_client_auth import AuthenticatedOriginPull, HostnameUpdateResponse
-```
-
-Methods:
-
-- client.origin_tls_client_auth.hostnames.update(\*, zone_id, \*\*params) -> SyncSinglePage[HostnameUpdateResponse]
-- client.origin_tls_client_auth.hostnames.get(hostname, \*, zone_id) -> Optional[AuthenticatedOriginPull]
-
-## HostnameCertificates
-
-Types:
-
-```python
-from cloudflare.types.origin_tls_client_auth import (
- Certificate,
- HostnameCertificateCreateResponse,
- HostnameCertificateListResponse,
- HostnameCertificateDeleteResponse,
- HostnameCertificateGetResponse,
-)
-```
-
-Methods:
-
-- client.origin_tls_client_auth.hostname_certificates.create(\*, zone_id, \*\*params) -> Optional[HostnameCertificateCreateResponse]
-- client.origin_tls_client_auth.hostname_certificates.list(\*, zone_id) -> SyncSinglePage[HostnameCertificateListResponse]
-- client.origin_tls_client_auth.hostname_certificates.delete(certificate_id, \*, zone_id) -> Optional[HostnameCertificateDeleteResponse]
-- client.origin_tls_client_auth.hostname_certificates.get(certificate_id, \*, zone_id) -> Optional[HostnameCertificateGetResponse]
-
-## Settings
-
-Types:
-
-```python
-from cloudflare.types.origin_tls_client_auth import SettingUpdateResponse, SettingGetResponse
-```
-
-Methods:
-
-- client.origin_tls_client_auth.settings.update(\*, zone_id, \*\*params) -> Optional[SettingUpdateResponse]
-- client.origin_tls_client_auth.settings.get(\*, zone_id) -> Optional[SettingGetResponse]
-
-# PageRules
-
-Types:
-
-```python
-from cloudflare.types.page_rules import (
- PageRule,
- Target,
- PageRuleListResponse,
- PageRuleDeleteResponse,
-)
-```
-
-Methods:
-
-- client.page_rules.create(\*, zone_id, \*\*params) -> Optional[PageRule]
-- client.page_rules.update(pagerule_id, \*, zone_id, \*\*params) -> Optional[PageRule]
-- client.page_rules.list(\*, zone_id, \*\*params) -> Optional[PageRuleListResponse]
-- client.page_rules.delete(pagerule_id, \*, zone_id) -> Optional[PageRuleDeleteResponse]
-- client.page_rules.edit(pagerule_id, \*, zone_id, \*\*params) -> Optional[PageRule]
-- client.page_rules.get(pagerule_id, \*, zone_id) -> Optional[PageRule]
-
-# RateLimits
-
-Types:
-
-```python
-from cloudflare.types.rate_limits import Action, RateLimit, RateLimitDeleteResponse
-```
-
-Methods:
-
-- client.rate_limits.create(\*, zone_id, \*\*params) -> RateLimit
-- client.rate_limits.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[RateLimit]
-- client.rate_limits.delete(rate_limit_id, \*, zone_id) -> RateLimitDeleteResponse
-- client.rate_limits.edit(rate_limit_id, \*, zone_id, \*\*params) -> RateLimit
-- client.rate_limits.get(rate_limit_id, \*, zone_id) -> RateLimit
-
-# WaitingRooms
-
-Types:
-
-```python
-from cloudflare.types.waiting_rooms import (
- AdditionalRoutes,
- CookieAttributes,
- Query,
- WaitingRoom,
- WaitingRoomDeleteResponse,
-)
-```
-
-Methods:
-
-- client.waiting_rooms.create(\*, zone_id, \*\*params) -> WaitingRoom
-- client.waiting_rooms.update(waiting_room_id, \*, zone_id, \*\*params) -> WaitingRoom
-- client.waiting_rooms.list(\*, account_id, zone_id, \*\*params) -> SyncV4PagePaginationArray[WaitingRoom]
-- client.waiting_rooms.delete(waiting_room_id, \*, zone_id) -> WaitingRoomDeleteResponse
-- client.waiting_rooms.edit(waiting_room_id, \*, zone_id, \*\*params) -> WaitingRoom
-- client.waiting_rooms.get(waiting_room_id, \*, zone_id) -> WaitingRoom
-
-## Page
-
-Types:
-
-```python
-from cloudflare.types.waiting_rooms import PagePreviewResponse
-```
-
-Methods:
-
-- client.waiting_rooms.page.preview(\*, zone_id, \*\*params) -> PagePreviewResponse
-
-## Events
-
-Types:
-
-```python
-from cloudflare.types.waiting_rooms import Event, EventDeleteResponse
-```
-
-Methods:
-
-- client.waiting_rooms.events.create(waiting_room_id, \*, zone_id, \*\*params) -> Event
-- client.waiting_rooms.events.update(event_id, \*, zone_id, waiting_room_id, \*\*params) -> Event
-- client.waiting_rooms.events.list(waiting_room_id, \*, zone_id, \*\*params) -> SyncV4PagePaginationArray[Event]
-- client.waiting_rooms.events.delete(event_id, \*, zone_id, waiting_room_id) -> EventDeleteResponse
-- client.waiting_rooms.events.edit(event_id, \*, zone_id, waiting_room_id, \*\*params) -> Event
-- client.waiting_rooms.events.get(event_id, \*, zone_id, waiting_room_id) -> Event
-
-### Details
-
-Types:
-
-```python
-from cloudflare.types.waiting_rooms.events import EventQuery, DetailGetResponse
-```
-
-Methods:
-
-- client.waiting_rooms.events.details.get(event_id, \*, zone_id, waiting_room_id) -> DetailGetResponse
-
-## Rules
-
-Types:
-
-```python
-from cloudflare.types.waiting_rooms import WaitingRoomRule
-```
-
-Methods:
-
-- client.waiting_rooms.rules.create(waiting_room_id, \*, zone_id, \*\*params) -> SyncSinglePage[WaitingRoomRule]
-- client.waiting_rooms.rules.update(waiting_room_id, \*, zone_id, \*\*params) -> SyncSinglePage[WaitingRoomRule]
-- client.waiting_rooms.rules.delete(rule_id, \*, zone_id, waiting_room_id) -> SyncSinglePage[WaitingRoomRule]
-- client.waiting_rooms.rules.edit(rule_id, \*, zone_id, waiting_room_id, \*\*params) -> SyncSinglePage[WaitingRoomRule]
-- client.waiting_rooms.rules.get(waiting_room_id, \*, zone_id) -> SyncSinglePage[WaitingRoomRule]
-
-## Statuses
-
-Types:
-
-```python
-from cloudflare.types.waiting_rooms import StatusGetResponse
-```
-
-Methods:
-
-- client.waiting_rooms.statuses.get(waiting_room_id, \*, zone_id) -> StatusGetResponse
-
-## Settings
-
-Types:
-
-```python
-from cloudflare.types.waiting_rooms import (
- Setting,
- SettingUpdateResponse,
- SettingEditResponse,
- SettingGetResponse,
-)
-```
-
-Methods:
-
-- client.waiting_rooms.settings.update(\*, zone_id, \*\*params) -> SettingUpdateResponse
-- client.waiting_rooms.settings.edit(\*, zone_id, \*\*params) -> SettingEditResponse
-- client.waiting_rooms.settings.get(\*, zone_id) -> SettingGetResponse
-
-# Web3
-
-## Hostnames
-
-Types:
-
-```python
-from cloudflare.types.web3 import Hostname, HostnameDeleteResponse
-```
-
-Methods:
-
-- client.web3.hostnames.create(\*, zone_id, \*\*params) -> Hostname
-- client.web3.hostnames.list(\*, zone_id) -> SyncSinglePage[Hostname]
-- client.web3.hostnames.delete(identifier, \*, zone_id) -> Optional[HostnameDeleteResponse]
-- client.web3.hostnames.edit(identifier, \*, zone_id, \*\*params) -> Hostname
-- client.web3.hostnames.get(identifier, \*, zone_id) -> Hostname
-
-### IPFSUniversalPaths
-
-#### ContentLists
-
-Types:
-
-```python
-from cloudflare.types.web3.hostnames.ipfs_universal_paths import ContentList
-```
-
-Methods:
-
-- client.web3.hostnames.ipfs_universal_paths.content_lists.update(identifier, \*, zone_id, \*\*params) -> ContentList
-- client.web3.hostnames.ipfs_universal_paths.content_lists.get(identifier, \*, zone_id) -> ContentList
-
-##### Entries
-
-Types:
-
-```python
-from cloudflare.types.web3.hostnames.ipfs_universal_paths.content_lists import (
- EntryCreateResponse,
- EntryUpdateResponse,
- EntryListResponse,
- EntryDeleteResponse,
- EntryGetResponse,
-)
-```
-
-Methods:
-
-- client.web3.hostnames.ipfs_universal_paths.content_lists.entries.create(identifier, \*, zone_id, \*\*params) -> EntryCreateResponse
-- client.web3.hostnames.ipfs_universal_paths.content_lists.entries.update(content_list_entry_identifier, \*, zone_id, identifier, \*\*params) -> EntryUpdateResponse
-- client.web3.hostnames.ipfs_universal_paths.content_lists.entries.list(identifier, \*, zone_id) -> Optional[EntryListResponse]
-- client.web3.hostnames.ipfs_universal_paths.content_lists.entries.delete(content_list_entry_identifier, \*, zone_id, identifier) -> Optional[EntryDeleteResponse]
-- client.web3.hostnames.ipfs_universal_paths.content_lists.entries.get(content_list_entry_identifier, \*, zone_id, identifier) -> EntryGetResponse
-
-# Workers
-
-Types:
-
-```python
-from cloudflare.types.workers import MigrationStep, SingleStepMigration, WorkerMetadata
-```
-
-## Beta
-
-### Workers
-
-Types:
-
-```python
-from cloudflare.types.workers.beta import Worker, WorkerDeleteResponse
-```
-
-Methods:
-
-- client.workers.beta.workers.create(\*, account_id, \*\*params) -> Worker
-- client.workers.beta.workers.update(worker_id, \*, account_id, \*\*params) -> Worker
-- client.workers.beta.workers.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[Worker]
-- client.workers.beta.workers.delete(worker_id, \*, account_id) -> WorkerDeleteResponse
-- client.workers.beta.workers.edit(worker_id, \*, account_id, \*\*params) -> Worker
-- client.workers.beta.workers.get(worker_id, \*, account_id) -> Worker
-
-#### Versions
-
-Types:
-
-```python
-from cloudflare.types.workers.beta.workers import Version, VersionDeleteResponse
-```
-
-Methods:
-
-- client.workers.beta.workers.versions.create(worker_id, \*, account_id, \*\*params) -> Version
-- client.workers.beta.workers.versions.list(worker_id, \*, account_id, \*\*params) -> SyncV4PagePaginationArray[Version]
-- client.workers.beta.workers.versions.delete(version_id, \*, account_id, worker_id) -> VersionDeleteResponse
-- client.workers.beta.workers.versions.get(version_id, \*, account_id, worker_id, \*\*params) -> Version
-
-## Routes
-
-Types:
-
-```python
-from cloudflare.types.workers import (
- RouteCreateResponse,
- RouteUpdateResponse,
- RouteListResponse,
- RouteDeleteResponse,
- RouteGetResponse,
-)
-```
-
-Methods:
-
-- client.workers.routes.create(\*, zone_id, \*\*params) -> RouteCreateResponse
-- client.workers.routes.update(route_id, \*, zone_id, \*\*params) -> RouteUpdateResponse
-- client.workers.routes.list(\*, zone_id) -> SyncSinglePage[RouteListResponse]
-- client.workers.routes.delete(route_id, \*, zone_id) -> RouteDeleteResponse
-- client.workers.routes.get(route_id, \*, zone_id) -> RouteGetResponse
-
-## Assets
-
-### Upload
-
-Types:
-
-```python
-from cloudflare.types.workers.assets import UploadCreateResponse
-```
-
-Methods:
-
-- client.workers.assets.upload.create(\*, account_id, \*\*params) -> Optional[UploadCreateResponse]
-
-## Scripts
-
-Types:
-
-```python
-from cloudflare.types.workers import (
- Script,
- ScriptSetting,
- ScriptUpdateResponse,
- ScriptListResponse,
- ScriptGetResponse,
- ScriptSearchResponse,
-)
-```
-
-Methods:
-
-- client.workers.scripts.update(script_name, \*, account_id, \*\*params) -> ScriptUpdateResponse
-- client.workers.scripts.list(\*, account_id, \*\*params) -> SyncSinglePage[ScriptListResponse]
-- client.workers.scripts.delete(script_name, \*, account_id, \*\*params) -> object
-- client.workers.scripts.get(script_name, \*, account_id) -> str
-- client.workers.scripts.search(\*, account_id, \*\*params) -> ScriptSearchResponse
-
-### Assets
-
-#### Upload
-
-Types:
-
-```python
-from cloudflare.types.workers.scripts.assets import UploadCreateResponse
-```
-
-Methods:
-
-- client.workers.scripts.assets.upload.create(script_name, \*, account_id, \*\*params) -> Optional[UploadCreateResponse]
-
-### Subdomain
-
-Types:
-
-```python
-from cloudflare.types.workers.scripts import (
- SubdomainCreateResponse,
- SubdomainDeleteResponse,
- SubdomainGetResponse,
-)
-```
-
-Methods:
-
-- client.workers.scripts.subdomain.create(script_name, \*, account_id, \*\*params) -> SubdomainCreateResponse
-- client.workers.scripts.subdomain.delete(script_name, \*, account_id) -> SubdomainDeleteResponse
-- client.workers.scripts.subdomain.get(script_name, \*, account_id) -> SubdomainGetResponse
-
-### Schedules
-
-Types:
-
-```python
-from cloudflare.types.workers.scripts import ScheduleUpdateResponse, ScheduleGetResponse
-```
-
-Methods:
-
-- client.workers.scripts.schedules.update(script_name, \*, account_id, \*\*params) -> ScheduleUpdateResponse
-- client.workers.scripts.schedules.get(script_name, \*, account_id) -> ScheduleGetResponse
-
-### Tail
-
-Types:
-
-```python
-from cloudflare.types.workers.scripts import (
- ConsumerScript,
- TailCreateResponse,
- TailDeleteResponse,
- TailGetResponse,
-)
-```
-
-Methods:
-
-- client.workers.scripts.tail.create(script_name, \*, account_id, \*\*params) -> TailCreateResponse
-- client.workers.scripts.tail.delete(id, \*, account_id, script_name) -> TailDeleteResponse
-- client.workers.scripts.tail.get(script_name, \*, account_id) -> TailGetResponse
-
-### Content
-
-Methods:
-
-- client.workers.scripts.content.update(script_name, \*, account_id, \*\*params) -> Script
-- client.workers.scripts.content.get(script_name, \*, account_id) -> BinaryAPIResponse
-
-### Settings
-
-Methods:
-
-- client.workers.scripts.settings.edit(script_name, \*, account_id, \*\*params) -> ScriptSetting
-- client.workers.scripts.settings.get(script_name, \*, account_id) -> ScriptSetting
-
-### Deployments
-
-Types:
-
-```python
-from cloudflare.types.workers.scripts import (
- Deployment,
- DeploymentListResponse,
- DeploymentDeleteResponse,
-)
-```
-
-Methods:
-
-- client.workers.scripts.deployments.create(script_name, \*, account_id, \*\*params) -> Deployment
-- client.workers.scripts.deployments.list(script_name, \*, account_id) -> DeploymentListResponse
-- client.workers.scripts.deployments.delete(deployment_id, \*, account_id, script_name) -> DeploymentDeleteResponse
-- client.workers.scripts.deployments.get(deployment_id, \*, account_id, script_name) -> Deployment
-
-### Versions
-
-Types:
-
-```python
-from cloudflare.types.workers.scripts import (
- VersionCreateResponse,
- VersionListResponse,
- VersionGetResponse,
-)
-```
-
-Methods:
-
-- client.workers.scripts.versions.create(script_name, \*, account_id, \*\*params) -> VersionCreateResponse
-- client.workers.scripts.versions.list(script_name, \*, account_id, \*\*params) -> SyncV4PagePagination[VersionListResponse]
-- client.workers.scripts.versions.get(version_id, \*, account_id, script_name) -> VersionGetResponse
-
-### Secrets
-
-Types:
-
-```python
-from cloudflare.types.workers.scripts import (
- SecretUpdateResponse,
- SecretListResponse,
- SecretGetResponse,
-)
-```
-
-Methods:
-
-- client.workers.scripts.secrets.update(script_name, \*, account_id, \*\*params) -> Optional[SecretUpdateResponse]
-- client.workers.scripts.secrets.list(script_name, \*, account_id) -> SyncSinglePage[SecretListResponse]
-- client.workers.scripts.secrets.delete(secret_name, \*, account_id, script_name, \*\*params) -> object
-- client.workers.scripts.secrets.get(secret_name, \*, account_id, script_name, \*\*params) -> Optional[SecretGetResponse]
-
-### ScriptAndVersionSettings
-
-Types:
-
-```python
-from cloudflare.types.workers.scripts import (
- ScriptAndVersionSettingEditResponse,
- ScriptAndVersionSettingGetResponse,
-)
-```
-
-Methods:
-
-- client.workers.scripts.script_and_version_settings.edit(script_name, \*, account_id, \*\*params) -> ScriptAndVersionSettingEditResponse
-- client.workers.scripts.script_and_version_settings.get(script_name, \*, account_id) -> ScriptAndVersionSettingGetResponse
-
-## AccountSettings
-
-Types:
-
-```python
-from cloudflare.types.workers import AccountSettingUpdateResponse, AccountSettingGetResponse
-```
-
-Methods:
-
-- client.workers.account_settings.update(\*, account_id, \*\*params) -> AccountSettingUpdateResponse
-- client.workers.account_settings.get(\*, account_id) -> AccountSettingGetResponse
-
-## Domains
-
-Types:
-
-```python
-from cloudflare.types.workers import Domain
-```
-
-Methods:
-
-- client.workers.domains.update(\*, account_id, \*\*params) -> Optional[Domain]
-- client.workers.domains.list(\*, account_id, \*\*params) -> SyncSinglePage[Domain]
-- client.workers.domains.delete(domain_id, \*, account_id) -> None
-- client.workers.domains.get(domain_id, \*, account_id) -> Optional[Domain]
-
-## Subdomains
-
-Types:
-
-```python
-from cloudflare.types.workers import SubdomainUpdateResponse, SubdomainGetResponse
-```
-
-Methods:
-
-- client.workers.subdomains.update(\*, account_id, \*\*params) -> SubdomainUpdateResponse
-- client.workers.subdomains.delete(\*, account_id) -> None
-- client.workers.subdomains.get(\*, account_id) -> SubdomainGetResponse
-
-## Observability
-
-### Telemetry
-
-Types:
-
-```python
-from cloudflare.types.workers.observability import (
- TelemetryKeysResponse,
- TelemetryQueryResponse,
- TelemetryValuesResponse,
-)
-```
-
-Methods:
-
-- client.workers.observability.telemetry.keys(\*, account_id, \*\*params) -> SyncSinglePage[TelemetryKeysResponse]
-- client.workers.observability.telemetry.query(\*, account_id, \*\*params) -> TelemetryQueryResponse
-- client.workers.observability.telemetry.values(\*, account_id, \*\*params) -> SyncSinglePage[TelemetryValuesResponse]
-
-# KV
-
-## Namespaces
-
-Types:
-
-```python
-from cloudflare.types.kv import (
- Namespace,
- NamespaceDeleteResponse,
- NamespaceBulkDeleteResponse,
- NamespaceBulkGetResponse,
- NamespaceBulkUpdateResponse,
-)
-```
-
-Methods:
-
-- client.kv.namespaces.create(\*, account_id, \*\*params) -> Optional[Namespace]
-- client.kv.namespaces.update(namespace_id, \*, account_id, \*\*params) -> Namespace
-- client.kv.namespaces.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[Namespace]
-- client.kv.namespaces.delete(namespace_id, \*, account_id) -> Optional[NamespaceDeleteResponse]
-- client.kv.namespaces.bulk_delete(namespace_id, \*, account_id, \*\*params) -> Optional[NamespaceBulkDeleteResponse]
-- client.kv.namespaces.bulk_get(namespace_id, \*, account_id, \*\*params) -> Optional[NamespaceBulkGetResponse]
-- client.kv.namespaces.bulk_update(namespace_id, \*, account_id, \*\*params) -> Optional[NamespaceBulkUpdateResponse]
-- client.kv.namespaces.get(namespace_id, \*, account_id) -> Optional[Namespace]
-
-### Keys
-
-Types:
-
-```python
-from cloudflare.types.kv.namespaces import (
- Key,
- KeyBulkDeleteResponse,
- KeyBulkGetResponse,
- KeyBulkUpdateResponse,
-)
-```
-
-Methods:
-
-- client.kv.namespaces.keys.list(namespace_id, \*, account_id, \*\*params) -> SyncCursorLimitPagination[Key]
-- client.kv.namespaces.keys.bulk_delete(namespace_id, \*, account_id, \*\*params) -> Optional[KeyBulkDeleteResponse]
-- client.kv.namespaces.keys.bulk_get(namespace_id, \*, account_id, \*\*params) -> Optional[KeyBulkGetResponse]
-- client.kv.namespaces.keys.bulk_update(namespace_id, \*, account_id, \*\*params) -> Optional[KeyBulkUpdateResponse]
-
-### Metadata
-
-Methods:
-
-- client.kv.namespaces.metadata.get(key_name, \*, account_id, namespace_id) -> object
-
-### Values
-
-Types:
-
-```python
-from cloudflare.types.kv.namespaces import ValueUpdateResponse, ValueDeleteResponse
-```
-
-Methods:
-
-- client.kv.namespaces.values.update(key_name, \*, account_id, namespace_id, \*\*params) -> Optional[ValueUpdateResponse]
-- client.kv.namespaces.values.delete(key_name, \*, account_id, namespace_id) -> Optional[ValueDeleteResponse]
-- client.kv.namespaces.values.get(key_name, \*, account_id, namespace_id) -> BinaryAPIResponse
-
-# DurableObjects
-
-## Namespaces
-
-Types:
-
-```python
-from cloudflare.types.durable_objects import Namespace
-```
-
-Methods:
-
-- client.durable_objects.namespaces.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[Namespace]
-
-### Objects
-
-Types:
-
-```python
-from cloudflare.types.durable_objects.namespaces import DurableObject
-```
-
-Methods:
-
-- client.durable_objects.namespaces.objects.list(id, \*, account_id, \*\*params) -> SyncCursorPaginationAfter[DurableObject]
-
-# Queues
-
-Types:
-
-```python
-from cloudflare.types.queues import Queue, QueueDeleteResponse
-```
-
-Methods:
-
-- client.queues.create(\*, account_id, \*\*params) -> Optional[Queue]
-- client.queues.update(queue_id, \*, account_id, \*\*params) -> Optional[Queue]
-- client.queues.list(\*, account_id) -> SyncSinglePage[Queue]
-- client.queues.delete(queue_id, \*, account_id) -> QueueDeleteResponse
-- client.queues.edit(queue_id, \*, account_id, \*\*params) -> Optional[Queue]
-- client.queues.get(queue_id, \*, account_id) -> Optional[Queue]
-
-## Messages
-
-Types:
-
-```python
-from cloudflare.types.queues import (
- MessageAckResponse,
- MessageBulkPushResponse,
- MessagePullResponse,
- MessagePushResponse,
-)
-```
-
-Methods:
-
-- client.queues.messages.ack(queue_id, \*, account_id, \*\*params) -> Optional[MessageAckResponse]
-- client.queues.messages.bulk_push(queue_id, \*, account_id, \*\*params) -> MessageBulkPushResponse
-- client.queues.messages.pull(queue_id, \*, account_id, \*\*params) -> Optional[MessagePullResponse]
-- client.queues.messages.push(queue_id, \*, account_id, \*\*params) -> MessagePushResponse
-
-## Purge
-
-Types:
-
-```python
-from cloudflare.types.queues import PurgeStatusResponse
-```
-
-Methods:
-
-- client.queues.purge.start(queue_id, \*, account_id, \*\*params) -> Optional[Queue]
-- client.queues.purge.status(queue_id, \*, account_id) -> Optional[PurgeStatusResponse]
-
-## Consumers
-
-Types:
-
-```python
-from cloudflare.types.queues import Consumer, ConsumerDeleteResponse
-```
-
-Methods:
-
-- client.queues.consumers.create(queue_id, \*, account_id, \*\*params) -> Optional[Consumer]
-- client.queues.consumers.update(consumer_id, \*, account_id, queue_id, \*\*params) -> Optional[Consumer]
-- client.queues.consumers.list(queue_id, \*, account_id) -> SyncSinglePage[Consumer]
-- client.queues.consumers.delete(consumer_id, \*, account_id, queue_id) -> ConsumerDeleteResponse
-- client.queues.consumers.get(consumer_id, \*, account_id, queue_id) -> Optional[Consumer]
-
-## Subscriptions
-
-Types:
-
-```python
-from cloudflare.types.queues import (
- SubscriptionCreateResponse,
- SubscriptionUpdateResponse,
- SubscriptionListResponse,
- SubscriptionDeleteResponse,
- SubscriptionGetResponse,
-)
-```
-
-Methods:
-
-- client.queues.subscriptions.create(\*, account_id, \*\*params) -> Optional[SubscriptionCreateResponse]
-- client.queues.subscriptions.update(subscription_id, \*, account_id, \*\*params) -> Optional[SubscriptionUpdateResponse]
-- client.queues.subscriptions.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[SubscriptionListResponse]
-- client.queues.subscriptions.delete(subscription_id, \*, account_id) -> Optional[SubscriptionDeleteResponse]
-- client.queues.subscriptions.get(subscription_id, \*, account_id) -> Optional[SubscriptionGetResponse]
-
-# APIGateway
-
-## Configurations
-
-Types:
-
-```python
-from cloudflare.types.api_gateway import Configuration
-```
-
-Methods:
-
-- client.api_gateway.configurations.update(\*, zone_id, \*\*params) -> Configuration
-- client.api_gateway.configurations.get(\*, zone_id, \*\*params) -> Configuration
-
-## Discovery
-
-Types:
-
-```python
-from cloudflare.types.api_gateway import DiscoveryOperation, DiscoveryGetResponse
-```
-
-Methods:
-
-- client.api_gateway.discovery.get(\*, zone_id) -> DiscoveryGetResponse
-
-### Operations
-
-Types:
-
-```python
-from cloudflare.types.api_gateway.discovery import OperationBulkEditResponse, OperationEditResponse
-```
-
-Methods:
-
-- client.api_gateway.discovery.operations.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[DiscoveryOperation]
-- client.api_gateway.discovery.operations.bulk_edit(\*, zone_id, \*\*params) -> OperationBulkEditResponse
-- client.api_gateway.discovery.operations.edit(operation_id, \*, zone_id, \*\*params) -> OperationEditResponse
-
-## Operations
-
-Types:
-
-```python
-from cloudflare.types.api_gateway import (
- APIShield,
- OperationCreateResponse,
- OperationListResponse,
- OperationDeleteResponse,
- OperationBulkCreateResponse,
- OperationBulkDeleteResponse,
- OperationGetResponse,
-)
-```
-
-Methods:
-
-- client.api_gateway.operations.create(\*, zone_id, \*\*params) -> OperationCreateResponse
-- client.api_gateway.operations.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[OperationListResponse]
-- client.api_gateway.operations.delete(operation_id, \*, zone_id) -> OperationDeleteResponse
-- client.api_gateway.operations.bulk_create(\*, zone_id, \*\*params) -> SyncSinglePage[OperationBulkCreateResponse]
-- client.api_gateway.operations.bulk_delete(\*, zone_id) -> OperationBulkDeleteResponse
-- client.api_gateway.operations.get(operation_id, \*, zone_id, \*\*params) -> OperationGetResponse
-
-### SchemaValidation
-
-Types:
-
-```python
-from cloudflare.types.api_gateway.operations import (
- SettingsMultipleRequest,
- SchemaValidationUpdateResponse,
- SchemaValidationGetResponse,
-)
-```
-
-Methods:
-
-- client.api_gateway.operations.schema_validation.update(operation_id, \*, zone_id, \*\*params) -> SchemaValidationUpdateResponse
-- client.api_gateway.operations.schema_validation.edit(\*, zone_id, \*\*params) -> SettingsMultipleRequest
-- client.api_gateway.operations.schema_validation.get(operation_id, \*, zone_id) -> SchemaValidationGetResponse
-
-## Schemas
-
-Types:
-
-```python
-from cloudflare.types.api_gateway import SchemaListResponse
-```
-
-Methods:
-
-- client.api_gateway.schemas.list(\*, zone_id, \*\*params) -> SchemaListResponse
-
-## Settings
-
-Types:
-
-```python
-from cloudflare.types.api_gateway import Settings
-```
-
-### SchemaValidation
-
-Methods:
-
-- client.api_gateway.settings.schema_validation.update(\*, zone_id, \*\*params) -> Settings
-- client.api_gateway.settings.schema_validation.edit(\*, zone_id, \*\*params) -> Settings
-- client.api_gateway.settings.schema_validation.get(\*, zone_id) -> Settings
-
-## UserSchemas
-
-Types:
-
-```python
-from cloudflare.types.api_gateway import (
- Message,
- OldPublicSchema,
- UserSchemaCreateResponse,
- UserSchemaDeleteResponse,
-)
-```
-
-Methods:
-
-- client.api_gateway.user_schemas.create(\*, zone_id, \*\*params) -> UserSchemaCreateResponse
-- client.api_gateway.user_schemas.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[OldPublicSchema]
-- client.api_gateway.user_schemas.delete(schema_id, \*, zone_id) -> UserSchemaDeleteResponse
-- client.api_gateway.user_schemas.edit(schema_id, \*, zone_id, \*\*params) -> OldPublicSchema
-- client.api_gateway.user_schemas.get(schema_id, \*, zone_id, \*\*params) -> OldPublicSchema
-
-### Operations
-
-Types:
-
-```python
-from cloudflare.types.api_gateway.user_schemas import OperationListResponse
-```
-
-Methods:
-
-- client.api_gateway.user_schemas.operations.list(schema_id, \*, zone_id, \*\*params) -> SyncV4PagePaginationArray[OperationListResponse]
-
-### Hosts
-
-Types:
-
-```python
-from cloudflare.types.api_gateway.user_schemas import HostListResponse
-```
-
-Methods:
-
-- client.api_gateway.user_schemas.hosts.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[HostListResponse]
-
-## ExpressionTemplate
-
-### Fallthrough
-
-Types:
-
-```python
-from cloudflare.types.api_gateway.expression_template import FallthroughCreateResponse
-```
-
-Methods:
-
-- client.api_gateway.expression_template.fallthrough.create(\*, zone_id, \*\*params) -> FallthroughCreateResponse
-
-# ManagedTransforms
-
-Types:
-
-```python
-from cloudflare.types.managed_transforms import (
- ManagedTransformListResponse,
- ManagedTransformEditResponse,
-)
-```
-
-Methods:
-
-- client.managed_transforms.list(\*, zone_id) -> ManagedTransformListResponse
-- client.managed_transforms.delete(\*, zone_id) -> None
-- client.managed_transforms.edit(\*, zone_id, \*\*params) -> ManagedTransformEditResponse
-
-# PageShield
-
-Types:
-
-```python
-from cloudflare.types.page_shield import Setting, PageShieldUpdateResponse
-```
-
-Methods:
-
-- client.page_shield.update(\*, zone_id, \*\*params) -> Optional[PageShieldUpdateResponse]
-- client.page_shield.get(\*, zone_id) -> Optional[Setting]
-
-## Policies
-
-Types:
-
-```python
-from cloudflare.types.page_shield import (
- Policy,
- PolicyCreateResponse,
- PolicyUpdateResponse,
- PolicyListResponse,
- PolicyGetResponse,
-)
-```
-
-Methods:
-
-- client.page_shield.policies.create(\*, zone_id, \*\*params) -> Optional[PolicyCreateResponse]
-- client.page_shield.policies.update(policy_id, \*, zone_id, \*\*params) -> Optional[PolicyUpdateResponse]
-- client.page_shield.policies.list(\*, zone_id) -> SyncSinglePage[PolicyListResponse]
-- client.page_shield.policies.delete(policy_id, \*, zone_id) -> None
-- client.page_shield.policies.get(policy_id, \*, zone_id) -> Optional[PolicyGetResponse]
-
-## Connections
-
-Types:
-
-```python
-from cloudflare.types.page_shield import Connection
-```
-
-Methods:
-
-- client.page_shield.connections.list(\*, zone_id, \*\*params) -> SyncSinglePage[Connection]
-- client.page_shield.connections.get(connection_id, \*, zone_id) -> Optional[Connection]
-
-## Scripts
-
-Types:
-
-```python
-from cloudflare.types.page_shield import Script, ScriptGetResponse
-```
-
-Methods:
-
-- client.page_shield.scripts.list(\*, zone_id, \*\*params) -> SyncSinglePage[Script]
-- client.page_shield.scripts.get(script_id, \*, zone_id) -> Optional[ScriptGetResponse]
-
-## Cookies
-
-Types:
-
-```python
-from cloudflare.types.page_shield import CookieListResponse, CookieGetResponse
-```
-
-Methods:
-
-- client.page_shield.cookies.list(\*, zone_id, \*\*params) -> SyncSinglePage[CookieListResponse]
-- client.page_shield.cookies.get(cookie_id, \*, zone_id) -> Optional[CookieGetResponse]
-
-# Rulesets
-
-Types:
-
-```python
-from cloudflare.types.rulesets import (
- Kind,
- Phase,
- Ruleset,
- RulesetCreateResponse,
- RulesetUpdateResponse,
- RulesetListResponse,
- RulesetGetResponse,
-)
-```
-
-Methods:
-
-- client.rulesets.create(\*, account_id, zone_id, \*\*params) -> RulesetCreateResponse
-- client.rulesets.update(ruleset_id, \*, account_id, zone_id, \*\*params) -> RulesetUpdateResponse
-- client.rulesets.list(\*, account_id, zone_id, \*\*params) -> SyncCursorPagination[RulesetListResponse]
-- client.rulesets.delete(ruleset_id, \*, account_id, zone_id) -> None
-- client.rulesets.get(ruleset_id, \*, account_id, zone_id) -> RulesetGetResponse
-
-## Phases
-
-Types:
-
-```python
-from cloudflare.types.rulesets import PhaseUpdateResponse, PhaseGetResponse
-```
-
-Methods:
-
-- client.rulesets.phases.update(ruleset_phase, \*, account_id, zone_id, \*\*params) -> PhaseUpdateResponse
-- client.rulesets.phases.get(ruleset_phase, \*, account_id, zone_id) -> PhaseGetResponse
-
-### Versions
-
-Types:
-
-```python
-from cloudflare.types.rulesets.phases import VersionListResponse, VersionGetResponse
-```
-
-Methods:
-
-- client.rulesets.phases.versions.list(ruleset_phase, \*, account_id, zone_id) -> SyncSinglePage[VersionListResponse]
-- client.rulesets.phases.versions.get(ruleset_version, \*, ruleset_phase, account_id, zone_id) -> VersionGetResponse
-
-## Rules
-
-Types:
-
-```python
-from cloudflare.types.rulesets import (
- BlockRule,
- CompressResponseRule,
- DDoSDynamicRule,
- ExecuteRule,
- ForceConnectionCloseRule,
- LogCustomFieldRule,
- LogRule,
- Logging,
- ManagedChallengeRule,
- RedirectRule,
- RewriteRule,
- RouteRule,
- RulesetRule,
- ScoreRule,
- ServeErrorRule,
- SetCacheSettingsRule,
- SetConfigRule,
- SkipRule,
- RuleCreateResponse,
- RuleDeleteResponse,
- RuleEditResponse,
-)
-```
-
-Methods:
-
-- client.rulesets.rules.create(ruleset_id, \*, account_id, zone_id, \*\*params) -> RuleCreateResponse
-- client.rulesets.rules.delete(rule_id, \*, ruleset_id, account_id, zone_id) -> RuleDeleteResponse
-- client.rulesets.rules.edit(rule_id, \*, ruleset_id, account_id, zone_id, \*\*params) -> RuleEditResponse
-
-## Versions
-
-Types:
-
-```python
-from cloudflare.types.rulesets import VersionListResponse, VersionGetResponse
-```
-
-Methods:
-
-- client.rulesets.versions.list(ruleset_id, \*, account_id, zone_id) -> SyncSinglePage[VersionListResponse]
-- client.rulesets.versions.delete(ruleset_version, \*, ruleset_id, account_id, zone_id) -> None
-- client.rulesets.versions.get(ruleset_version, \*, ruleset_id, account_id, zone_id) -> VersionGetResponse
-
-# URLNormalization
-
-Types:
-
-```python
-from cloudflare.types.url_normalization import (
- URLNormalizationUpdateResponse,
- URLNormalizationGetResponse,
-)
-```
-
-Methods:
-
-- client.url_normalization.update(\*, zone_id, \*\*params) -> URLNormalizationUpdateResponse
-- client.url_normalization.delete(\*, zone_id) -> None
-- client.url_normalization.get(\*, zone_id) -> URLNormalizationGetResponse
-
-# Spectrum
-
-Types:
-
-```python
-from cloudflare.types.spectrum import DNS, EdgeIPs, OriginDNS, OriginPort
-```
-
-## Analytics
-
-### Aggregates
-
-#### Currents
-
-Types:
-
-```python
-from cloudflare.types.spectrum.analytics.aggregates import CurrentGetResponse
-```
-
-Methods:
-
-- client.spectrum.analytics.aggregates.currents.get(\*, zone_id, \*\*params) -> Optional[CurrentGetResponse]
-
-### Events
-
-Types:
-
-```python
-from cloudflare.types.spectrum.analytics import Dimension
-```
-
-#### Bytimes
-
-Types:
-
-```python
-from cloudflare.types.spectrum.analytics.events import BytimeGetResponse
-```
-
-Methods:
-
-- client.spectrum.analytics.events.bytimes.get(\*, zone_id, \*\*params) -> Optional[BytimeGetResponse]
-
-#### Summaries
-
-Types:
-
-```python
-from cloudflare.types.spectrum.analytics.events import SummaryGetResponse
-```
-
-Methods:
-
-- client.spectrum.analytics.events.summaries.get(\*, zone_id, \*\*params) -> Optional[SummaryGetResponse]
-
-## Apps
-
-Types:
-
-```python
-from cloudflare.types.spectrum import (
- AppCreateResponse,
- AppUpdateResponse,
- AppListResponse,
- AppDeleteResponse,
- AppGetResponse,
-)
-```
-
-Methods:
-
-- client.spectrum.apps.create(\*, zone_id, \*\*params) -> Optional[AppCreateResponse]
-- client.spectrum.apps.update(app_id, \*, zone_id, \*\*params) -> Optional[AppUpdateResponse]
-- client.spectrum.apps.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[AppListResponse]
-- client.spectrum.apps.delete(app_id, \*, zone_id) -> Optional[AppDeleteResponse]
-- client.spectrum.apps.get(app_id, \*, zone_id) -> Optional[AppGetResponse]
-
-# Addressing
-
-## RegionalHostnames
-
-Types:
-
-```python
-from cloudflare.types.addressing import (
- RegionalHostnameCreateResponse,
- RegionalHostnameListResponse,
- RegionalHostnameDeleteResponse,
- RegionalHostnameEditResponse,
- RegionalHostnameGetResponse,
-)
-```
-
-Methods:
-
-- client.addressing.regional_hostnames.create(\*, zone_id, \*\*params) -> Optional[RegionalHostnameCreateResponse]
-- client.addressing.regional_hostnames.list(\*, zone_id) -> SyncSinglePage[RegionalHostnameListResponse]
-- client.addressing.regional_hostnames.delete(hostname, \*, zone_id) -> RegionalHostnameDeleteResponse
-- client.addressing.regional_hostnames.edit(hostname, \*, zone_id, \*\*params) -> Optional[RegionalHostnameEditResponse]
-- client.addressing.regional_hostnames.get(hostname, \*, zone_id) -> Optional[RegionalHostnameGetResponse]
-
-### Regions
-
-Types:
-
-```python
-from cloudflare.types.addressing.regional_hostnames import RegionListResponse
-```
-
-Methods:
-
-- client.addressing.regional_hostnames.regions.list(\*, account_id) -> SyncSinglePage[RegionListResponse]
-
-## Services
-
-Types:
-
-```python
-from cloudflare.types.addressing import ServiceListResponse
-```
-
-Methods:
-
-- client.addressing.services.list(\*, account_id) -> SyncSinglePage[ServiceListResponse]
-
-## AddressMaps
-
-Types:
-
-```python
-from cloudflare.types.addressing import (
- AddressMap,
- Kind,
- AddressMapCreateResponse,
- AddressMapDeleteResponse,
- AddressMapGetResponse,
-)
-```
-
-Methods:
-
-- client.addressing.address_maps.create(\*, account_id, \*\*params) -> Optional[AddressMapCreateResponse]
-- client.addressing.address_maps.list(\*, account_id) -> SyncSinglePage[AddressMap]
-- client.addressing.address_maps.delete(address_map_id, \*, account_id) -> AddressMapDeleteResponse
-- client.addressing.address_maps.edit(address_map_id, \*, account_id, \*\*params) -> Optional[AddressMap]
-- client.addressing.address_maps.get(address_map_id, \*, account_id) -> Optional[AddressMapGetResponse]
-
-### Accounts
-
-Types:
-
-```python
-from cloudflare.types.addressing.address_maps import AccountUpdateResponse, AccountDeleteResponse
-```
-
-Methods:
-
-- client.addressing.address_maps.accounts.update(address_map_id, \*, account_id, \*\*params) -> AccountUpdateResponse
-- client.addressing.address_maps.accounts.delete(address_map_id, \*, account_id) -> AccountDeleteResponse
-
-### IPs
-
-Types:
-
-```python
-from cloudflare.types.addressing.address_maps import IPUpdateResponse, IPDeleteResponse
-```
-
-Methods:
-
-- client.addressing.address_maps.ips.update(ip_address, \*, account_id, address_map_id, \*\*params) -> IPUpdateResponse
-- client.addressing.address_maps.ips.delete(ip_address, \*, account_id, address_map_id) -> IPDeleteResponse
-
-### Zones
-
-Types:
-
-```python
-from cloudflare.types.addressing.address_maps import ZoneUpdateResponse, ZoneDeleteResponse
-```
-
-Methods:
-
-- client.addressing.address_maps.zones.update(address_map_id, \*, zone_id, account_id, \*\*params) -> ZoneUpdateResponse
-- client.addressing.address_maps.zones.delete(address_map_id, \*, zone_id, account_id) -> ZoneDeleteResponse
-
-## LOADocuments
-
-Types:
-
-```python
-from cloudflare.types.addressing import LOADocumentCreateResponse
-```
-
-Methods:
-
-- client.addressing.loa_documents.create(\*, account_id, \*\*params) -> Optional[LOADocumentCreateResponse]
-- client.addressing.loa_documents.get(loa_document_id, \*, account_id) -> BinaryAPIResponse
-
-## Prefixes
-
-Types:
-
-```python
-from cloudflare.types.addressing import Prefix, PrefixDeleteResponse
-```
-
-Methods:
-
-- client.addressing.prefixes.create(\*, account_id, \*\*params) -> Optional[Prefix]
-- client.addressing.prefixes.list(\*, account_id) -> SyncSinglePage[Prefix]
-- client.addressing.prefixes.delete(prefix_id, \*, account_id) -> PrefixDeleteResponse
-- client.addressing.prefixes.edit(prefix_id, \*, account_id, \*\*params) -> Optional[Prefix]
-- client.addressing.prefixes.get(prefix_id, \*, account_id) -> Optional[Prefix]
-
-### ServiceBindings
-
-Types:
-
-```python
-from cloudflare.types.addressing.prefixes import ServiceBinding, ServiceBindingDeleteResponse
-```
-
-Methods:
-
-- client.addressing.prefixes.service_bindings.create(prefix_id, \*, account_id, \*\*params) -> Optional[ServiceBinding]
-- client.addressing.prefixes.service_bindings.list(prefix_id, \*, account_id) -> SyncSinglePage[ServiceBinding]
-- client.addressing.prefixes.service_bindings.delete(binding_id, \*, account_id, prefix_id) -> ServiceBindingDeleteResponse
-- client.addressing.prefixes.service_bindings.get(binding_id, \*, account_id, prefix_id) -> Optional[ServiceBinding]
-
-### BGPPrefixes
-
-Types:
-
-```python
-from cloudflare.types.addressing.prefixes import BGPPrefix
-```
-
-Methods:
-
-- client.addressing.prefixes.bgp_prefixes.create(prefix_id, \*, account_id, \*\*params) -> Optional[BGPPrefix]
-- client.addressing.prefixes.bgp_prefixes.list(prefix_id, \*, account_id) -> SyncSinglePage[BGPPrefix]
-- client.addressing.prefixes.bgp_prefixes.edit(bgp_prefix_id, \*, account_id, prefix_id, \*\*params) -> Optional[BGPPrefix]
-- client.addressing.prefixes.bgp_prefixes.get(bgp_prefix_id, \*, account_id, prefix_id) -> Optional[BGPPrefix]
-
-### AdvertisementStatus
-
-Types:
-
-```python
-from cloudflare.types.addressing.prefixes import (
- AdvertisementStatusEditResponse,
- AdvertisementStatusGetResponse,
-)
-```
-
-Methods:
-
-- client.addressing.prefixes.advertisement_status.edit(prefix_id, \*, account_id, \*\*params) -> Optional[AdvertisementStatusEditResponse]
-- client.addressing.prefixes.advertisement_status.get(prefix_id, \*, account_id) -> Optional[AdvertisementStatusGetResponse]
-
-### Delegations
-
-Types:
-
-```python
-from cloudflare.types.addressing.prefixes import Delegations, DelegationDeleteResponse
-```
-
-Methods:
-
-- client.addressing.prefixes.delegations.create(prefix_id, \*, account_id, \*\*params) -> Optional[Delegations]
-- client.addressing.prefixes.delegations.list(prefix_id, \*, account_id) -> SyncSinglePage[Delegations]
-- client.addressing.prefixes.delegations.delete(delegation_id, \*, account_id, prefix_id) -> Optional[DelegationDeleteResponse]
-
-# AuditLogs
-
-Methods:
-
-- client.audit_logs.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[AuditLog]
-
-# Billing
-
-## Profiles
-
-Types:
-
-```python
-from cloudflare.types.billing import ProfileGetResponse
-```
-
-Methods:
-
-- client.billing.profiles.get(\*, account_id) -> ProfileGetResponse
-
-# BrandProtection
-
-Types:
-
-```python
-from cloudflare.types.brand_protection import (
- Info,
- Submit,
- BrandProtectionSubmitResponse,
- BrandProtectionURLInfoResponse,
-)
-```
-
-Methods:
-
-- client.brand_protection.submit(\*, account_id) -> BrandProtectionSubmitResponse
-- client.brand_protection.url_info(\*, account_id) -> SyncSinglePage[BrandProtectionURLInfoResponse]
-
-## Queries
-
-Methods:
-
-- client.brand_protection.queries.create(\*, account_id, \*\*params) -> None
-- client.brand_protection.queries.delete(\*, account_id, \*\*params) -> None
-- client.brand_protection.queries.bulk(\*, account_id, \*\*params) -> None
-
-## Matches
-
-Types:
-
-```python
-from cloudflare.types.brand_protection import MatchDownloadResponse, MatchGetResponse
-```
-
-Methods:
-
-- client.brand_protection.matches.download(\*, account_id, \*\*params) -> MatchDownloadResponse
-- client.brand_protection.matches.get(\*, account_id, \*\*params) -> MatchGetResponse
-
-## Logos
-
-Types:
-
-```python
-from cloudflare.types.brand_protection import LogoCreateResponse
-```
-
-Methods:
-
-- client.brand_protection.logos.create(\*, account_id, \*\*params) -> LogoCreateResponse
-- client.brand_protection.logos.delete(logo_id, \*, account_id) -> None
-
-## LogoMatches
-
-Types:
-
-```python
-from cloudflare.types.brand_protection import LogoMatchDownloadResponse, LogoMatchGetResponse
-```
-
-Methods:
-
-- client.brand_protection.logo_matches.download(\*, account_id, \*\*params) -> LogoMatchDownloadResponse
-- client.brand_protection.logo_matches.get(\*, account_id, \*\*params) -> LogoMatchGetResponse
-
-# Diagnostics
-
-## Traceroutes
-
-Types:
-
-```python
-from cloudflare.types.diagnostics import Traceroute
-```
-
-Methods:
-
-- client.diagnostics.traceroutes.create(\*, account_id, \*\*params) -> SyncSinglePage[Traceroute]
-
-## EndpointHealthchecks
-
-Types:
-
-```python
-from cloudflare.types.diagnostics import (
- EndpointHealthcheck,
- EndpointHealthcheckCreateResponse,
- EndpointHealthcheckUpdateResponse,
- EndpointHealthcheckListResponse,
- EndpointHealthcheckDeleteResponse,
- EndpointHealthcheckGetResponse,
-)
-```
-
-Methods:
-
-- client.diagnostics.endpoint_healthchecks.create(\*, account_id, \*\*params) -> Optional[EndpointHealthcheckCreateResponse]
-- client.diagnostics.endpoint_healthchecks.update(id, \*, account_id, \*\*params) -> Optional[EndpointHealthcheckUpdateResponse]
-- client.diagnostics.endpoint_healthchecks.list(\*, account_id) -> Optional[EndpointHealthcheckListResponse]
-- client.diagnostics.endpoint_healthchecks.delete(id, \*, account_id) -> EndpointHealthcheckDeleteResponse
-- client.diagnostics.endpoint_healthchecks.get(id, \*, account_id) -> Optional[EndpointHealthcheckGetResponse]
-
-# Images
-
-## V1
-
-Types:
-
-```python
-from cloudflare.types.images import Image, V1ListResponse, V1DeleteResponse
-```
-
-Methods:
-
-- client.images.v1.create(\*, account_id, \*\*params) -> Image
-- client.images.v1.list(\*, account_id, \*\*params) -> SyncV4PagePagination[V1ListResponse]
-- client.images.v1.delete(image_id, \*, account_id) -> V1DeleteResponse
-- client.images.v1.edit(image_id, \*, account_id, \*\*params) -> Image
-- client.images.v1.get(image_id, \*, account_id) -> Image
-
-### Keys
-
-Types:
-
-```python
-from cloudflare.types.images.v1 import Key, KeyUpdateResponse, KeyListResponse, KeyDeleteResponse
-```
-
-Methods:
-
-- client.images.v1.keys.update(signing_key_name, \*, account_id) -> KeyUpdateResponse
-- client.images.v1.keys.list(\*, account_id) -> KeyListResponse
-- client.images.v1.keys.delete(signing_key_name, \*, account_id) -> KeyDeleteResponse
-
-### Stats
-
-Types:
-
-```python
-from cloudflare.types.images.v1 import Stat
-```
-
-Methods:
-
-- client.images.v1.stats.get(\*, account_id) -> Stat
-
-### Variants
-
-Types:
-
-```python
-from cloudflare.types.images.v1 import (
- Variant,
- VariantCreateResponse,
- VariantDeleteResponse,
- VariantEditResponse,
- VariantGetResponse,
-)
-```
-
-Methods:
-
-- client.images.v1.variants.create(\*, account_id, \*\*params) -> VariantCreateResponse
-- client.images.v1.variants.list(\*, account_id) -> Variant
-- client.images.v1.variants.delete(variant_id, \*, account_id) -> VariantDeleteResponse
-- client.images.v1.variants.edit(variant_id, \*, account_id, \*\*params) -> VariantEditResponse
-- client.images.v1.variants.get(variant_id, \*, account_id) -> VariantGetResponse
-
-### Blobs
-
-Methods:
-
-- client.images.v1.blobs.get(image_id, \*, account_id) -> BinaryAPIResponse
-
-## V2
-
-Types:
-
-```python
-from cloudflare.types.images import V2ListResponse
-```
-
-Methods:
-
-- client.images.v2.list(\*, account_id, \*\*params) -> V2ListResponse
-
-### DirectUploads
-
-Types:
-
-```python
-from cloudflare.types.images.v2 import DirectUploadCreateResponse
-```
-
-Methods:
-
-- client.images.v2.direct_uploads.create(\*, account_id, \*\*params) -> DirectUploadCreateResponse
-
-# Intel
-
-## ASN
-
-Methods:
-
-- client.intel.asn.get(asn, \*, account_id) -> Optional[ASN]
-
-### Subnets
-
-Types:
-
-```python
-from cloudflare.types.intel.asn import SubnetGetResponse
-```
-
-Methods:
-
-- client.intel.asn.subnets.get(asn, \*, account_id) -> SubnetGetResponse
-
-## DNS
-
-Types:
-
-```python
-from cloudflare.types.intel import DNS
-```
-
-Methods:
-
-- client.intel.dns.list(\*, account_id, \*\*params) -> SyncV4PagePagination[Optional[DNS]]
-
-## Domains
-
-Types:
-
-```python
-from cloudflare.types.intel import Domain
-```
-
-Methods:
-
-- client.intel.domains.get(\*, account_id, \*\*params) -> Optional[Domain]
-
-### Bulks
-
-Types:
-
-```python
-from cloudflare.types.intel.domains import BulkGetResponse
-```
-
-Methods:
-
-- client.intel.domains.bulks.get(\*, account_id, \*\*params) -> Optional[BulkGetResponse]
-
-## DomainHistory
-
-Types:
-
-```python
-from cloudflare.types.intel import DomainHistory, DomainHistoryGetResponse
-```
-
-Methods:
-
-- client.intel.domain_history.get(\*, account_id, \*\*params) -> Optional[DomainHistoryGetResponse]
-
-## IPs
-
-Types:
-
-```python
-from cloudflare.types.intel import IP, IPGetResponse
-```
-
-Methods:
-
-- client.intel.ips.get(\*, account_id, \*\*params) -> Optional[IPGetResponse]
-
-## IPLists
-
-Types:
-
-```python
-from cloudflare.types.intel import IPList
-```
-
-## Miscategorizations
-
-Types:
-
-```python
-from cloudflare.types.intel import MiscategorizationCreateResponse
-```
-
-Methods:
-
-- client.intel.miscategorizations.create(\*, account_id, \*\*params) -> MiscategorizationCreateResponse
-
-## Whois
-
-Types:
-
-```python
-from cloudflare.types.intel import Whois, WhoisGetResponse
-```
-
-Methods:
-
-- client.intel.whois.get(\*, account_id, \*\*params) -> Optional[WhoisGetResponse]
-
-## IndicatorFeeds
-
-Types:
-
-```python
-from cloudflare.types.intel import (
- IndicatorFeedCreateResponse,
- IndicatorFeedUpdateResponse,
- IndicatorFeedListResponse,
- IndicatorFeedDataResponse,
- IndicatorFeedGetResponse,
-)
-```
-
-Methods:
-
-- client.intel.indicator_feeds.create(\*, account_id, \*\*params) -> Optional[IndicatorFeedCreateResponse]
-- client.intel.indicator_feeds.update(feed_id, \*, account_id, \*\*params) -> Optional[IndicatorFeedUpdateResponse]
-- client.intel.indicator_feeds.list(\*, account_id) -> SyncSinglePage[IndicatorFeedListResponse]
-- client.intel.indicator_feeds.data(feed_id, \*, account_id) -> str
-- client.intel.indicator_feeds.get(feed_id, \*, account_id) -> Optional[IndicatorFeedGetResponse]
-
-### Snapshots
-
-Types:
-
-```python
-from cloudflare.types.intel.indicator_feeds import SnapshotUpdateResponse
-```
-
-Methods:
-
-- client.intel.indicator_feeds.snapshots.update(feed_id, \*, account_id, \*\*params) -> Optional[SnapshotUpdateResponse]
-
-### Permissions
-
-Types:
-
-```python
-from cloudflare.types.intel.indicator_feeds import (
- PermissionCreateResponse,
- PermissionListResponse,
- PermissionDeleteResponse,
-)
-```
-
-Methods:
-
-- client.intel.indicator_feeds.permissions.create(\*, account_id, \*\*params) -> Optional[PermissionCreateResponse]
-- client.intel.indicator_feeds.permissions.list(\*, account_id) -> Optional[PermissionListResponse]
-- client.intel.indicator_feeds.permissions.delete(\*, account_id, \*\*params) -> Optional[PermissionDeleteResponse]
-
-## Sinkholes
-
-Types:
-
-```python
-from cloudflare.types.intel import Sinkhole
-```
-
-Methods:
-
-- client.intel.sinkholes.list(\*, account_id) -> SyncSinglePage[Sinkhole]
-
-## AttackSurfaceReport
-
-### IssueTypes
-
-Types:
-
-```python
-from cloudflare.types.intel.attack_surface_report import IssueTypeGetResponse
-```
-
-Methods:
-
-- client.intel.attack_surface_report.issue_types.get(\*, account_id) -> SyncSinglePage[IssueTypeGetResponse]
-
-### Issues
-
-Types:
-
-```python
-from cloudflare.types.intel.attack_surface_report import (
- IssueType,
- SeverityQueryParam,
- IssueListResponse,
- IssueClassResponse,
- IssueDismissResponse,
- IssueSeverityResponse,
- IssueTypeResponse,
-)
-```
-
-Methods:
-
-- client.intel.attack_surface_report.issues.list(\*, account_id, \*\*params) -> SyncV4PagePagination[Optional[IssueListResponse]]
-- client.intel.attack*surface_report.issues.class*(\*, account_id, \*\*params) -> Optional[IssueClassResponse]
-- client.intel.attack_surface_report.issues.dismiss(issue_id, \*, account_id, \*\*params) -> IssueDismissResponse
-- client.intel.attack_surface_report.issues.severity(\*, account_id, \*\*params) -> Optional[IssueSeverityResponse]
-- client.intel.attack_surface_report.issues.type(\*, account_id, \*\*params) -> Optional[IssueTypeResponse]
-
-# MagicTransit
-
-Types:
-
-```python
-from cloudflare.types.magic_transit import HealthCheck, HealthCheckRate, HealthCheckType
-```
-
-## Apps
-
-Types:
-
-```python
-from cloudflare.types.magic_transit import (
- AppCreateResponse,
- AppUpdateResponse,
- AppListResponse,
- AppDeleteResponse,
- AppEditResponse,
-)
-```
-
-Methods:
-
-- client.magic_transit.apps.create(\*, account_id, \*\*params) -> Optional[AppCreateResponse]
-- client.magic_transit.apps.update(account_app_id, \*, account_id, \*\*params) -> Optional[AppUpdateResponse]
-- client.magic_transit.apps.list(\*, account_id) -> SyncSinglePage[AppListResponse]
-- client.magic_transit.apps.delete(account_app_id, \*, account_id) -> Optional[AppDeleteResponse]
-- client.magic_transit.apps.edit(account_app_id, \*, account_id, \*\*params) -> Optional[AppEditResponse]
-
-## CfInterconnects
-
-Types:
-
-```python
-from cloudflare.types.magic_transit import (
- CfInterconnectUpdateResponse,
- CfInterconnectListResponse,
- CfInterconnectBulkUpdateResponse,
- CfInterconnectGetResponse,
-)
-```
-
-Methods:
-
-- client.magic_transit.cf_interconnects.update(cf_interconnect_id, \*, account_id, \*\*params) -> CfInterconnectUpdateResponse
-- client.magic_transit.cf_interconnects.list(\*, account_id) -> CfInterconnectListResponse
-- client.magic_transit.cf_interconnects.bulk_update(\*, account_id, \*\*params) -> CfInterconnectBulkUpdateResponse
-- client.magic_transit.cf_interconnects.get(cf_interconnect_id, \*, account_id) -> CfInterconnectGetResponse
-
-## GRETunnels
-
-Types:
-
-```python
-from cloudflare.types.magic_transit import (
- GRETunnelCreateResponse,
- GRETunnelUpdateResponse,
- GRETunnelListResponse,
- GRETunnelDeleteResponse,
- GRETunnelBulkUpdateResponse,
- GRETunnelGetResponse,
-)
-```
-
-Methods:
-
-- client.magic_transit.gre_tunnels.create(\*, account_id, \*\*params) -> GRETunnelCreateResponse
-- client.magic_transit.gre_tunnels.update(gre_tunnel_id, \*, account_id, \*\*params) -> GRETunnelUpdateResponse
-- client.magic_transit.gre_tunnels.list(\*, account_id) -> GRETunnelListResponse
-- client.magic_transit.gre_tunnels.delete(gre_tunnel_id, \*, account_id) -> GRETunnelDeleteResponse
-- client.magic_transit.gre_tunnels.bulk_update(\*, account_id, \*\*params) -> GRETunnelBulkUpdateResponse
-- client.magic_transit.gre_tunnels.get(gre_tunnel_id, \*, account_id) -> GRETunnelGetResponse
-
-## IPSECTunnels
-
-Types:
-
-```python
-from cloudflare.types.magic_transit import (
- PSKMetadata,
- IPSECTunnelCreateResponse,
- IPSECTunnelUpdateResponse,
- IPSECTunnelListResponse,
- IPSECTunnelDeleteResponse,
- IPSECTunnelBulkUpdateResponse,
- IPSECTunnelGetResponse,
- IPSECTunnelPSKGenerateResponse,
-)
-```
-
-Methods:
-
-- client.magic_transit.ipsec_tunnels.create(\*, account_id, \*\*params) -> IPSECTunnelCreateResponse
-- client.magic_transit.ipsec_tunnels.update(ipsec_tunnel_id, \*, account_id, \*\*params) -> IPSECTunnelUpdateResponse
-- client.magic_transit.ipsec_tunnels.list(\*, account_id) -> IPSECTunnelListResponse
-- client.magic_transit.ipsec_tunnels.delete(ipsec_tunnel_id, \*, account_id) -> IPSECTunnelDeleteResponse
-- client.magic_transit.ipsec_tunnels.bulk_update(\*, account_id, \*\*params) -> IPSECTunnelBulkUpdateResponse
-- client.magic_transit.ipsec_tunnels.get(ipsec_tunnel_id, \*, account_id) -> IPSECTunnelGetResponse
-- client.magic_transit.ipsec_tunnels.psk_generate(ipsec_tunnel_id, \*, account_id, \*\*params) -> IPSECTunnelPSKGenerateResponse
-
-## Routes
-
-Types:
-
-```python
-from cloudflare.types.magic_transit import (
- Scope,
- RouteCreateResponse,
- RouteUpdateResponse,
- RouteListResponse,
- RouteDeleteResponse,
- RouteBulkUpdateResponse,
- RouteEmptyResponse,
- RouteGetResponse,
-)
-```
-
-Methods:
-
-- client.magic_transit.routes.create(\*, account_id, \*\*params) -> RouteCreateResponse
-- client.magic_transit.routes.update(route_id, \*, account_id, \*\*params) -> RouteUpdateResponse
-- client.magic_transit.routes.list(\*, account_id) -> RouteListResponse
-- client.magic_transit.routes.delete(route_id, \*, account_id) -> RouteDeleteResponse
-- client.magic_transit.routes.bulk_update(\*, account_id, \*\*params) -> RouteBulkUpdateResponse
-- client.magic_transit.routes.empty(\*, account_id) -> RouteEmptyResponse
-- client.magic_transit.routes.get(route_id, \*, account_id) -> RouteGetResponse
-
-## Sites
-
-Types:
-
-```python
-from cloudflare.types.magic_transit import Site, SiteLocation
-```
-
-Methods:
-
-- client.magic_transit.sites.create(\*, account_id, \*\*params) -> Site
-- client.magic_transit.sites.update(site_id, \*, account_id, \*\*params) -> Site
-- client.magic_transit.sites.list(\*, account_id, \*\*params) -> SyncSinglePage[Site]
-- client.magic_transit.sites.delete(site_id, \*, account_id) -> Site
-- client.magic_transit.sites.edit(site_id, \*, account_id, \*\*params) -> Site
-- client.magic_transit.sites.get(site_id, \*, account_id) -> Site
-
-### ACLs
-
-Types:
-
-```python
-from cloudflare.types.magic_transit.sites import ACL, ACLConfiguration, AllowedProtocol, Subnet
-```
-
-Methods:
-
-- client.magic_transit.sites.acls.create(site_id, \*, account_id, \*\*params) -> ACL
-- client.magic_transit.sites.acls.update(acl_id, \*, account_id, site_id, \*\*params) -> ACL
-- client.magic_transit.sites.acls.list(site_id, \*, account_id) -> SyncSinglePage[ACL]
-- client.magic_transit.sites.acls.delete(acl_id, \*, account_id, site_id) -> ACL
-- client.magic_transit.sites.acls.edit(acl_id, \*, account_id, site_id, \*\*params) -> ACL
-- client.magic_transit.sites.acls.get(acl_id, \*, account_id, site_id) -> ACL
-
-### LANs
-
-Types:
-
-```python
-from cloudflare.types.magic_transit.sites import (
- DHCPRelay,
- DHCPServer,
- LAN,
- LANStaticAddressing,
- Nat,
- RoutedSubnet,
-)
-```
-
-Methods:
-
-- client.magic_transit.sites.lans.create(site_id, \*, account_id, \*\*params) -> SyncSinglePage[LAN]
-- client.magic_transit.sites.lans.update(lan_id, \*, account_id, site_id, \*\*params) -> LAN
-- client.magic_transit.sites.lans.list(site_id, \*, account_id) -> SyncSinglePage[LAN]
-- client.magic_transit.sites.lans.delete(lan_id, \*, account_id, site_id) -> LAN
-- client.magic_transit.sites.lans.edit(lan_id, \*, account_id, site_id, \*\*params) -> LAN
-- client.magic_transit.sites.lans.get(lan_id, \*, account_id, site_id) -> LAN
-
-### WANs
-
-Types:
-
-```python
-from cloudflare.types.magic_transit.sites import WAN, WANStaticAddressing
-```
-
-Methods:
-
-- client.magic_transit.sites.wans.create(site_id, \*, account_id, \*\*params) -> SyncSinglePage[WAN]
-- client.magic_transit.sites.wans.update(wan_id, \*, account_id, site_id, \*\*params) -> WAN
-- client.magic_transit.sites.wans.list(site_id, \*, account_id) -> SyncSinglePage[WAN]
-- client.magic_transit.sites.wans.delete(wan_id, \*, account_id, site_id) -> WAN
-- client.magic_transit.sites.wans.edit(wan_id, \*, account_id, site_id, \*\*params) -> WAN
-- client.magic_transit.sites.wans.get(wan_id, \*, account_id, site_id) -> WAN
-
-## Connectors
-
-Types:
-
-```python
-from cloudflare.types.magic_transit import (
- ConnectorCreateResponse,
- ConnectorUpdateResponse,
- ConnectorListResponse,
- ConnectorDeleteResponse,
- ConnectorEditResponse,
- ConnectorGetResponse,
-)
-```
-
-Methods:
-
-- client.magic_transit.connectors.create(\*, account_id, \*\*params) -> ConnectorCreateResponse
-- client.magic_transit.connectors.update(connector_id, \*, account_id, \*\*params) -> ConnectorUpdateResponse
-- client.magic_transit.connectors.list(\*, account_id) -> SyncSinglePage[ConnectorListResponse]
-- client.magic_transit.connectors.delete(connector_id, \*, account_id) -> ConnectorDeleteResponse
-- client.magic_transit.connectors.edit(connector_id, \*, account_id, \*\*params) -> ConnectorEditResponse
-- client.magic_transit.connectors.get(connector_id, \*, account_id) -> ConnectorGetResponse
-
-### Events
-
-Types:
-
-```python
-from cloudflare.types.magic_transit.connectors import EventListResponse, EventGetResponse
-```
-
-Methods:
-
-- client.magic_transit.connectors.events.list(connector_id, \*, account_id, \*\*params) -> EventListResponse
-- client.magic_transit.connectors.events.get(event_n, \*, account_id, connector_id, event_t) -> EventGetResponse
-
-#### Latest
-
-Types:
-
-```python
-from cloudflare.types.magic_transit.connectors.events import LatestListResponse
-```
-
-Methods:
-
-- client.magic_transit.connectors.events.latest.list(connector_id, \*, account_id) -> LatestListResponse
-
-### Snapshots
-
-Types:
-
-```python
-from cloudflare.types.magic_transit.connectors import SnapshotListResponse, SnapshotGetResponse
-```
-
-Methods:
-
-- client.magic_transit.connectors.snapshots.list(connector_id, \*, account_id, \*\*params) -> SnapshotListResponse
-- client.magic_transit.connectors.snapshots.get(snapshot_t, \*, account_id, connector_id) -> SnapshotGetResponse
-
-#### Latest
-
-Types:
-
-```python
-from cloudflare.types.magic_transit.connectors.snapshots import LatestListResponse
-```
-
-Methods:
-
-- client.magic_transit.connectors.snapshots.latest.list(connector_id, \*, account_id) -> LatestListResponse
-
-## PCAPs
-
-Types:
-
-```python
-from cloudflare.types.magic_transit import (
- PCAP,
- PCAPFilter,
- PCAPCreateResponse,
- PCAPListResponse,
- PCAPGetResponse,
-)
-```
-
-Methods:
-
-- client.magic_transit.pcaps.create(\*, account_id, \*\*params) -> PCAPCreateResponse
-- client.magic_transit.pcaps.list(\*, account_id) -> SyncSinglePage[PCAPListResponse]
-- client.magic_transit.pcaps.get(pcap_id, \*, account_id) -> PCAPGetResponse
-- client.magic_transit.pcaps.stop(pcap_id, \*, account_id) -> None
-
-### Ownership
-
-Types:
-
-```python
-from cloudflare.types.magic_transit.pcaps import Ownership
-```
-
-Methods:
-
-- client.magic_transit.pcaps.ownership.create(\*, account_id, \*\*params) -> Ownership
-- client.magic_transit.pcaps.ownership.delete(ownership_id, \*, account_id) -> None
-- client.magic_transit.pcaps.ownership.get(\*, account_id) -> SyncSinglePage[Ownership]
-- client.magic_transit.pcaps.ownership.validate(\*, account_id, \*\*params) -> Ownership
-
-### Download
-
-Methods:
-
-- client.magic_transit.pcaps.download.get(pcap_id, \*, account_id) -> BinaryAPIResponse
-
-# MagicNetworkMonitoring
-
-## VPCFlows
-
-### Tokens
-
-Types:
-
-```python
-from cloudflare.types.magic_network_monitoring.vpc_flows import TokenCreateResponse
-```
-
-Methods:
-
-- client.magic_network_monitoring.vpc_flows.tokens.create(\*, account_id) -> str
-
-## Configs
-
-Types:
-
-```python
-from cloudflare.types.magic_network_monitoring import Configuration
-```
-
-Methods:
-
-- client.magic_network_monitoring.configs.create(\*, account_id, \*\*params) -> Configuration
-- client.magic_network_monitoring.configs.update(\*, account_id, \*\*params) -> Configuration
-- client.magic_network_monitoring.configs.delete(\*, account_id) -> Configuration
-- client.magic_network_monitoring.configs.edit(\*, account_id, \*\*params) -> Configuration
-- client.magic_network_monitoring.configs.get(\*, account_id) -> Configuration
-
-### Full
-
-Methods:
-
-- client.magic_network_monitoring.configs.full.get(\*, account_id) -> Configuration
-
-## Rules
-
-Types:
-
-```python
-from cloudflare.types.magic_network_monitoring import MagicNetworkMonitoringRule
-```
-
-Methods:
-
-- client.magic_network_monitoring.rules.create(\*, account_id, \*\*params) -> Optional[MagicNetworkMonitoringRule]
-- client.magic_network_monitoring.rules.update(\*, account_id, \*\*params) -> Optional[MagicNetworkMonitoringRule]
-- client.magic_network_monitoring.rules.list(\*, account_id) -> SyncSinglePage[Optional[MagicNetworkMonitoringRule]]
-- client.magic_network_monitoring.rules.delete(rule_id, \*, account_id) -> Optional[MagicNetworkMonitoringRule]
-- client.magic_network_monitoring.rules.edit(rule_id, \*, account_id, \*\*params) -> Optional[MagicNetworkMonitoringRule]
-- client.magic_network_monitoring.rules.get(rule_id, \*, account_id) -> Optional[MagicNetworkMonitoringRule]
-
-### Advertisements
-
-Types:
-
-```python
-from cloudflare.types.magic_network_monitoring.rules import Advertisement
-```
-
-Methods:
-
-- client.magic_network_monitoring.rules.advertisements.edit(rule_id, \*, account_id, \*\*params) -> Optional[Advertisement]
-
-# MagicCloudNetworking
-
-## CatalogSyncs
-
-Types:
-
-```python
-from cloudflare.types.magic_cloud_networking import (
- CatalogSyncCreateResponse,
- CatalogSyncUpdateResponse,
- CatalogSyncListResponse,
- CatalogSyncDeleteResponse,
- CatalogSyncEditResponse,
- CatalogSyncGetResponse,
- CatalogSyncRefreshResponse,
-)
-```
-
-Methods:
-
-- client.magic_cloud_networking.catalog_syncs.create(\*, account_id, \*\*params) -> CatalogSyncCreateResponse
-- client.magic_cloud_networking.catalog_syncs.update(sync_id, \*, account_id, \*\*params) -> CatalogSyncUpdateResponse
-- client.magic_cloud_networking.catalog_syncs.list(\*, account_id) -> SyncSinglePage[CatalogSyncListResponse]
-- client.magic_cloud_networking.catalog_syncs.delete(sync_id, \*, account_id, \*\*params) -> CatalogSyncDeleteResponse
-- client.magic_cloud_networking.catalog_syncs.edit(sync_id, \*, account_id, \*\*params) -> CatalogSyncEditResponse
-- client.magic_cloud_networking.catalog_syncs.get(sync_id, \*, account_id) -> CatalogSyncGetResponse
-- client.magic_cloud_networking.catalog_syncs.refresh(sync_id, \*, account_id) -> str
-
-### PrebuiltPolicies
-
-Types:
-
-```python
-from cloudflare.types.magic_cloud_networking.catalog_syncs import PrebuiltPolicyListResponse
-```
-
-Methods:
-
-- client.magic_cloud_networking.catalog_syncs.prebuilt_policies.list(\*, account_id, \*\*params) -> SyncSinglePage[PrebuiltPolicyListResponse]
-
-## OnRamps
-
-Types:
-
-```python
-from cloudflare.types.magic_cloud_networking import (
- OnRampCreateResponse,
- OnRampUpdateResponse,
- OnRampListResponse,
- OnRampDeleteResponse,
- OnRampApplyResponse,
- OnRampEditResponse,
- OnRampGetResponse,
- OnRampPlanResponse,
-)
-```
-
-Methods:
-
-- client.magic_cloud_networking.on_ramps.create(\*, account_id, \*\*params) -> OnRampCreateResponse
-- client.magic_cloud_networking.on_ramps.update(onramp_id, \*, account_id, \*\*params) -> OnRampUpdateResponse
-- client.magic_cloud_networking.on_ramps.list(\*, account_id, \*\*params) -> SyncSinglePage[OnRampListResponse]
-- client.magic_cloud_networking.on_ramps.delete(onramp_id, \*, account_id, \*\*params) -> OnRampDeleteResponse
-- client.magic_cloud_networking.on_ramps.apply(onramp_id, \*, account_id) -> OnRampApplyResponse
-- client.magic_cloud_networking.on_ramps.edit(onramp_id, \*, account_id, \*\*params) -> OnRampEditResponse
-- client.magic_cloud_networking.on_ramps.export(onramp_id, \*, account_id) -> BinaryAPIResponse
-- client.magic_cloud_networking.on_ramps.get(onramp_id, \*, account_id, \*\*params) -> OnRampGetResponse
-- client.magic_cloud_networking.on_ramps.plan(onramp_id, \*, account_id) -> OnRampPlanResponse
-
-### AddressSpaces
-
-Types:
-
-```python
-from cloudflare.types.magic_cloud_networking.on_ramps import (
- AddressSpaceUpdateResponse,
- AddressSpaceListResponse,
- AddressSpaceEditResponse,
-)
-```
-
-Methods:
-
-- client.magic_cloud_networking.on_ramps.address_spaces.update(\*, account_id, \*\*params) -> AddressSpaceUpdateResponse
-- client.magic_cloud_networking.on_ramps.address_spaces.list(\*, account_id) -> AddressSpaceListResponse
-- client.magic_cloud_networking.on_ramps.address_spaces.edit(\*, account_id, \*\*params) -> AddressSpaceEditResponse
-
-## CloudIntegrations
-
-Types:
-
-```python
-from cloudflare.types.magic_cloud_networking import (
- CloudIntegrationCreateResponse,
- CloudIntegrationUpdateResponse,
- CloudIntegrationListResponse,
- CloudIntegrationDeleteResponse,
- CloudIntegrationDiscoverResponse,
- CloudIntegrationDiscoverAllResponse,
- CloudIntegrationEditResponse,
- CloudIntegrationGetResponse,
- CloudIntegrationInitialSetupResponse,
-)
-```
-
-Methods:
-
-- client.magic_cloud_networking.cloud_integrations.create(\*, account_id, \*\*params) -> CloudIntegrationCreateResponse
-- client.magic_cloud_networking.cloud_integrations.update(provider_id, \*, account_id, \*\*params) -> CloudIntegrationUpdateResponse
-- client.magic_cloud_networking.cloud_integrations.list(\*, account_id, \*\*params) -> SyncSinglePage[CloudIntegrationListResponse]
-- client.magic_cloud_networking.cloud_integrations.delete(provider_id, \*, account_id) -> CloudIntegrationDeleteResponse
-- client.magic_cloud_networking.cloud_integrations.discover(provider_id, \*, account_id, \*\*params) -> CloudIntegrationDiscoverResponse
-- client.magic_cloud_networking.cloud_integrations.discover_all(\*, account_id) -> CloudIntegrationDiscoverAllResponse
-- client.magic_cloud_networking.cloud_integrations.edit(provider_id, \*, account_id, \*\*params) -> CloudIntegrationEditResponse
-- client.magic_cloud_networking.cloud_integrations.get(provider_id, \*, account_id, \*\*params) -> CloudIntegrationGetResponse
-- client.magic_cloud_networking.cloud_integrations.initial_setup(provider_id, \*, account_id) -> CloudIntegrationInitialSetupResponse
-
-## Resources
-
-Types:
-
-```python
-from cloudflare.types.magic_cloud_networking import (
- ResourceListResponse,
- ResourceGetResponse,
- ResourcePolicyPreviewResponse,
-)
-```
-
-Methods:
-
-- client.magic_cloud_networking.resources.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[ResourceListResponse]
-- client.magic_cloud_networking.resources.export(\*, account_id, \*\*params) -> BinaryAPIResponse
-- client.magic_cloud_networking.resources.get(resource_id, \*, account_id, \*\*params) -> ResourceGetResponse
-- client.magic_cloud_networking.resources.policy_preview(\*, account_id, \*\*params) -> str
-
-# NetworkInterconnects
-
-## CNIs
-
-Types:
-
-```python
-from cloudflare.types.network_interconnects import (
- CNICreateResponse,
- CNIUpdateResponse,
- CNIListResponse,
- CNIGetResponse,
-)
-```
-
-Methods:
-
-- client.network_interconnects.cnis.create(\*, account_id, \*\*params) -> CNICreateResponse
-- client.network_interconnects.cnis.update(cni, \*, account_id, \*\*params) -> CNIUpdateResponse
-- client.network_interconnects.cnis.list(\*, account_id, \*\*params) -> CNIListResponse
-- client.network_interconnects.cnis.delete(cni, \*, account_id) -> None
-- client.network_interconnects.cnis.get(cni, \*, account_id) -> CNIGetResponse
-
-## Interconnects
-
-Types:
-
-```python
-from cloudflare.types.network_interconnects import (
- InterconnectCreateResponse,
- InterconnectListResponse,
- InterconnectGetResponse,
- InterconnectStatusResponse,
-)
-```
-
-Methods:
-
-- client.network_interconnects.interconnects.create(\*, account_id, \*\*params) -> InterconnectCreateResponse
-- client.network_interconnects.interconnects.list(\*, account_id, \*\*params) -> InterconnectListResponse
-- client.network_interconnects.interconnects.delete(icon, \*, account_id) -> None
-- client.network_interconnects.interconnects.get(icon, \*, account_id) -> InterconnectGetResponse
-- client.network_interconnects.interconnects.loa(icon, \*, account_id) -> None
-- client.network_interconnects.interconnects.status(icon, \*, account_id) -> InterconnectStatusResponse
-
-## Settings
-
-Types:
-
-```python
-from cloudflare.types.network_interconnects import SettingUpdateResponse, SettingGetResponse
-```
-
-Methods:
-
-- client.network_interconnects.settings.update(\*, account_id, \*\*params) -> SettingUpdateResponse
-- client.network_interconnects.settings.get(\*, account_id) -> SettingGetResponse
-
-## Slots
-
-Types:
-
-```python
-from cloudflare.types.network_interconnects import SlotListResponse, SlotGetResponse
-```
-
-Methods:
-
-- client.network_interconnects.slots.list(\*, account_id, \*\*params) -> SlotListResponse
-- client.network_interconnects.slots.get(slot, \*, account_id) -> SlotGetResponse
-
-# MTLSCertificates
-
-Types:
-
-```python
-from cloudflare.types.mtls_certificates import MTLSCertificate, MTLSCertificateCreateResponse
-```
-
-Methods:
-
-- client.mtls_certificates.create(\*, account_id, \*\*params) -> Optional[MTLSCertificateCreateResponse]
-- client.mtls_certificates.list(\*, account_id) -> SyncSinglePage[MTLSCertificate]
-- client.mtls_certificates.delete(mtls_certificate_id, \*, account_id) -> Optional[MTLSCertificate]
-- client.mtls_certificates.get(mtls_certificate_id, \*, account_id) -> Optional[MTLSCertificate]
-
-## Associations
-
-Types:
-
-```python
-from cloudflare.types.mtls_certificates import CertificateAsssociation
-```
-
-Methods:
-
-- client.mtls_certificates.associations.get(mtls_certificate_id, \*, account_id) -> SyncSinglePage[CertificateAsssociation]
-
-# Pages
-
-## Projects
-
-Types:
-
-```python
-from cloudflare.types.pages import Deployment, Project, Stage
-```
-
-Methods:
-
-- client.pages.projects.create(\*, account_id, \*\*params) -> Project
-- client.pages.projects.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[Project]
-- client.pages.projects.delete(project_name, \*, account_id) -> object
-- client.pages.projects.edit(project_name, \*, account_id, \*\*params) -> Project
-- client.pages.projects.get(project_name, \*, account_id) -> Project
-- client.pages.projects.purge_build_cache(project_name, \*, account_id) -> object
-
-### Deployments
-
-Methods:
-
-- client.pages.projects.deployments.create(project_name, \*, account_id, \*\*params) -> Deployment
-- client.pages.projects.deployments.list(project_name, \*, account_id, \*\*params) -> SyncV4PagePaginationArray[Deployment]
-- client.pages.projects.deployments.delete(deployment_id, \*, account_id, project_name) -> object
-- client.pages.projects.deployments.get(deployment_id, \*, account_id, project_name) -> Deployment
-- client.pages.projects.deployments.retry(deployment_id, \*, account_id, project_name) -> Deployment
-- client.pages.projects.deployments.rollback(deployment_id, \*, account_id, project_name) -> Deployment
-
-#### History
-
-##### Logs
-
-Types:
-
-```python
-from cloudflare.types.pages.projects.deployments.history import LogGetResponse
-```
-
-Methods:
-
-- client.pages.projects.deployments.history.logs.get(deployment_id, \*, account_id, project_name) -> LogGetResponse
-
-### Domains
-
-Types:
-
-```python
-from cloudflare.types.pages.projects import (
- DomainCreateResponse,
- DomainListResponse,
- DomainEditResponse,
- DomainGetResponse,
-)
-```
-
-Methods:
-
-- client.pages.projects.domains.create(project_name, \*, account_id, \*\*params) -> DomainCreateResponse
-- client.pages.projects.domains.list(project_name, \*, account_id) -> SyncSinglePage[DomainListResponse]
-- client.pages.projects.domains.delete(domain_name, \*, account_id, project_name) -> object
-- client.pages.projects.domains.edit(domain_name, \*, account_id, project_name) -> DomainEditResponse
-- client.pages.projects.domains.get(domain_name, \*, account_id, project_name) -> DomainGetResponse
-
-# Registrar
-
-## Domains
-
-Types:
-
-```python
-from cloudflare.types.registrar import Domain
-```
-
-Methods:
-
-- client.registrar.domains.update(domain_name, \*, account_id, \*\*params) -> object
-- client.registrar.domains.list(\*, account_id) -> SyncSinglePage[Domain]
-- client.registrar.domains.get(domain_name, \*, account_id) -> object
-
-# RequestTracers
-
-## Traces
-
-Types:
-
-```python
-from cloudflare.types.request_tracers import Trace, TraceItem, TraceCreateResponse
-```
-
-Methods:
-
-- client.request_tracers.traces.create(\*, account_id, \*\*params) -> Optional[TraceCreateResponse]
-
-# Rules
-
-## Lists
-
-Types:
-
-```python
-from cloudflare.types.rules import (
- Hostname,
- ListsList,
- Redirect,
- ListCreateResponse,
- ListUpdateResponse,
- ListDeleteResponse,
- ListGetResponse,
-)
-```
-
-Methods:
-
-- client.rules.lists.create(\*, account_id, \*\*params) -> ListCreateResponse
-- client.rules.lists.update(list_id, \*, account_id, \*\*params) -> ListUpdateResponse
-- client.rules.lists.list(\*, account_id) -> SyncSinglePage[ListsList]
-- client.rules.lists.delete(list_id, \*, account_id) -> ListDeleteResponse
-- client.rules.lists.get(list_id, \*, account_id) -> ListGetResponse
-
-### BulkOperations
-
-Types:
-
-```python
-from cloudflare.types.rules.lists import BulkOperationGetResponse
-```
-
-Methods:
-
-- client.rules.lists.bulk_operations.get(operation_id, \*, account_id) -> BulkOperationGetResponse
-
-### Items
-
-Types:
-
-```python
-from cloudflare.types.rules.lists import (
- ListCursor,
- ListItem,
- ItemCreateResponse,
- ItemUpdateResponse,
- ItemListResponse,
- ItemDeleteResponse,
- ItemGetResponse,
-)
-```
-
-Methods:
-
-- client.rules.lists.items.create(list_id, \*, account_id, \*\*params) -> ItemCreateResponse
-- client.rules.lists.items.update(list_id, \*, account_id, \*\*params) -> ItemUpdateResponse
-- client.rules.lists.items.list(list_id, \*, account_id, \*\*params) -> SyncCursorPaginationAfter[ItemListResponse]
-- client.rules.lists.items.delete(list_id, \*, account_id, \*\*params) -> ItemDeleteResponse
-- client.rules.lists.items.get(item_id, \*, account_id, list_id) -> ItemGetResponse
-
-# Stream
-
-Types:
-
-```python
-from cloudflare.types.stream import AllowedOrigins, Video
-```
-
-Methods:
-
-- client.stream.create(\*, account_id, \*\*params) -> None
-- client.stream.list(\*, account_id, \*\*params) -> SyncSinglePage[Video]
-- client.stream.delete(identifier, \*, account_id) -> None
-- client.stream.edit(identifier, \*, account_id, \*\*params) -> Optional[Video]
-- client.stream.get(identifier, \*, account_id) -> Optional[Video]
-
-## AudioTracks
-
-Types:
-
-```python
-from cloudflare.types.stream import Audio, AudioTrackDeleteResponse
-```
-
-Methods:
-
-- client.stream.audio_tracks.delete(audio_identifier, \*, account_id, identifier) -> str
-- client.stream.audio_tracks.copy(identifier, \*, account_id, \*\*params) -> Optional[Audio]
-- client.stream.audio_tracks.edit(audio_identifier, \*, account_id, identifier, \*\*params) -> Optional[Audio]
-- client.stream.audio_tracks.get(identifier, \*, account_id) -> SyncSinglePage[Audio]
-
-## Videos
-
-Types:
-
-```python
-from cloudflare.types.stream import VideoStorageUsageResponse
-```
-
-Methods:
-
-- client.stream.videos.storage_usage(\*, account_id, \*\*params) -> Optional[VideoStorageUsageResponse]
-
-## Clip
-
-Types:
-
-```python
-from cloudflare.types.stream import Clip
-```
-
-Methods:
-
-- client.stream.clip.create(\*, account_id, \*\*params) -> Optional[Clip]
-
-## Copy
-
-Methods:
-
-- client.stream.copy.create(\*, account_id, \*\*params) -> Optional[Video]
-
-## DirectUpload
-
-Types:
-
-```python
-from cloudflare.types.stream import DirectUploadCreateResponse
-```
-
-Methods:
-
-- client.stream.direct_upload.create(\*, account_id, \*\*params) -> Optional[DirectUploadCreateResponse]
-
-## Keys
-
-Types:
-
-```python
-from cloudflare.types.stream import Keys, KeyDeleteResponse, KeyGetResponse
-```
-
-Methods:
-
-- client.stream.keys.create(\*, account_id, \*\*params) -> Optional[Keys]
-- client.stream.keys.delete(identifier, \*, account_id) -> str
-- client.stream.keys.get(\*, account_id) -> SyncSinglePage[KeyGetResponse]
-
-## LiveInputs
-
-Types:
-
-```python
-from cloudflare.types.stream import LiveInput, LiveInputListResponse
-```
-
-Methods:
-
-- client.stream.live_inputs.create(\*, account_id, \*\*params) -> Optional[LiveInput]
-- client.stream.live_inputs.update(live_input_identifier, \*, account_id, \*\*params) -> Optional[LiveInput]
-- client.stream.live_inputs.list(\*, account_id, \*\*params) -> Optional[LiveInputListResponse]
-- client.stream.live_inputs.delete(live_input_identifier, \*, account_id) -> None
-- client.stream.live_inputs.get(live_input_identifier, \*, account_id) -> Optional[LiveInput]
-
-### Outputs
-
-Types:
-
-```python
-from cloudflare.types.stream.live_inputs import Output
-```
-
-Methods:
-
-- client.stream.live_inputs.outputs.create(live_input_identifier, \*, account_id, \*\*params) -> Optional[Output]
-- client.stream.live_inputs.outputs.update(output_identifier, \*, account_id, live_input_identifier, \*\*params) -> Optional[Output]
-- client.stream.live_inputs.outputs.list(live_input_identifier, \*, account_id) -> SyncSinglePage[Output]
-- client.stream.live_inputs.outputs.delete(output_identifier, \*, account_id, live_input_identifier) -> None
-
-## Watermarks
-
-Types:
-
-```python
-from cloudflare.types.stream import Watermark, WatermarkDeleteResponse
-```
-
-Methods:
-
-- client.stream.watermarks.create(\*, account_id, \*\*params) -> Optional[Watermark]
-- client.stream.watermarks.list(\*, account_id) -> SyncSinglePage[Watermark]
-- client.stream.watermarks.delete(identifier, \*, account_id) -> str
-- client.stream.watermarks.get(identifier, \*, account_id) -> Optional[Watermark]
-
-## Webhooks
-
-Types:
-
-```python
-from cloudflare.types.stream import WebhookDeleteResponse
-```
-
-Methods:
-
-- client.stream.webhooks.update(\*, account_id, \*\*params) -> object
-- client.stream.webhooks.delete(\*, account_id) -> str
-- client.stream.webhooks.get(\*, account_id) -> object
-
-## Captions
-
-Types:
-
-```python
-from cloudflare.types.stream import Caption
-```
-
-Methods:
-
-- client.stream.captions.get(identifier, \*, account_id) -> SyncSinglePage[Caption]
-
-### Language
-
-Types:
-
-```python
-from cloudflare.types.stream.captions import LanguageDeleteResponse
-```
-
-Methods:
-
-- client.stream.captions.language.create(language, \*, account_id, identifier) -> Optional[Caption]
-- client.stream.captions.language.update(language, \*, account_id, identifier, \*\*params) -> Optional[Caption]
-- client.stream.captions.language.delete(language, \*, account_id, identifier) -> str
-- client.stream.captions.language.get(language, \*, account_id, identifier) -> Optional[Caption]
-
-#### Vtt
-
-Types:
-
-```python
-from cloudflare.types.stream.captions.language import VttGetResponse
-```
-
-Methods:
-
-- client.stream.captions.language.vtt.get(language, \*, account_id, identifier) -> str
-
-## Downloads
-
-Types:
-
-```python
-from cloudflare.types.stream import (
- DownloadCreateResponse,
- DownloadDeleteResponse,
- DownloadGetResponse,
-)
-```
-
-Methods:
-
-- client.stream.downloads.create(identifier, \*, account_id, \*\*params) -> Optional[DownloadCreateResponse]
-- client.stream.downloads.delete(identifier, \*, account_id) -> str
-- client.stream.downloads.get(identifier, \*, account_id) -> Optional[DownloadGetResponse]
-
-## Embed
-
-Types:
-
-```python
-from cloudflare.types.stream import EmbedGetResponse
-```
-
-Methods:
-
-- client.stream.embed.get(identifier, \*, account_id) -> str
-
-## Token
-
-Types:
-
-```python
-from cloudflare.types.stream import TokenCreateResponse
-```
-
-Methods:
-
-- client.stream.token.create(identifier, \*, account_id, \*\*params) -> Optional[TokenCreateResponse]
-
-# Alerting
-
-## AvailableAlerts
-
-Types:
-
-```python
-from cloudflare.types.alerting import AvailableAlertListResponse
-```
-
-Methods:
-
-- client.alerting.available_alerts.list(\*, account_id) -> Optional[AvailableAlertListResponse]
-
-## Destinations
-
-### Eligible
-
-Types:
-
-```python
-from cloudflare.types.alerting.destinations import EligibleGetResponse
-```
-
-Methods:
-
-- client.alerting.destinations.eligible.get(\*, account_id) -> Optional[EligibleGetResponse]
-
-### Pagerduty
-
-Types:
-
-```python
-from cloudflare.types.alerting.destinations import (
- Pagerduty,
- PagerdutyCreateResponse,
- PagerdutyDeleteResponse,
- PagerdutyLinkResponse,
-)
-```
-
-Methods:
-
-- client.alerting.destinations.pagerduty.create(\*, account_id) -> Optional[PagerdutyCreateResponse]
-- client.alerting.destinations.pagerduty.delete(\*, account_id) -> PagerdutyDeleteResponse
-- client.alerting.destinations.pagerduty.get(\*, account_id) -> SyncSinglePage[Pagerduty]
-- client.alerting.destinations.pagerduty.link(token_id, \*, account_id) -> Optional[PagerdutyLinkResponse]
-
-### Webhooks
-
-Types:
-
-```python
-from cloudflare.types.alerting.destinations import (
- Webhooks,
- WebhookCreateResponse,
- WebhookUpdateResponse,
- WebhookDeleteResponse,
-)
-```
-
-Methods:
-
-- client.alerting.destinations.webhooks.create(\*, account_id, \*\*params) -> Optional[WebhookCreateResponse]
-- client.alerting.destinations.webhooks.update(webhook_id, \*, account_id, \*\*params) -> Optional[WebhookUpdateResponse]
-- client.alerting.destinations.webhooks.list(\*, account_id) -> SyncSinglePage[Webhooks]
-- client.alerting.destinations.webhooks.delete(webhook_id, \*, account_id) -> WebhookDeleteResponse
-- client.alerting.destinations.webhooks.get(webhook_id, \*, account_id) -> Optional[Webhooks]
-
-## History
-
-Types:
-
-```python
-from cloudflare.types.alerting import History
-```
-
-Methods:
-
-- client.alerting.history.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[History]
-
-## Policies
-
-Types:
-
-```python
-from cloudflare.types.alerting import (
- Mechanism,
- Policy,
- PolicyFilter,
- PolicyCreateResponse,
- PolicyUpdateResponse,
- PolicyDeleteResponse,
-)
-```
-
-Methods:
-
-- client.alerting.policies.create(\*, account_id, \*\*params) -> Optional[PolicyCreateResponse]
-- client.alerting.policies.update(policy_id, \*, account_id, \*\*params) -> Optional[PolicyUpdateResponse]
-- client.alerting.policies.list(\*, account_id) -> SyncSinglePage[Policy]
-- client.alerting.policies.delete(policy_id, \*, account_id) -> PolicyDeleteResponse
-- client.alerting.policies.get(policy_id, \*, account_id) -> Optional[Policy]
-
-## Silences
-
-Types:
-
-```python
-from cloudflare.types.alerting import (
- SilenceCreateResponse,
- SilenceUpdateResponse,
- SilenceListResponse,
- SilenceDeleteResponse,
- SilenceGetResponse,
-)
-```
-
-Methods:
-
-- client.alerting.silences.create(\*, account_id, \*\*params) -> SilenceCreateResponse
-- client.alerting.silences.update(\*, account_id, \*\*params) -> SyncSinglePage[SilenceUpdateResponse]
-- client.alerting.silences.list(\*, account_id) -> SyncSinglePage[SilenceListResponse]
-- client.alerting.silences.delete(silence_id, \*, account_id) -> SilenceDeleteResponse
-- client.alerting.silences.get(silence_id, \*, account_id) -> Optional[SilenceGetResponse]
-
-# D1
-
-Types:
-
-```python
-from cloudflare.types.d1 import D1
-```
-
-## Database
-
-Types:
-
-```python
-from cloudflare.types.d1 import (
- QueryResult,
- DatabaseListResponse,
- DatabaseExportResponse,
- DatabaseImportResponse,
- DatabaseRawResponse,
-)
-```
-
-Methods:
-
-- client.d1.database.create(\*, account_id, \*\*params) -> D1
-- client.d1.database.update(database_id, \*, account_id, \*\*params) -> D1
-- client.d1.database.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[DatabaseListResponse]
-- client.d1.database.delete(database_id, \*, account_id) -> object
-- client.d1.database.edit(database_id, \*, account_id, \*\*params) -> D1
-- client.d1.database.export(database_id, \*, account_id, \*\*params) -> DatabaseExportResponse
-- client.d1.database.get(database_id, \*, account_id) -> D1
-- client.d1.database.import\_(database_id, \*, account_id, \*\*params) -> DatabaseImportResponse
-- client.d1.database.query(database_id, \*, account_id, \*\*params) -> SyncSinglePage[QueryResult]
-- client.d1.database.raw(database_id, \*, account_id, \*\*params) -> SyncSinglePage[DatabaseRawResponse]
-
-### TimeTravel
-
-Types:
-
-```python
-from cloudflare.types.d1.database import TimeTravelGetBookmarkResponse, TimeTravelRestoreResponse
-```
-
-Methods:
-
-- client.d1.database.time_travel.get_bookmark(database_id, \*, account_id, \*\*params) -> TimeTravelGetBookmarkResponse
-- client.d1.database.time_travel.restore(database_id, \*, account_id, \*\*params) -> TimeTravelRestoreResponse
-
-# R2
-
-## Buckets
-
-Types:
-
-```python
-from cloudflare.types.r2 import Bucket, BucketListResponse
-```
-
-Methods:
-
-- client.r2.buckets.create(\*, account_id, \*\*params) -> Bucket
-- client.r2.buckets.list(\*, account_id, \*\*params) -> BucketListResponse
-- client.r2.buckets.delete(bucket_name, \*, account_id) -> object
-- client.r2.buckets.edit(bucket_name, \*, account_id) -> Bucket
-- client.r2.buckets.get(bucket_name, \*, account_id) -> Bucket
-
-### Lifecycle
-
-Types:
-
-```python
-from cloudflare.types.r2.buckets import LifecycleGetResponse
-```
-
-Methods:
-
-- client.r2.buckets.lifecycle.update(bucket_name, \*, account_id, \*\*params) -> object
-- client.r2.buckets.lifecycle.get(bucket_name, \*, account_id) -> LifecycleGetResponse
-
-### CORS
-
-Types:
-
-```python
-from cloudflare.types.r2.buckets import CORSGetResponse
-```
-
-Methods:
-
-- client.r2.buckets.cors.update(bucket_name, \*, account_id, \*\*params) -> object
-- client.r2.buckets.cors.delete(bucket_name, \*, account_id) -> object
-- client.r2.buckets.cors.get(bucket_name, \*, account_id) -> CORSGetResponse
-
-### Domains
-
-#### Custom
-
-Types:
-
-```python
-from cloudflare.types.r2.buckets.domains import (
- CustomCreateResponse,
- CustomUpdateResponse,
- CustomListResponse,
- CustomDeleteResponse,
- CustomGetResponse,
-)
-```
-
-Methods:
-
-- client.r2.buckets.domains.custom.create(bucket_name, \*, account_id, \*\*params) -> CustomCreateResponse
-- client.r2.buckets.domains.custom.update(domain, \*, account_id, bucket_name, \*\*params) -> CustomUpdateResponse
-- client.r2.buckets.domains.custom.list(bucket_name, \*, account_id) -> CustomListResponse
-- client.r2.buckets.domains.custom.delete(domain, \*, account_id, bucket_name) -> CustomDeleteResponse
-- client.r2.buckets.domains.custom.get(domain, \*, account_id, bucket_name) -> CustomGetResponse
-
-#### Managed
-
-Types:
-
-```python
-from cloudflare.types.r2.buckets.domains import ManagedUpdateResponse, ManagedListResponse
-```
-
-Methods:
-
-- client.r2.buckets.domains.managed.update(bucket_name, \*, account_id, \*\*params) -> ManagedUpdateResponse
-- client.r2.buckets.domains.managed.list(bucket_name, \*, account_id) -> ManagedListResponse
-
-### EventNotifications
-
-Types:
-
-```python
-from cloudflare.types.r2.buckets import EventNotificationListResponse, EventNotificationGetResponse
-```
-
-Methods:
-
-- client.r2.buckets.event_notifications.update(queue_id, \*, account_id, bucket_name, \*\*params) -> object
-- client.r2.buckets.event_notifications.list(bucket_name, \*, account_id) -> EventNotificationListResponse
-- client.r2.buckets.event_notifications.delete(queue_id, \*, account_id, bucket_name) -> object
-- client.r2.buckets.event_notifications.get(queue_id, \*, account_id, bucket_name) -> EventNotificationGetResponse
-
-### Locks
-
-Types:
-
-```python
-from cloudflare.types.r2.buckets import LockGetResponse
-```
-
-Methods:
-
-- client.r2.buckets.locks.update(bucket_name, \*, account_id, \*\*params) -> object
-- client.r2.buckets.locks.get(bucket_name, \*, account_id) -> LockGetResponse
-
-### Metrics
-
-Types:
-
-```python
-from cloudflare.types.r2.buckets import MetricListResponse
-```
-
-Methods:
-
-- client.r2.buckets.metrics.list(\*, account_id) -> MetricListResponse
-
-### Sippy
-
-Types:
-
-```python
-from cloudflare.types.r2.buckets import Provider, Sippy, SippyDeleteResponse
-```
-
-Methods:
-
-- client.r2.buckets.sippy.update(bucket_name, \*, account_id, \*\*params) -> Sippy
-- client.r2.buckets.sippy.delete(bucket_name, \*, account_id) -> SippyDeleteResponse
-- client.r2.buckets.sippy.get(bucket_name, \*, account_id) -> Sippy
-
-## TemporaryCredentials
-
-Types:
-
-```python
-from cloudflare.types.r2 import TemporaryCredential, TemporaryCredentialCreateResponse
-```
-
-Methods:
-
-- client.r2.temporary_credentials.create(\*, account_id, \*\*params) -> TemporaryCredentialCreateResponse
-
-## SuperSlurper
-
-### Jobs
-
-Types:
-
-```python
-from cloudflare.types.r2.super_slurper import (
- JobCreateResponse,
- JobListResponse,
- JobAbortResponse,
- JobAbortAllResponse,
- JobGetResponse,
- JobPauseResponse,
- JobProgressResponse,
- JobResumeResponse,
-)
-```
-
-Methods:
-
-- client.r2.super_slurper.jobs.create(\*, account_id, \*\*params) -> Optional[JobCreateResponse]
-- client.r2.super_slurper.jobs.list(\*, account_id, \*\*params) -> SyncSinglePage[JobListResponse]
-- client.r2.super_slurper.jobs.abort(job_id, \*, account_id) -> str
-- client.r2.super_slurper.jobs.abort_all(\*, account_id) -> str
-- client.r2.super_slurper.jobs.get(job_id, \*, account_id) -> Optional[JobGetResponse]
-- client.r2.super_slurper.jobs.pause(job_id, \*, account_id) -> str
-- client.r2.super_slurper.jobs.progress(job_id, \*, account_id) -> Optional[JobProgressResponse]
-- client.r2.super_slurper.jobs.resume(job_id, \*, account_id) -> str
-
-#### Logs
-
-Types:
-
-```python
-from cloudflare.types.r2.super_slurper.jobs import LogListResponse
-```
-
-Methods:
-
-- client.r2.super_slurper.jobs.logs.list(job_id, \*, account_id, \*\*params) -> SyncSinglePage[LogListResponse]
-
-### ConnectivityPrecheck
-
-Types:
-
-```python
-from cloudflare.types.r2.super_slurper import (
- ConnectivityPrecheckSourceResponse,
- ConnectivityPrecheckTargetResponse,
-)
-```
-
-Methods:
-
-- client.r2.super_slurper.connectivity_precheck.source(\*, account_id, \*\*params) -> Optional[ConnectivityPrecheckSourceResponse]
-- client.r2.super_slurper.connectivity_precheck.target(\*, account_id, \*\*params) -> Optional[ConnectivityPrecheckTargetResponse]
-
-# R2DataCatalog
-
-Types:
-
-```python
-from cloudflare.types.r2_data_catalog import (
- R2DataCatalogListResponse,
- R2DataCatalogEnableResponse,
- R2DataCatalogGetResponse,
-)
-```
-
-Methods:
-
-- client.r2_data_catalog.list(\*, account_id) -> Optional[R2DataCatalogListResponse]
-- client.r2_data_catalog.disable(bucket_name, \*, account_id) -> None
-- client.r2_data_catalog.enable(bucket_name, \*, account_id) -> Optional[R2DataCatalogEnableResponse]
-- client.r2_data_catalog.get(bucket_name, \*, account_id) -> Optional[R2DataCatalogGetResponse]
-
-## MaintenanceConfigs
-
-Types:
-
-```python
-from cloudflare.types.r2_data_catalog import (
- MaintenanceConfigUpdateResponse,
- MaintenanceConfigGetResponse,
-)
-```
-
-Methods:
-
-- client.r2_data_catalog.maintenance_configs.update(bucket_name, \*, account_id, \*\*params) -> Optional[MaintenanceConfigUpdateResponse]
-- client.r2_data_catalog.maintenance_configs.get(bucket_name, \*, account_id) -> Optional[MaintenanceConfigGetResponse]
-
-## Credentials
-
-Methods:
-
-- client.r2_data_catalog.credentials.create(bucket_name, \*, account_id, \*\*params) -> object
-
-## Namespaces
-
-Types:
-
-```python
-from cloudflare.types.r2_data_catalog import NamespaceListResponse
-```
-
-Methods:
-
-- client.r2_data_catalog.namespaces.list(bucket_name, \*, account_id, \*\*params) -> Optional[NamespaceListResponse]
-
-### Tables
-
-Types:
-
-```python
-from cloudflare.types.r2_data_catalog.namespaces import TableListResponse
-```
-
-Methods:
-
-- client.r2_data_catalog.namespaces.tables.list(namespace, \*, account_id, bucket_name, \*\*params) -> Optional[TableListResponse]
-
-#### MaintenanceConfigs
-
-Types:
-
-```python
-from cloudflare.types.r2_data_catalog.namespaces.tables import (
- MaintenanceConfigUpdateResponse,
- MaintenanceConfigGetResponse,
-)
-```
-
-Methods:
-
-- client.r2_data_catalog.namespaces.tables.maintenance_configs.update(table_name, \*, account_id, bucket_name, namespace, \*\*params) -> Optional[MaintenanceConfigUpdateResponse]
-- client.r2_data_catalog.namespaces.tables.maintenance_configs.get(table_name, \*, account_id, bucket_name, namespace) -> Optional[MaintenanceConfigGetResponse]
-
-# WorkersForPlatforms
-
-## Dispatch
-
-### Namespaces
-
-Types:
-
-```python
-from cloudflare.types.workers_for_platforms.dispatch import (
- NamespaceCreateResponse,
- NamespaceListResponse,
- NamespaceGetResponse,
-)
-```
-
-Methods:
-
-- client.workers_for_platforms.dispatch.namespaces.create(\*, account_id, \*\*params) -> Optional[NamespaceCreateResponse]
-- client.workers_for_platforms.dispatch.namespaces.list(\*, account_id) -> SyncSinglePage[NamespaceListResponse]
-- client.workers_for_platforms.dispatch.namespaces.delete(dispatch_namespace, \*, account_id) -> object
-- client.workers_for_platforms.dispatch.namespaces.get(dispatch_namespace, \*, account_id) -> Optional[NamespaceGetResponse]
-
-#### Scripts
-
-Types:
-
-```python
-from cloudflare.types.workers_for_platforms.dispatch.namespaces import Script, ScriptUpdateResponse
-```
-
-Methods:
-
-- client.workers_for_platforms.dispatch.namespaces.scripts.update(script_name, \*, account_id, dispatch_namespace, \*\*params) -> ScriptUpdateResponse
-- client.workers_for_platforms.dispatch.namespaces.scripts.delete(script_name, \*, account_id, dispatch_namespace, \*\*params) -> object
-- client.workers_for_platforms.dispatch.namespaces.scripts.get(script_name, \*, account_id, dispatch_namespace) -> Script
-
-##### AssetUpload
-
-Types:
-
-```python
-from cloudflare.types.workers_for_platforms.dispatch.namespaces.scripts import (
- AssetUploadCreateResponse,
-)
-```
-
-Methods:
-
-- client.workers_for_platforms.dispatch.namespaces.scripts.asset_upload.create(script_name, \*, account_id, dispatch_namespace, \*\*params) -> Optional[AssetUploadCreateResponse]
-
-##### Content
-
-Methods:
-
-- client.workers_for_platforms.dispatch.namespaces.scripts.content.update(script_name, \*, account_id, dispatch_namespace, \*\*params) -> Script
-- client.workers_for_platforms.dispatch.namespaces.scripts.content.get(script_name, \*, account_id, dispatch_namespace) -> BinaryAPIResponse
-
-##### Settings
-
-Types:
-
-```python
-from cloudflare.types.workers_for_platforms.dispatch.namespaces.scripts import (
- SettingEditResponse,
- SettingGetResponse,
-)
-```
-
-Methods:
-
-- client.workers_for_platforms.dispatch.namespaces.scripts.settings.edit(script_name, \*, account_id, dispatch_namespace, \*\*params) -> Optional[SettingEditResponse]
-- client.workers_for_platforms.dispatch.namespaces.scripts.settings.get(script_name, \*, account_id, dispatch_namespace) -> Optional[SettingGetResponse]
-
-##### Bindings
-
-Types:
-
-```python
-from cloudflare.types.workers_for_platforms.dispatch.namespaces.scripts import BindingGetResponse
-```
-
-Methods:
-
-- client.workers_for_platforms.dispatch.namespaces.scripts.bindings.get(script_name, \*, account_id, dispatch_namespace) -> SyncSinglePage[BindingGetResponse]
-
-##### Secrets
-
-Types:
-
-```python
-from cloudflare.types.workers_for_platforms.dispatch.namespaces.scripts import (
- SecretUpdateResponse,
- SecretListResponse,
- SecretGetResponse,
-)
-```
-
-Methods:
-
-- client.workers_for_platforms.dispatch.namespaces.scripts.secrets.update(script_name, \*, account_id, dispatch_namespace, \*\*params) -> SecretUpdateResponse
-- client.workers_for_platforms.dispatch.namespaces.scripts.secrets.list(script_name, \*, account_id, dispatch_namespace) -> SyncSinglePage[SecretListResponse]
-- client.workers_for_platforms.dispatch.namespaces.scripts.secrets.delete(secret_name, \*, account_id, dispatch_namespace, script_name, \*\*params) -> object
-- client.workers_for_platforms.dispatch.namespaces.scripts.secrets.get(secret_name, \*, account_id, dispatch_namespace, script_name, \*\*params) -> SecretGetResponse
-
-##### Tags
-
-Types:
-
-```python
-from cloudflare.types.workers_for_platforms.dispatch.namespaces.scripts import (
- TagUpdateResponse,
- TagListResponse,
-)
-```
-
-Methods:
-
-- client.workers_for_platforms.dispatch.namespaces.scripts.tags.update(script_name, \*, account_id, dispatch_namespace, \*\*params) -> SyncSinglePage[TagUpdateResponse]
-- client.workers_for_platforms.dispatch.namespaces.scripts.tags.list(script_name, \*, account_id, dispatch_namespace) -> SyncSinglePage[TagListResponse]
-- client.workers_for_platforms.dispatch.namespaces.scripts.tags.delete(tag, \*, account_id, dispatch_namespace, script_name) -> object
-
-# ZeroTrust
-
-## Devices
-
-Types:
-
-```python
-from cloudflare.types.zero_trust import Device, DeviceGetResponse
-```
-
-Methods:
-
-- client.zero_trust.devices.list(\*, account_id) -> SyncSinglePage[Device]
-- client.zero_trust.devices.get(device_id, \*, account_id) -> Optional[DeviceGetResponse]
-
-### Devices
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.devices import DeviceListResponse, DeviceGetResponse
-```
-
-Methods:
-
-- client.zero*trust.devices.devices.list(\*, account_id, \*\*params) -> SyncCursorPagination[DeviceListResponse]
-- client.zero*trust.devices.devices.delete(device_id, \*, account_id) -> object
-- client.zero*trust.devices.devices.get(device_id, \*, account_id, \*\*params) -> DeviceGetResponse
-- client.zero*trust.devices.devices.revoke(device_id, \*, account_id) -> object
-
-### Resilience
-
-#### GlobalWARPOverride
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.devices.resilience import (
- GlobalWARPOverrideCreateResponse,
- GlobalWARPOverrideGetResponse,
-)
-```
-
-Methods:
-
-- client.zero_trust.devices.resilience.global_warp_override.create(\*, account_id, \*\*params) -> Optional[GlobalWARPOverrideCreateResponse]
-- client.zero_trust.devices.resilience.global_warp_override.get(\*, account_id) -> Optional[GlobalWARPOverrideGetResponse]
-
-### Registrations
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.devices import RegistrationListResponse, RegistrationGetResponse
-```
-
-Methods:
-
-- client.zero_trust.devices.registrations.list(\*, account_id, \*\*params) -> SyncCursorPagination[RegistrationListResponse]
-- client.zero_trust.devices.registrations.delete(registration_id, \*, account_id) -> object
-- client.zero_trust.devices.registrations.bulk_delete(\*, account_id, \*\*params) -> object
-- client.zero_trust.devices.registrations.get(registration_id, \*, account_id, \*\*params) -> RegistrationGetResponse
-- client.zero_trust.devices.registrations.revoke(\*, account_id, \*\*params) -> object
-- client.zero_trust.devices.registrations.unrevoke(\*, account_id, \*\*params) -> object
-
-### DEXTests
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.devices import (
- SchemaData,
- SchemaHTTP,
- DEXTestCreateResponse,
- DEXTestUpdateResponse,
- DEXTestListResponse,
- DEXTestDeleteResponse,
- DEXTestGetResponse,
-)
-```
-
-Methods:
-
-- client.zero_trust.devices.dex_tests.create(\*, account_id, \*\*params) -> Optional[DEXTestCreateResponse]
-- client.zero_trust.devices.dex_tests.update(dex_test_id, \*, account_id, \*\*params) -> Optional[DEXTestUpdateResponse]
-- client.zero_trust.devices.dex_tests.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[DEXTestListResponse]
-- client.zero_trust.devices.dex_tests.delete(dex_test_id, \*, account_id) -> Optional[DEXTestDeleteResponse]
-- client.zero_trust.devices.dex_tests.get(dex_test_id, \*, account_id) -> Optional[DEXTestGetResponse]
-
-### Networks
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.devices import DeviceNetwork
-```
-
-Methods:
-
-- client.zero_trust.devices.networks.create(\*, account_id, \*\*params) -> Optional[DeviceNetwork]
-- client.zero_trust.devices.networks.update(network_id, \*, account_id, \*\*params) -> Optional[DeviceNetwork]
-- client.zero_trust.devices.networks.list(\*, account_id) -> SyncSinglePage[DeviceNetwork]
-- client.zero_trust.devices.networks.delete(network_id, \*, account_id) -> SyncSinglePage[DeviceNetwork]
-- client.zero_trust.devices.networks.get(network_id, \*, account_id) -> Optional[DeviceNetwork]
-
-### FleetStatus
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.devices import FleetStatusGetResponse
-```
-
-Methods:
-
-- client.zero_trust.devices.fleet_status.get(device_id, \*, account_id, \*\*params) -> FleetStatusGetResponse
-
-### Policies
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.devices import (
- DevicePolicyCertificates,
- FallbackDomain,
- FallbackDomainPolicy,
- SettingsPolicy,
- SplitTunnelExclude,
- SplitTunnelInclude,
-)
-```
-
-#### Default
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.devices.policies import DefaultEditResponse, DefaultGetResponse
-```
-
-Methods:
-
-- client.zero_trust.devices.policies.default.edit(\*, account_id, \*\*params) -> Optional[DefaultEditResponse]
-- client.zero_trust.devices.policies.default.get(\*, account_id) -> Optional[DefaultGetResponse]
-
-##### Excludes
-
-Methods:
-
-- client.zero_trust.devices.policies.default.excludes.update(\*, account_id, \*\*params) -> SyncSinglePage[SplitTunnelExclude]
-- client.zero_trust.devices.policies.default.excludes.get(\*, account_id) -> SyncSinglePage[SplitTunnelExclude]
-
-##### Includes
-
-Methods:
-
-- client.zero_trust.devices.policies.default.includes.update(\*, account_id, \*\*params) -> SyncSinglePage[SplitTunnelInclude]
-- client.zero_trust.devices.policies.default.includes.get(\*, account_id) -> SyncSinglePage[SplitTunnelInclude]
-
-##### FallbackDomains
-
-Methods:
-
-- client.zero_trust.devices.policies.default.fallback_domains.update(\*, account_id, \*\*params) -> SyncSinglePage[FallbackDomain]
-- client.zero_trust.devices.policies.default.fallback_domains.get(\*, account_id) -> SyncSinglePage[FallbackDomain]
-
-##### Certificates
-
-Methods:
-
-- client.zero_trust.devices.policies.default.certificates.edit(\*, zone_id, \*\*params) -> Optional[DevicePolicyCertificates]
-- client.zero_trust.devices.policies.default.certificates.get(\*, zone_id) -> Optional[DevicePolicyCertificates]
-
-#### Custom
-
-Methods:
-
-- client.zero_trust.devices.policies.custom.create(\*, account_id, \*\*params) -> Optional[SettingsPolicy]
-- client.zero_trust.devices.policies.custom.list(\*, account_id) -> SyncSinglePage[SettingsPolicy]
-- client.zero_trust.devices.policies.custom.delete(policy_id, \*, account_id) -> SyncSinglePage[SettingsPolicy]
-- client.zero_trust.devices.policies.custom.edit(policy_id, \*, account_id, \*\*params) -> Optional[SettingsPolicy]
-- client.zero_trust.devices.policies.custom.get(policy_id, \*, account_id) -> Optional[SettingsPolicy]
-
-##### Excludes
-
-Methods:
-
-- client.zero_trust.devices.policies.custom.excludes.update(policy_id, \*, account_id, \*\*params) -> SyncSinglePage[SplitTunnelExclude]
-- client.zero_trust.devices.policies.custom.excludes.get(policy_id, \*, account_id) -> SyncSinglePage[SplitTunnelExclude]
-
-##### Includes
-
-Methods:
-
-- client.zero_trust.devices.policies.custom.includes.update(policy_id, \*, account_id, \*\*params) -> SyncSinglePage[SplitTunnelInclude]
-- client.zero_trust.devices.policies.custom.includes.get(policy_id, \*, account_id) -> SyncSinglePage[SplitTunnelInclude]
-
-##### FallbackDomains
-
-Methods:
-
-- client.zero_trust.devices.policies.custom.fallback_domains.update(policy_id, \*, account_id, \*\*params) -> SyncSinglePage[FallbackDomain]
-- client.zero_trust.devices.policies.custom.fallback_domains.get(policy_id, \*, account_id) -> SyncSinglePage[FallbackDomain]
-
-### Posture
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.devices import (
- CarbonblackInput,
- ClientCertificateInput,
- CrowdstrikeInput,
- DeviceInput,
- DeviceMatch,
- DevicePostureRule,
- DiskEncryptionInput,
- DomainJoinedInput,
- FileInput,
- FirewallInput,
- IntuneInput,
- KolideInput,
- OSVersionInput,
- SentineloneInput,
- SentineloneS2sInput,
- TaniumInput,
- UniqueClientIDInput,
- WorkspaceOneInput,
- PostureDeleteResponse,
-)
-```
-
-Methods:
-
-- client.zero_trust.devices.posture.create(\*, account_id, \*\*params) -> Optional[DevicePostureRule]
-- client.zero_trust.devices.posture.update(rule_id, \*, account_id, \*\*params) -> Optional[DevicePostureRule]
-- client.zero_trust.devices.posture.list(\*, account_id) -> SyncSinglePage[DevicePostureRule]
-- client.zero_trust.devices.posture.delete(rule_id, \*, account_id) -> Optional[PostureDeleteResponse]
-- client.zero_trust.devices.posture.get(rule_id, \*, account_id) -> Optional[DevicePostureRule]
-
-#### Integrations
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.devices.posture import Integration, IntegrationDeleteResponse
-```
-
-Methods:
-
-- client.zero_trust.devices.posture.integrations.create(\*, account_id, \*\*params) -> Optional[Integration]
-- client.zero_trust.devices.posture.integrations.list(\*, account_id) -> SyncSinglePage[Integration]
-- client.zero_trust.devices.posture.integrations.delete(integration_id, \*, account_id) -> Optional[IntegrationDeleteResponse]
-- client.zero_trust.devices.posture.integrations.edit(integration_id, \*, account_id, \*\*params) -> Optional[Integration]
-- client.zero_trust.devices.posture.integrations.get(integration_id, \*, account_id) -> Optional[Integration]
-
-### Revoke
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.devices import RevokeCreateResponse
-```
-
-Methods:
-
-- client.zero_trust.devices.revoke.create(\*, account_id, \*\*params) -> Optional[RevokeCreateResponse]
-
-### Settings
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.devices import DeviceSettings
-```
-
-Methods:
-
-- client.zero_trust.devices.settings.update(\*, account_id, \*\*params) -> Optional[DeviceSettings]
-- client.zero_trust.devices.settings.delete(\*, account_id) -> Optional[DeviceSettings]
-- client.zero_trust.devices.settings.edit(\*, account_id, \*\*params) -> Optional[DeviceSettings]
-- client.zero_trust.devices.settings.get(\*, account_id) -> Optional[DeviceSettings]
-
-### Unrevoke
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.devices import UnrevokeCreateResponse
-```
-
-Methods:
-
-- client.zero_trust.devices.unrevoke.create(\*, account_id, \*\*params) -> Optional[UnrevokeCreateResponse]
-
-### OverrideCodes
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.devices import OverrideCodeGetResponse
-```
-
-Methods:
-
-- client.zero_trust.devices.override_codes.list(device_id, \*, account_id) -> SyncSinglePage[object]
-- client.zero_trust.devices.override_codes.get(registration_id, \*, account_id) -> OverrideCodeGetResponse
-
-## IdentityProviders
-
-Types:
-
-```python
-from cloudflare.types.zero_trust import (
- AzureAD,
- GenericOAuthConfig,
- IdentityProvider,
- IdentityProviderSCIMConfig,
- IdentityProviderType,
- IdentityProviderListResponse,
- IdentityProviderDeleteResponse,
-)
-```
-
-Methods:
-
-- client.zero_trust.identity_providers.create(\*, account_id, zone_id, \*\*params) -> Optional[IdentityProvider]
-- client.zero_trust.identity_providers.update(identity_provider_id, \*, account_id, zone_id, \*\*params) -> Optional[IdentityProvider]
-- client.zero_trust.identity_providers.list(\*, account_id, zone_id, \*\*params) -> SyncV4PagePaginationArray[IdentityProviderListResponse]
-- client.zero_trust.identity_providers.delete(identity_provider_id, \*, account_id, zone_id) -> Optional[IdentityProviderDeleteResponse]
-- client.zero_trust.identity_providers.get(identity_provider_id, \*, account_id, zone_id) -> Optional[IdentityProvider]
-
-### SCIM
-
-#### Groups
-
-Methods:
-
-- client.zero_trust.identity_providers.scim.groups.list(identity_provider_id, \*, account_id, \*\*params) -> SyncV4PagePaginationArray[ZeroTrustGroup]
-
-#### Users
-
-Methods:
-
-- client.zero_trust.identity_providers.scim.users.list(identity_provider_id, \*, account_id, \*\*params) -> SyncV4PagePaginationArray[AccessUser]
-
-## Organizations
-
-Types:
-
-```python
-from cloudflare.types.zero_trust import LoginDesign, Organization, OrganizationRevokeUsersResponse
-```
-
-Methods:
-
-- client.zero_trust.organizations.create(\*, account_id, zone_id, \*\*params) -> Optional[Organization]
-- client.zero_trust.organizations.update(\*, account_id, zone_id, \*\*params) -> Optional[Organization]
-- client.zero_trust.organizations.list(\*, account_id, zone_id) -> Optional[Organization]
-- client.zero_trust.organizations.revoke_users(\*, account_id, zone_id, \*\*params) -> Optional[OrganizationRevokeUsersResponse]
-
-### DOH
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.organizations import DOHUpdateResponse, DOHGetResponse
-```
-
-Methods:
-
-- client.zero_trust.organizations.doh.update(\*, account_id, \*\*params) -> Optional[DOHUpdateResponse]
-- client.zero_trust.organizations.doh.get(\*, account_id) -> Optional[DOHGetResponse]
-
-## Seats
-
-Types:
-
-```python
-from cloudflare.types.zero_trust import Seat
-```
-
-Methods:
-
-- client.zero_trust.seats.edit(\*, account_id, \*\*params) -> SyncSinglePage[Seat]
-
-## Access
-
-### AIControls
-
-#### Mcp
-
-##### Portals
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.access.ai_controls.mcp import (
- PortalCreateResponse,
- PortalUpdateResponse,
- PortalListResponse,
- PortalDeleteResponse,
- PortalReadResponse,
-)
-```
-
-Methods:
-
-- client.zero_trust.access.ai_controls.mcp.portals.create(\*, account_id, \*\*params) -> PortalCreateResponse
-- client.zero_trust.access.ai_controls.mcp.portals.update(id, \*, account_id, \*\*params) -> PortalUpdateResponse
-- client.zero_trust.access.ai_controls.mcp.portals.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[PortalListResponse]
-- client.zero_trust.access.ai_controls.mcp.portals.delete(id, \*, account_id) -> PortalDeleteResponse
-- client.zero_trust.access.ai_controls.mcp.portals.read(id, \*, account_id) -> PortalReadResponse
-
-##### Servers
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.access.ai_controls.mcp import (
- ServerCreateResponse,
- ServerUpdateResponse,
- ServerListResponse,
- ServerDeleteResponse,
- ServerReadResponse,
-)
-```
-
-Methods:
-
-- client.zero_trust.access.ai_controls.mcp.servers.create(\*, account_id, \*\*params) -> ServerCreateResponse
-- client.zero_trust.access.ai_controls.mcp.servers.update(id, \*, account_id, \*\*params) -> ServerUpdateResponse
-- client.zero_trust.access.ai_controls.mcp.servers.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[ServerListResponse]
-- client.zero_trust.access.ai_controls.mcp.servers.delete(id, \*, account_id) -> ServerDeleteResponse
-- client.zero_trust.access.ai_controls.mcp.servers.read(id, \*, account_id) -> ServerReadResponse
-- client.zero_trust.access.ai_controls.mcp.servers.sync(id, \*, account_id) -> object
-
-### GatewayCA
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.access import (
- GatewayCACreateResponse,
- GatewayCAListResponse,
- GatewayCADeleteResponse,
-)
-```
-
-Methods:
-
-- client.zero_trust.access.gateway_ca.create(\*, account_id) -> Optional[GatewayCACreateResponse]
-- client.zero_trust.access.gateway_ca.list(\*, account_id) -> SyncSinglePage[GatewayCAListResponse]
-- client.zero_trust.access.gateway_ca.delete(certificate_id, \*, account_id) -> Optional[GatewayCADeleteResponse]
-
-### Infrastructure
-
-#### Targets
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.access.infrastructure import (
- TargetCreateResponse,
- TargetUpdateResponse,
- TargetListResponse,
- TargetBulkUpdateResponse,
- TargetGetResponse,
-)
-```
-
-Methods:
-
-- client.zero_trust.access.infrastructure.targets.create(\*, account_id, \*\*params) -> Optional[TargetCreateResponse]
-- client.zero_trust.access.infrastructure.targets.update(target_id, \*, account_id, \*\*params) -> Optional[TargetUpdateResponse]
-- client.zero_trust.access.infrastructure.targets.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[TargetListResponse]
-- client.zero_trust.access.infrastructure.targets.delete(target_id, \*, account_id) -> None
-- client.zero_trust.access.infrastructure.targets.bulk_delete(\*, account_id) -> None
-- client.zero_trust.access.infrastructure.targets.bulk_delete_v2(\*, account_id, \*\*params) -> None
-- client.zero_trust.access.infrastructure.targets.bulk_update(\*, account_id, \*\*params) -> SyncSinglePage[TargetBulkUpdateResponse]
-- client.zero_trust.access.infrastructure.targets.get(target_id, \*, account_id) -> Optional[TargetGetResponse]
-
-### Applications
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.access import (
- AllowedHeaders,
- AllowedIdPs,
- AllowedMethods,
- AllowedOrigins,
- AppID,
- Application,
- ApplicationPolicy,
- ApplicationSCIMConfig,
- ApplicationType,
- CORSHeaders,
- Decision,
- OIDCSaaSApp,
- SaaSAppNameIDFormat,
- SAMLSaaSApp,
- SCIMConfigAuthenticationHTTPBasic,
- SCIMConfigAuthenticationOAuthBearerToken,
- SCIMConfigAuthenticationOauth2,
- SCIMConfigMapping,
- SelfHostedDomains,
- ApplicationCreateResponse,
- ApplicationUpdateResponse,
- ApplicationListResponse,
- ApplicationDeleteResponse,
- ApplicationGetResponse,
-)
-```
-
-Methods:
-
-- client.zero_trust.access.applications.create(\*, account_id, zone_id, \*\*params) -> Optional[ApplicationCreateResponse]
-- client.zero_trust.access.applications.update(app_id, \*, account_id, zone_id, \*\*params) -> Optional[ApplicationUpdateResponse]
-- client.zero_trust.access.applications.list(\*, account_id, zone_id, \*\*params) -> SyncV4PagePaginationArray[ApplicationListResponse]
-- client.zero_trust.access.applications.delete(app_id, \*, account_id, zone_id) -> Optional[ApplicationDeleteResponse]
-- client.zero_trust.access.applications.get(app_id, \*, account_id, zone_id) -> Optional[ApplicationGetResponse]
-- client.zero_trust.access.applications.revoke_tokens(app_id, \*, account_id, zone_id) -> object
-
-#### CAs
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.access.applications import CA, CADeleteResponse
-```
-
-Methods:
-
-- client.zero_trust.access.applications.cas.create(app_id, \*, account_id, zone_id) -> Optional[CA]
-- client.zero_trust.access.applications.cas.list(\*, account_id, zone_id, \*\*params) -> SyncV4PagePaginationArray[CA]
-- client.zero_trust.access.applications.cas.delete(app_id, \*, account_id, zone_id) -> Optional[CADeleteResponse]
-- client.zero_trust.access.applications.cas.get(app_id, \*, account_id, zone_id) -> Optional[CA]
-
-#### UserPolicyChecks
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.access.applications import (
- UserPolicyCheckGeo,
- UserPolicyCheckListResponse,
-)
-```
-
-Methods:
-
-- client.zero_trust.access.applications.user_policy_checks.list(app_id, \*, account_id, zone_id) -> Optional[UserPolicyCheckListResponse]
-
-#### Policies
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.access.applications import (
- AccessDevicePostureRule,
- AccessRule,
- AnyValidServiceTokenRule,
- AuthenticationMethodRule,
- AzureGroupRule,
- CertificateRule,
- CountryRule,
- DomainRule,
- EmailListRule,
- EmailRule,
- EveryoneRule,
- ExternalEvaluationRule,
- GitHubOrganizationRule,
- GroupRule,
- GSuiteGroupRule,
- IPListRule,
- IPRule,
- OktaGroupRule,
- SAMLGroupRule,
- ServiceTokenRule,
- PolicyCreateResponse,
- PolicyUpdateResponse,
- PolicyListResponse,
- PolicyDeleteResponse,
- PolicyGetResponse,
-)
-```
-
-Methods:
-
-- client.zero_trust.access.applications.policies.create(app_id, \*, account_id, zone_id, \*\*params) -> Optional[PolicyCreateResponse]
-- client.zero_trust.access.applications.policies.update(policy_id, \*, app_id, account_id, zone_id, \*\*params) -> Optional[PolicyUpdateResponse]
-- client.zero_trust.access.applications.policies.list(app_id, \*, account_id, zone_id, \*\*params) -> SyncV4PagePaginationArray[PolicyListResponse]
-- client.zero_trust.access.applications.policies.delete(policy_id, \*, app_id, account_id, zone_id) -> Optional[PolicyDeleteResponse]
-- client.zero_trust.access.applications.policies.get(policy_id, \*, app_id, account_id, zone_id) -> Optional[PolicyGetResponse]
-
-#### PolicyTests
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.access.applications import (
- PolicyTestCreateResponse,
- PolicyTestGetResponse,
-)
-```
-
-Methods:
-
-- client.zero_trust.access.applications.policy_tests.create(\*, account_id, \*\*params) -> Optional[PolicyTestCreateResponse]
-- client.zero_trust.access.applications.policy_tests.get(policy_test_id, \*, account_id) -> Optional[PolicyTestGetResponse]
-
-##### Users
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.access.applications.policy_tests import UserListResponse
-```
-
-Methods:
-
-- client.zero_trust.access.applications.policy_tests.users.list(policy_test_id, \*, account_id, \*\*params) -> SyncV4PagePaginationArray[UserListResponse]
-
-#### Settings
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.access.applications import (
- SettingUpdateResponse,
- SettingEditResponse,
-)
-```
-
-Methods:
-
-- client.zero_trust.access.applications.settings.update(app_id, \*, account_id, zone_id, \*\*params) -> Optional[SettingUpdateResponse]
-- client.zero_trust.access.applications.settings.edit(app_id, \*, account_id, zone_id, \*\*params) -> Optional[SettingEditResponse]
-
-### Certificates
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.access import (
- AssociatedHostnames,
- Certificate,
- CertificateDeleteResponse,
-)
-```
-
-Methods:
-
-- client.zero_trust.access.certificates.create(\*, account_id, zone_id, \*\*params) -> Optional[Certificate]
-- client.zero_trust.access.certificates.update(certificate_id, \*, account_id, zone_id, \*\*params) -> Optional[Certificate]
-- client.zero_trust.access.certificates.list(\*, account_id, zone_id, \*\*params) -> SyncV4PagePaginationArray[Certificate]
-- client.zero_trust.access.certificates.delete(certificate_id, \*, account_id, zone_id) -> Optional[CertificateDeleteResponse]
-- client.zero_trust.access.certificates.get(certificate_id, \*, account_id, zone_id) -> Optional[Certificate]
-
-#### Settings
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.access.certificates import CertificateSettings
-```
-
-Methods:
-
-- client.zero_trust.access.certificates.settings.update(\*, account_id, zone_id, \*\*params) -> SyncSinglePage[CertificateSettings]
-- client.zero_trust.access.certificates.settings.get(\*, account_id, zone_id) -> SyncSinglePage[CertificateSettings]
-
-### Groups
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.access import (
- ZeroTrustGroup,
- GroupCreateResponse,
- GroupUpdateResponse,
- GroupListResponse,
- GroupDeleteResponse,
- GroupGetResponse,
-)
-```
-
-Methods:
-
-- client.zero_trust.access.groups.create(\*, account_id, zone_id, \*\*params) -> Optional[GroupCreateResponse]
-- client.zero_trust.access.groups.update(group_id, \*, account_id, zone_id, \*\*params) -> Optional[GroupUpdateResponse]
-- client.zero_trust.access.groups.list(\*, account_id, zone_id, \*\*params) -> SyncV4PagePaginationArray[GroupListResponse]
-- client.zero_trust.access.groups.delete(group_id, \*, account_id, zone_id) -> Optional[GroupDeleteResponse]
-- client.zero_trust.access.groups.get(group_id, \*, account_id, zone_id) -> Optional[GroupGetResponse]
-
-### ServiceTokens
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.access import (
- ServiceToken,
- ServiceTokenCreateResponse,
- ServiceTokenRotateResponse,
-)
-```
-
-Methods:
-
-- client.zero_trust.access.service_tokens.create(\*, account_id, zone_id, \*\*params) -> Optional[ServiceTokenCreateResponse]
-- client.zero_trust.access.service_tokens.update(service_token_id, \*, account_id, zone_id, \*\*params) -> Optional[ServiceToken]
-- client.zero_trust.access.service_tokens.list(\*, account_id, zone_id, \*\*params) -> SyncV4PagePaginationArray[ServiceToken]
-- client.zero_trust.access.service_tokens.delete(service_token_id, \*, account_id, zone_id) -> Optional[ServiceToken]
-- client.zero_trust.access.service_tokens.get(service_token_id, \*, account_id, zone_id) -> Optional[ServiceToken]
-- client.zero_trust.access.service_tokens.refresh(service_token_id, \*, account_id) -> Optional[ServiceToken]
-- client.zero_trust.access.service_tokens.rotate(service_token_id, \*, account_id, \*\*params) -> Optional[ServiceTokenRotateResponse]
-
-### Bookmarks
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.access import Bookmark, BookmarkDeleteResponse
-```
-
-Methods:
-
-- client.zero_trust.access.bookmarks.create(bookmark_id, \*, account_id, \*\*params) -> Optional[Bookmark]
-- client.zero_trust.access.bookmarks.update(bookmark_id, \*, account_id, \*\*params) -> Optional[Bookmark]
-- client.zero_trust.access.bookmarks.list(\*, account_id) -> SyncSinglePage[Bookmark]
-- client.zero_trust.access.bookmarks.delete(bookmark_id, \*, account_id) -> Optional[BookmarkDeleteResponse]
-- client.zero_trust.access.bookmarks.get(bookmark_id, \*, account_id) -> Optional[Bookmark]
-
-### Keys
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.access import KeyUpdateResponse, KeyGetResponse, KeyRotateResponse
-```
-
-Methods:
-
-- client.zero_trust.access.keys.update(\*, account_id, \*\*params) -> Optional[KeyUpdateResponse]
-- client.zero_trust.access.keys.get(\*, account_id) -> Optional[KeyGetResponse]
-- client.zero_trust.access.keys.rotate(\*, account_id) -> Optional[KeyRotateResponse]
-
-### Logs
-
-#### AccessRequests
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.access.logs import AccessRequestListResponse
-```
-
-Methods:
-
-- client.zero_trust.access.logs.access_requests.list(\*, account_id, \*\*params) -> Optional[AccessRequestListResponse]
-
-#### SCIM
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.access.logs import AccessRequest
-```
-
-##### Updates
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.access.logs.scim import UpdateListResponse
-```
-
-Methods:
-
-- client.zero_trust.access.logs.scim.updates.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[UpdateListResponse]
-
-### Users
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.access import AccessUser, UserListResponse
-```
-
-Methods:
-
-- client.zero_trust.access.users.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[UserListResponse]
-
-#### ActiveSessions
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.access.users import (
- ActiveSessionListResponse,
- ActiveSessionGetResponse,
-)
-```
-
-Methods:
-
-- client.zero_trust.access.users.active_sessions.list(user_id, \*, account_id) -> SyncSinglePage[ActiveSessionListResponse]
-- client.zero_trust.access.users.active_sessions.get(nonce, \*, account_id, user_id) -> Optional[ActiveSessionGetResponse]
-
-#### LastSeenIdentity
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.access.users import Identity
-```
-
-Methods:
-
-- client.zero_trust.access.users.last_seen_identity.get(user_id, \*, account_id) -> Optional[Identity]
-
-#### FailedLogins
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.access.users import FailedLoginListResponse
-```
-
-Methods:
-
-- client.zero_trust.access.users.failed_logins.list(user_id, \*, account_id) -> SyncSinglePage[FailedLoginListResponse]
-
-### CustomPages
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.access import (
- CustomPage,
- CustomPageWithoutHTML,
- CustomPageDeleteResponse,
-)
-```
-
-Methods:
-
-- client.zero_trust.access.custom_pages.create(\*, account_id, \*\*params) -> Optional[CustomPageWithoutHTML]
-- client.zero_trust.access.custom_pages.update(custom_page_id, \*, account_id, \*\*params) -> Optional[CustomPageWithoutHTML]
-- client.zero_trust.access.custom_pages.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[CustomPageWithoutHTML]
-- client.zero_trust.access.custom_pages.delete(custom_page_id, \*, account_id) -> Optional[CustomPageDeleteResponse]
-- client.zero_trust.access.custom_pages.get(custom_page_id, \*, account_id) -> Optional[CustomPage]
-
-### Tags
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.access import Tag, TagDeleteResponse
-```
-
-Methods:
-
-- client.zero_trust.access.tags.create(\*, account_id, \*\*params) -> Optional[Tag]
-- client.zero_trust.access.tags.update(tag_name, \*, account_id, \*\*params) -> Optional[Tag]
-- client.zero_trust.access.tags.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[Tag]
-- client.zero_trust.access.tags.delete(tag_name, \*, account_id) -> Optional[TagDeleteResponse]
-- client.zero_trust.access.tags.get(tag_name, \*, account_id) -> Optional[Tag]
-
-### Policies
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.access import (
- ApprovalGroup,
- Policy,
- PolicyCreateResponse,
- PolicyUpdateResponse,
- PolicyListResponse,
- PolicyDeleteResponse,
- PolicyGetResponse,
-)
-```
-
-Methods:
-
-- client.zero_trust.access.policies.create(\*, account_id, \*\*params) -> Optional[PolicyCreateResponse]
-- client.zero_trust.access.policies.update(policy_id, \*, account_id, \*\*params) -> Optional[PolicyUpdateResponse]
-- client.zero_trust.access.policies.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[PolicyListResponse]
-- client.zero_trust.access.policies.delete(policy_id, \*, account_id) -> Optional[PolicyDeleteResponse]
-- client.zero_trust.access.policies.get(policy_id, \*, account_id) -> Optional[PolicyGetResponse]
-
-## DEX
-
-Types:
-
-```python
-from cloudflare.types.zero_trust import (
- DigitalExperienceMonitor,
- NetworkPath,
- NetworkPathResponse,
- Percentiles,
-)
-```
-
-### WARPChangeEvents
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.dex import WARPChangeEventGetResponse
-```
-
-Methods:
-
-- client.zero_trust.dex.warp_change_events.get(\*, account_id, \*\*params) -> Optional[WARPChangeEventGetResponse]
-
-### Commands
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.dex import CommandCreateResponse, CommandListResponse
-```
-
-Methods:
-
-- client.zero_trust.dex.commands.create(\*, account_id, \*\*params) -> Optional[CommandCreateResponse]
-- client.zero_trust.dex.commands.list(\*, account_id, \*\*params) -> SyncV4PagePagination[Optional[CommandListResponse]]
-
-#### Devices
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.dex.commands import DeviceListResponse
-```
-
-Methods:
-
-- client.zero_trust.dex.commands.devices.list(\*, account_id, \*\*params) -> SyncV4PagePagination[Optional[DeviceListResponse]]
-
-#### Downloads
-
-Methods:
-
-- client.zero_trust.dex.commands.downloads.get(filename, \*, account_id, command_id) -> BinaryAPIResponse
-
-#### Quota
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.dex.commands import QuotaGetResponse
-```
-
-Methods:
-
-- client.zero_trust.dex.commands.quota.get(\*, account_id) -> Optional[QuotaGetResponse]
-
-### Colos
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.dex import ColoListResponse
-```
-
-Methods:
-
-- client.zero_trust.dex.colos.list(\*, account_id, \*\*params) -> SyncSinglePage[ColoListResponse]
-
-### FleetStatus
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.dex import (
- LiveStat,
- FleetStatusLiveResponse,
- FleetStatusOverTimeResponse,
-)
-```
-
-Methods:
-
-- client.zero_trust.dex.fleet_status.live(\*, account_id, \*\*params) -> Optional[FleetStatusLiveResponse]
-- client.zero_trust.dex.fleet_status.over_time(\*, account_id, \*\*params) -> Optional[FleetStatusOverTimeResponse]
-
-#### Devices
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.dex.fleet_status import DeviceListResponse
-```
-
-Methods:
-
-- client.zero_trust.dex.fleet_status.devices.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[DeviceListResponse]
-
-### HTTPTests
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.dex import HTTPDetails
-```
-
-Methods:
-
-- client.zero_trust.dex.http_tests.get(test_id, \*, account_id, \*\*params) -> Optional[HTTPDetails]
-
-#### Percentiles
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.dex.http_tests import HTTPDetailsPercentiles, TestStatOverTime
-```
-
-Methods:
-
-- client.zero_trust.dex.http_tests.percentiles.get(test_id, \*, account_id, \*\*params) -> Optional[HTTPDetailsPercentiles]
-
-### Tests
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.dex import AggregateTimePeriod, Tests
-```
-
-Methods:
-
-- client.zero_trust.dex.tests.list(\*, account_id, \*\*params) -> SyncV4PagePagination[Optional[Tests]]
-
-#### UniqueDevices
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.dex.tests import UniqueDevices
-```
-
-Methods:
-
-- client.zero_trust.dex.tests.unique_devices.list(\*, account_id, \*\*params) -> Optional[UniqueDevices]
-
-### TracerouteTestResults
-
-#### NetworkPath
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.dex.traceroute_test_results import NetworkPathGetResponse
-```
-
-Methods:
-
-- client.zero_trust.dex.traceroute_test_results.network_path.get(test_result_id, \*, account_id) -> Optional[NetworkPathGetResponse]
-
-### TracerouteTests
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.dex import Traceroute, TracerouteTestPercentilesResponse
-```
-
-Methods:
-
-- client.zero_trust.dex.traceroute_tests.get(test_id, \*, account_id, \*\*params) -> Optional[Traceroute]
-- client.zero_trust.dex.traceroute_tests.network_path(test_id, \*, account_id, \*\*params) -> Optional[NetworkPathResponse]
-- client.zero_trust.dex.traceroute_tests.percentiles(test_id, \*, account_id, \*\*params) -> Optional[TracerouteTestPercentilesResponse]
-
-## Tunnels
-
-Types:
-
-```python
-from cloudflare.types.zero_trust import Connection, TunnelListResponse
-```
-
-Methods:
-
-- client.zero_trust.tunnels.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[TunnelListResponse]
-
-### Cloudflared
-
-Methods:
-
-- client.zero_trust.tunnels.cloudflared.create(\*, account_id, \*\*params) -> CloudflareTunnel
-- client.zero_trust.tunnels.cloudflared.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[CloudflareTunnel]
-- client.zero_trust.tunnels.cloudflared.delete(tunnel_id, \*, account_id) -> CloudflareTunnel
-- client.zero_trust.tunnels.cloudflared.edit(tunnel_id, \*, account_id, \*\*params) -> CloudflareTunnel
-- client.zero_trust.tunnels.cloudflared.get(tunnel_id, \*, account_id) -> CloudflareTunnel
-
-#### Configurations
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.tunnels.cloudflared import (
- ConfigurationUpdateResponse,
- ConfigurationGetResponse,
-)
-```
-
-Methods:
-
-- client.zero_trust.tunnels.cloudflared.configurations.update(tunnel_id, \*, account_id, \*\*params) -> Optional[ConfigurationUpdateResponse]
-- client.zero_trust.tunnels.cloudflared.configurations.get(tunnel_id, \*, account_id) -> Optional[ConfigurationGetResponse]
-
-#### Connections
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.tunnels.cloudflared import Client
-```
-
-Methods:
-
-- client.zero_trust.tunnels.cloudflared.connections.delete(tunnel_id, \*, account_id, \*\*params) -> object
-- client.zero_trust.tunnels.cloudflared.connections.get(tunnel_id, \*, account_id) -> SyncSinglePage[Client]
-
-#### Token
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.tunnels.cloudflared import TokenGetResponse
-```
-
-Methods:
-
-- client.zero_trust.tunnels.cloudflared.token.get(tunnel_id, \*, account_id) -> str
-
-#### Connectors
-
-Methods:
-
-- client.zero_trust.tunnels.cloudflared.connectors.get(connector_id, \*, account_id, tunnel_id) -> Client
-
-#### Management
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.tunnels.cloudflared import ManagementCreateResponse
-```
-
-Methods:
-
-- client.zero_trust.tunnels.cloudflared.management.create(tunnel_id, \*, account_id, \*\*params) -> str
-
-### WARPConnector
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.tunnels import (
- WARPConnectorCreateResponse,
- WARPConnectorListResponse,
- WARPConnectorDeleteResponse,
- WARPConnectorEditResponse,
- WARPConnectorGetResponse,
-)
-```
-
-Methods:
-
-- client.zero_trust.tunnels.warp_connector.create(\*, account_id, \*\*params) -> WARPConnectorCreateResponse
-- client.zero_trust.tunnels.warp_connector.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[WARPConnectorListResponse]
-- client.zero_trust.tunnels.warp_connector.delete(tunnel_id, \*, account_id) -> WARPConnectorDeleteResponse
-- client.zero_trust.tunnels.warp_connector.edit(tunnel_id, \*, account_id, \*\*params) -> WARPConnectorEditResponse
-- client.zero_trust.tunnels.warp_connector.get(tunnel_id, \*, account_id) -> WARPConnectorGetResponse
-
-#### Token
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.tunnels.warp_connector import TokenGetResponse
-```
-
-Methods:
-
-- client.zero_trust.tunnels.warp_connector.token.get(tunnel_id, \*, account_id) -> str
-
-## ConnectivitySettings
-
-Types:
-
-```python
-from cloudflare.types.zero_trust import (
- ConnectivitySettingEditResponse,
- ConnectivitySettingGetResponse,
-)
-```
-
-Methods:
-
-- client.zero_trust.connectivity_settings.edit(\*, account_id, \*\*params) -> ConnectivitySettingEditResponse
-- client.zero_trust.connectivity_settings.get(\*, account_id) -> ConnectivitySettingGetResponse
-
-## DLP
-
-### Datasets
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.dlp import (
- Dataset,
- DatasetArray,
- DatasetCreation,
- DatasetCreateResponse,
- DatasetUpdateResponse,
- DatasetGetResponse,
-)
-```
-
-Methods:
-
-- client.zero_trust.dlp.datasets.create(\*, account_id, \*\*params) -> Optional[DatasetCreateResponse]
-- client.zero_trust.dlp.datasets.update(dataset_id, \*, account_id, \*\*params) -> Optional[DatasetUpdateResponse]
-- client.zero_trust.dlp.datasets.list(\*, account_id) -> SyncSinglePage[Dataset]
-- client.zero_trust.dlp.datasets.delete(dataset_id, \*, account_id) -> None
-- client.zero_trust.dlp.datasets.get(dataset_id, \*, account_id) -> Optional[DatasetGetResponse]
-
-#### Upload
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.dlp.datasets import (
- NewVersion,
- UploadCreateResponse,
- UploadEditResponse,
-)
-```
-
-Methods:
-
-- client.zero_trust.dlp.datasets.upload.create(dataset_id, \*, account_id) -> Optional[UploadCreateResponse]
-- client.zero_trust.dlp.datasets.upload.edit(version, dataset, \*, account_id, dataset_id, \*\*params) -> Optional[UploadEditResponse]
-
-#### Versions
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.dlp.datasets import VersionCreateResponse
-```
-
-Methods:
-
-- client.zero_trust.dlp.datasets.versions.create(version, \*, account_id, dataset_id, \*\*params) -> SyncSinglePage[VersionCreateResponse]
-
-##### Entries
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.dlp.datasets.versions import EntryCreateResponse
-```
-
-Methods:
-
-- client.zero_trust.dlp.datasets.versions.entries.create(entry_id, dataset_version_entry, \*, account_id, dataset_id, version, \*\*params) -> Optional[EntryCreateResponse]
-
-### Patterns
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.dlp import PatternValidateResponse
-```
-
-Methods:
-
-- client.zero_trust.dlp.patterns.validate(\*, account_id, \*\*params) -> Optional[PatternValidateResponse]
-
-### PayloadLogs
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.dlp import PayloadLogUpdateResponse, PayloadLogGetResponse
-```
-
-Methods:
-
-- client.zero_trust.dlp.payload_logs.update(\*, account_id, \*\*params) -> Optional[PayloadLogUpdateResponse]
-- client.zero_trust.dlp.payload_logs.get(\*, account_id) -> Optional[PayloadLogGetResponse]
-
-### Email
-
-#### AccountMapping
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.dlp.email import (
- AccountMappingCreateResponse,
- AccountMappingGetResponse,
-)
-```
-
-Methods:
-
-- client.zero_trust.dlp.email.account_mapping.create(\*, account_id, \*\*params) -> Optional[AccountMappingCreateResponse]
-- client.zero_trust.dlp.email.account_mapping.get(\*, account_id) -> Optional[AccountMappingGetResponse]
-
-#### Rules
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.dlp.email import (
- RuleCreateResponse,
- RuleUpdateResponse,
- RuleListResponse,
- RuleDeleteResponse,
- RuleBulkEditResponse,
- RuleGetResponse,
-)
-```
-
-Methods:
-
-- client.zero_trust.dlp.email.rules.create(\*, account_id, \*\*params) -> Optional[RuleCreateResponse]
-- client.zero_trust.dlp.email.rules.update(rule_id, \*, account_id, \*\*params) -> Optional[RuleUpdateResponse]
-- client.zero_trust.dlp.email.rules.list(\*, account_id) -> SyncSinglePage[RuleListResponse]
-- client.zero_trust.dlp.email.rules.delete(rule_id, \*, account_id) -> Optional[RuleDeleteResponse]
-- client.zero_trust.dlp.email.rules.bulk_edit(\*, account_id, \*\*params) -> Optional[RuleBulkEditResponse]
-- client.zero_trust.dlp.email.rules.get(rule_id, \*, account_id) -> Optional[RuleGetResponse]
-
-### Profiles
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.dlp import (
- ContextAwareness,
- Profile,
- SkipConfiguration,
- ProfileGetResponse,
-)
-```
-
-Methods:
-
-- client.zero_trust.dlp.profiles.list(\*, account_id, \*\*params) -> SyncSinglePage[Profile]
-- client.zero_trust.dlp.profiles.get(profile_id, \*, account_id) -> Optional[ProfileGetResponse]
-
-#### Custom
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.dlp.profiles import (
- CustomProfile,
- Pattern,
- CustomCreateResponse,
- CustomUpdateResponse,
- CustomGetResponse,
-)
-```
-
-Methods:
-
-- client.zero_trust.dlp.profiles.custom.create(\*, account_id, \*\*params) -> Optional[CustomCreateResponse]
-- client.zero_trust.dlp.profiles.custom.update(profile_id, \*, account_id, \*\*params) -> Optional[CustomUpdateResponse]
-- client.zero_trust.dlp.profiles.custom.delete(profile_id, \*, account_id) -> object
-- client.zero_trust.dlp.profiles.custom.get(profile_id, \*, account_id) -> Optional[CustomGetResponse]
-
-#### Predefined
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.dlp.profiles import (
- PredefinedProfile,
- PredefinedUpdateResponse,
- PredefinedGetResponse,
-)
-```
-
-Methods:
-
-- client.zero_trust.dlp.profiles.predefined.update(profile_id, \*, account_id, \*\*params) -> Optional[PredefinedUpdateResponse]
-- client.zero_trust.dlp.profiles.predefined.delete(profile_id, \*, account_id) -> object
-- client.zero_trust.dlp.profiles.predefined.get(profile_id, \*, account_id) -> Optional[PredefinedGetResponse]
-
-### Limits
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.dlp import LimitListResponse
-```
-
-Methods:
-
-- client.zero_trust.dlp.limits.list(\*, account_id) -> Optional[LimitListResponse]
-
-### Entries
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.dlp import (
- EntryCreateResponse,
- EntryUpdateResponse,
- EntryListResponse,
- EntryGetResponse,
-)
-```
-
-Methods:
-
-- client.zero_trust.dlp.entries.create(\*, account_id, \*\*params) -> Optional[EntryCreateResponse]
-- client.zero_trust.dlp.entries.update(entry_id, \*, account_id, \*\*params) -> Optional[EntryUpdateResponse]
-- client.zero_trust.dlp.entries.list(\*, account_id) -> SyncSinglePage[EntryListResponse]
-- client.zero_trust.dlp.entries.delete(entry_id, \*, account_id) -> object
-- client.zero_trust.dlp.entries.get(entry_id, \*, account_id) -> Optional[EntryGetResponse]
-
-#### Custom
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.dlp.entries import (
- CustomCreateResponse,
- CustomUpdateResponse,
- CustomListResponse,
- CustomGetResponse,
-)
-```
-
-Methods:
-
-- client.zero_trust.dlp.entries.custom.create(\*, account_id, \*\*params) -> Optional[CustomCreateResponse]
-- client.zero_trust.dlp.entries.custom.update(entry_id, \*, account_id, \*\*params) -> Optional[CustomUpdateResponse]
-- client.zero_trust.dlp.entries.custom.list(\*, account_id) -> SyncSinglePage[CustomListResponse]
-- client.zero_trust.dlp.entries.custom.delete(entry_id, \*, account_id) -> object
-- client.zero_trust.dlp.entries.custom.get(entry_id, \*, account_id) -> Optional[CustomGetResponse]
-
-#### Predefined
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.dlp.entries import (
- PredefinedCreateResponse,
- PredefinedUpdateResponse,
- PredefinedListResponse,
- PredefinedGetResponse,
-)
-```
-
-Methods:
-
-- client.zero_trust.dlp.entries.predefined.create(\*, account_id, \*\*params) -> Optional[PredefinedCreateResponse]
-- client.zero_trust.dlp.entries.predefined.update(entry_id, \*, account_id, \*\*params) -> Optional[PredefinedUpdateResponse]
-- client.zero_trust.dlp.entries.predefined.list(\*, account_id) -> SyncSinglePage[PredefinedListResponse]
-- client.zero_trust.dlp.entries.predefined.delete(entry_id, \*, account_id) -> object
-- client.zero_trust.dlp.entries.predefined.get(entry_id, \*, account_id) -> Optional[PredefinedGetResponse]
-
-#### Integration
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.dlp.entries import (
- IntegrationCreateResponse,
- IntegrationUpdateResponse,
- IntegrationListResponse,
- IntegrationGetResponse,
-)
-```
-
-Methods:
-
-- client.zero_trust.dlp.entries.integration.create(\*, account_id, \*\*params) -> Optional[IntegrationCreateResponse]
-- client.zero_trust.dlp.entries.integration.update(entry_id, \*, account_id, \*\*params) -> Optional[IntegrationUpdateResponse]
-- client.zero_trust.dlp.entries.integration.list(\*, account_id) -> SyncSinglePage[IntegrationListResponse]
-- client.zero_trust.dlp.entries.integration.delete(entry_id, \*, account_id) -> object
-- client.zero_trust.dlp.entries.integration.get(entry_id, \*, account_id) -> Optional[IntegrationGetResponse]
-
-## Gateway
-
-Types:
-
-```python
-from cloudflare.types.zero_trust import GatewayCreateResponse, GatewayListResponse
-```
-
-Methods:
-
-- client.zero_trust.gateway.create(\*, account_id) -> Optional[GatewayCreateResponse]
-- client.zero_trust.gateway.list(\*, account_id) -> Optional[GatewayListResponse]
-
-### AuditSSHSettings
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.gateway import GatewaySettings
-```
-
-Methods:
-
-- client.zero_trust.gateway.audit_ssh_settings.update(\*, account_id, \*\*params) -> Optional[GatewaySettings]
-- client.zero_trust.gateway.audit_ssh_settings.get(\*, account_id) -> Optional[GatewaySettings]
-- client.zero_trust.gateway.audit_ssh_settings.rotate_seed(\*, account_id) -> Optional[GatewaySettings]
-
-### Categories
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.gateway import Category
-```
-
-Methods:
-
-- client.zero_trust.gateway.categories.list(\*, account_id) -> SyncSinglePage[Category]
-
-### AppTypes
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.gateway import AppType
-```
-
-Methods:
-
-- client.zero_trust.gateway.app_types.list(\*, account_id) -> SyncSinglePage[AppType]
-
-### Configurations
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.gateway import (
- ActivityLogSettings,
- AntiVirusSettings,
- BlockPageSettings,
- BodyScanningSettings,
- BrowserIsolationSettings,
- CustomCertificateSettings,
- ExtendedEmailMatching,
- FipsSettings,
- GatewayConfigurationSettings,
- NotificationSettings,
- ProtocolDetection,
- TLSSettings,
- ConfigurationUpdateResponse,
- ConfigurationEditResponse,
- ConfigurationGetResponse,
-)
-```
-
-Methods:
-
-- client.zero_trust.gateway.configurations.update(\*, account_id, \*\*params) -> Optional[ConfigurationUpdateResponse]
-- client.zero_trust.gateway.configurations.edit(\*, account_id, \*\*params) -> Optional[ConfigurationEditResponse]
-- client.zero_trust.gateway.configurations.get(\*, account_id) -> Optional[ConfigurationGetResponse]
-
-#### CustomCertificate
-
-Methods:
-
-- client.zero_trust.gateway.configurations.custom_certificate.get(\*, account_id) -> Optional[CustomCertificateSettings]
-
-### Lists
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.gateway import GatewayItem, GatewayList, ListCreateResponse
-```
-
-Methods:
-
-- client.zero_trust.gateway.lists.create(\*, account_id, \*\*params) -> Optional[ListCreateResponse]
-- client.zero_trust.gateway.lists.update(list_id, \*, account_id, \*\*params) -> Optional[GatewayList]
-- client.zero_trust.gateway.lists.list(\*, account_id, \*\*params) -> SyncSinglePage[GatewayList]
-- client.zero_trust.gateway.lists.delete(list_id, \*, account_id) -> object
-- client.zero_trust.gateway.lists.edit(list_id, \*, account_id, \*\*params) -> Optional[GatewayList]
-- client.zero_trust.gateway.lists.get(list_id, \*, account_id) -> Optional[GatewayList]
-
-#### Items
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.gateway.lists import ItemListResponse
-```
-
-Methods:
-
-- client.zero_trust.gateway.lists.items.list(list_id, \*, account_id) -> SyncSinglePage[ItemListResponse]
-
-### Locations
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.gateway import (
- DOHEndpoint,
- DOTEndpoint,
- Endpoint,
- IPNetwork,
- IPV4Endpoint,
- IPV6Endpoint,
- IPV6Network,
- Location,
-)
-```
-
-Methods:
-
-- client.zero_trust.gateway.locations.create(\*, account_id, \*\*params) -> Optional[Location]
-- client.zero_trust.gateway.locations.update(location_id, \*, account_id, \*\*params) -> Optional[Location]
-- client.zero_trust.gateway.locations.list(\*, account_id) -> SyncSinglePage[Location]
-- client.zero_trust.gateway.locations.delete(location_id, \*, account_id) -> object
-- client.zero_trust.gateway.locations.get(location_id, \*, account_id) -> Optional[Location]
-
-### Logging
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.gateway import LoggingSetting
-```
-
-Methods:
-
-- client.zero_trust.gateway.logging.update(\*, account_id, \*\*params) -> Optional[LoggingSetting]
-- client.zero_trust.gateway.logging.get(\*, account_id) -> Optional[LoggingSetting]
-
-### ProxyEndpoints
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.gateway import GatewayIPs, ProxyEndpoint
-```
-
-Methods:
-
-- client.zero_trust.gateway.proxy_endpoints.create(\*, account_id, \*\*params) -> Optional[ProxyEndpoint]
-- client.zero_trust.gateway.proxy_endpoints.list(\*, account_id) -> SyncSinglePage[ProxyEndpoint]
-- client.zero_trust.gateway.proxy_endpoints.delete(proxy_endpoint_id, \*, account_id) -> object
-- client.zero_trust.gateway.proxy_endpoints.edit(proxy_endpoint_id, \*, account_id, \*\*params) -> Optional[ProxyEndpoint]
-- client.zero_trust.gateway.proxy_endpoints.get(proxy_endpoint_id, \*, account_id) -> Optional[ProxyEndpoint]
-
-### Rules
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.gateway import (
- DNSResolverSettingsV4,
- DNSResolverSettingsV6,
- GatewayFilter,
- GatewayRule,
- RuleSetting,
- Schedule,
-)
-```
-
-Methods:
-
-- client.zero_trust.gateway.rules.create(\*, account_id, \*\*params) -> Optional[GatewayRule]
-- client.zero_trust.gateway.rules.update(rule_id, \*, account_id, \*\*params) -> Optional[GatewayRule]
-- client.zero_trust.gateway.rules.list(\*, account_id) -> SyncSinglePage[GatewayRule]
-- client.zero_trust.gateway.rules.delete(rule_id, \*, account_id) -> object
-- client.zero_trust.gateway.rules.get(rule_id, \*, account_id) -> Optional[GatewayRule]
-- client.zero_trust.gateway.rules.list_tenant(\*, account_id) -> SyncSinglePage[GatewayRule]
-- client.zero_trust.gateway.rules.reset_expiration(rule_id, \*, account_id) -> Optional[GatewayRule]
-
-### Certificates
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.gateway import (
- CertificateCreateResponse,
- CertificateListResponse,
- CertificateDeleteResponse,
- CertificateActivateResponse,
- CertificateDeactivateResponse,
- CertificateGetResponse,
-)
-```
-
-Methods:
-
-- client.zero_trust.gateway.certificates.create(\*, account_id, \*\*params) -> Optional[CertificateCreateResponse]
-- client.zero_trust.gateway.certificates.list(\*, account_id) -> SyncSinglePage[CertificateListResponse]
-- client.zero_trust.gateway.certificates.delete(certificate_id, \*, account_id) -> Optional[CertificateDeleteResponse]
-- client.zero_trust.gateway.certificates.activate(certificate_id, \*, account_id, \*\*params) -> Optional[CertificateActivateResponse]
-- client.zero_trust.gateway.certificates.deactivate(certificate_id, \*, account_id, \*\*params) -> Optional[CertificateDeactivateResponse]
-- client.zero_trust.gateway.certificates.get(certificate_id, \*, account_id) -> Optional[CertificateGetResponse]
-
-## Networks
-
-### Routes
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.networks import NetworkRoute, Route, Teamnet
-```
-
-Methods:
-
-- client.zero_trust.networks.routes.create(\*, account_id, \*\*params) -> Route
-- client.zero_trust.networks.routes.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[Teamnet]
-- client.zero_trust.networks.routes.delete(route_id, \*, account_id) -> Route
-- client.zero_trust.networks.routes.edit(route_id, \*, account_id, \*\*params) -> Route
-- client.zero_trust.networks.routes.get(route_id, \*, account_id) -> Route
-
-#### IPs
-
-Methods:
-
-- client.zero_trust.networks.routes.ips.get(ip, \*, account_id, \*\*params) -> Teamnet
-
-#### Networks
-
-Methods:
-
-- client.zero_trust.networks.routes.networks.create(ip_network_encoded, \*, account_id, \*\*params) -> Route
-- client.zero_trust.networks.routes.networks.delete(ip_network_encoded, \*, account_id, \*\*params) -> Route
-- client.zero_trust.networks.routes.networks.edit(ip_network_encoded, \*, account_id) -> Route
-
-### VirtualNetworks
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.networks import VirtualNetwork
-```
-
-Methods:
-
-- client.zero_trust.networks.virtual_networks.create(\*, account_id, \*\*params) -> VirtualNetwork
-- client.zero_trust.networks.virtual_networks.list(\*, account_id, \*\*params) -> SyncSinglePage[VirtualNetwork]
-- client.zero_trust.networks.virtual_networks.delete(virtual_network_id, \*, account_id) -> VirtualNetwork
-- client.zero_trust.networks.virtual_networks.edit(virtual_network_id, \*, account_id, \*\*params) -> VirtualNetwork
-- client.zero_trust.networks.virtual_networks.get(virtual_network_id, \*, account_id) -> VirtualNetwork
-
-### Subnets
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.networks import SubnetListResponse
-```
-
-Methods:
-
-- client.zero_trust.networks.subnets.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[SubnetListResponse]
-
-#### CloudflareSource
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.networks.subnets import CloudflareSourceUpdateResponse
-```
-
-Methods:
-
-- client.zero_trust.networks.subnets.cloudflare_source.update(address_family, \*, account_id, \*\*params) -> CloudflareSourceUpdateResponse
-
-### HostnameRoutes
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.networks import HostnameRoute
-```
-
-Methods:
-
-- client.zero_trust.networks.hostname_routes.create(\*, account_id, \*\*params) -> HostnameRoute
-- client.zero_trust.networks.hostname_routes.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[HostnameRoute]
-- client.zero_trust.networks.hostname_routes.delete(hostname_route_id, \*, account_id) -> HostnameRoute
-- client.zero_trust.networks.hostname_routes.edit(hostname_route_id, \*, account_id, \*\*params) -> HostnameRoute
-- client.zero_trust.networks.hostname_routes.get(hostname_route_id, \*, account_id) -> HostnameRoute
-
-## RiskScoring
-
-Types:
-
-```python
-from cloudflare.types.zero_trust import RiskScoringGetResponse
-```
-
-Methods:
-
-- client.zero_trust.risk_scoring.get(user_id, \*, account_id) -> Optional[RiskScoringGetResponse]
-- client.zero_trust.risk_scoring.reset(user_id, \*, account_id) -> object
-
-### Behaviours
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.risk_scoring import BehaviourUpdateResponse, BehaviourGetResponse
-```
-
-Methods:
-
-- client.zero_trust.risk_scoring.behaviours.update(\*, account_id, \*\*params) -> Optional[BehaviourUpdateResponse]
-- client.zero_trust.risk_scoring.behaviours.get(\*, account_id) -> Optional[BehaviourGetResponse]
-
-### Summary
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.risk_scoring import SummaryGetResponse
-```
-
-Methods:
-
-- client.zero_trust.risk_scoring.summary.get(\*, account_id) -> Optional[SummaryGetResponse]
-
-### Integrations
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.risk_scoring import (
- IntegrationCreateResponse,
- IntegrationUpdateResponse,
- IntegrationListResponse,
- IntegrationGetResponse,
-)
-```
-
-Methods:
-
-- client.zero_trust.risk_scoring.integrations.create(\*, account_id, \*\*params) -> Optional[IntegrationCreateResponse]
-- client.zero_trust.risk_scoring.integrations.update(integration_id, \*, account_id, \*\*params) -> Optional[IntegrationUpdateResponse]
-- client.zero_trust.risk_scoring.integrations.list(\*, account_id) -> SyncSinglePage[IntegrationListResponse]
-- client.zero_trust.risk_scoring.integrations.delete(integration_id, \*, account_id) -> object
-- client.zero_trust.risk_scoring.integrations.get(integration_id, \*, account_id) -> Optional[IntegrationGetResponse]
-
-#### References
-
-Types:
-
-```python
-from cloudflare.types.zero_trust.risk_scoring.integrations import ReferenceGetResponse
-```
-
-Methods:
-
-- client.zero_trust.risk_scoring.integrations.references.get(reference_id, \*, account_id) -> Optional[ReferenceGetResponse]
-
-# Turnstile
-
-## Widgets
-
-Types:
-
-```python
-from cloudflare.types.turnstile import Widget, WidgetDomain, WidgetListResponse
-```
-
-Methods:
-
-- client.turnstile.widgets.create(\*, account_id, \*\*params) -> Optional[Widget]
-- client.turnstile.widgets.update(sitekey, \*, account_id, \*\*params) -> Optional[Widget]
-- client.turnstile.widgets.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[WidgetListResponse]
-- client.turnstile.widgets.delete(sitekey, \*, account_id) -> Optional[Widget]
-- client.turnstile.widgets.get(sitekey, \*, account_id) -> Optional[Widget]
-- client.turnstile.widgets.rotate_secret(sitekey, \*, account_id, \*\*params) -> Optional[Widget]
-
-# Connectivity
-
-## Directory
-
-### Services
-
-Types:
-
-```python
-from cloudflare.types.connectivity.directory import (
- ServiceCreateResponse,
- ServiceUpdateResponse,
- ServiceListResponse,
- ServiceGetResponse,
-)
-```
-
-Methods:
-
-- client.connectivity.directory.services.create(\*, account_id, \*\*params) -> Optional[ServiceCreateResponse]
-- client.connectivity.directory.services.update(service_id, \*, account_id, \*\*params) -> Optional[ServiceUpdateResponse]
-- client.connectivity.directory.services.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[ServiceListResponse]
-- client.connectivity.directory.services.delete(service_id, \*, account_id) -> None
-- client.connectivity.directory.services.get(service_id, \*, account_id) -> Optional[ServiceGetResponse]
-
-# Hyperdrive
-
-Types:
-
-```python
-from cloudflare.types.hyperdrive import Configuration, Hyperdrive
-```
-
-## Configs
-
-Methods:
-
-- client.hyperdrive.configs.create(\*, account_id, \*\*params) -> Hyperdrive
-- client.hyperdrive.configs.update(hyperdrive_id, \*, account_id, \*\*params) -> Hyperdrive
-- client.hyperdrive.configs.list(\*, account_id) -> SyncSinglePage[Hyperdrive]
-- client.hyperdrive.configs.delete(hyperdrive_id, \*, account_id) -> object
-- client.hyperdrive.configs.edit(hyperdrive_id, \*, account_id, \*\*params) -> Hyperdrive
-- client.hyperdrive.configs.get(hyperdrive_id, \*, account_id) -> Hyperdrive
-
-# RUM
-
-## SiteInfo
-
-Types:
-
-```python
-from cloudflare.types.rum import Site, SiteInfoDeleteResponse
-```
-
-Methods:
-
-- client.rum.site_info.create(\*, account_id, \*\*params) -> Optional[Site]
-- client.rum.site_info.update(site_id, \*, account_id, \*\*params) -> Optional[Site]
-- client.rum.site_info.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[Site]
-- client.rum.site_info.delete(site_id, \*, account_id) -> Optional[SiteInfoDeleteResponse]
-- client.rum.site_info.get(site_id, \*, account_id) -> Optional[Site]
-
-## Rules
-
-Types:
-
-```python
-from cloudflare.types.rum import (
- RUMRule,
- RuleListResponse,
- RuleDeleteResponse,
- RuleBulkCreateResponse,
-)
-```
-
-Methods:
-
-- client.rum.rules.create(ruleset_id, \*, account_id, \*\*params) -> Optional[RUMRule]
-- client.rum.rules.update(rule_id, \*, account_id, ruleset_id, \*\*params) -> Optional[RUMRule]
-- client.rum.rules.list(ruleset_id, \*, account_id) -> Optional[RuleListResponse]
-- client.rum.rules.delete(rule_id, \*, account_id, ruleset_id) -> Optional[RuleDeleteResponse]
-- client.rum.rules.bulk_create(ruleset_id, \*, account_id, \*\*params) -> Optional[RuleBulkCreateResponse]
-
-# Vectorize
-
-## Indexes
-
-Types:
-
-```python
-from cloudflare.types.vectorize import (
- CreateIndex,
- IndexDeleteVectorsByID,
- IndexDimensionConfiguration,
- IndexInsert,
- IndexQuery,
- IndexUpsert,
- IndexDeleteResponse,
- IndexDeleteByIDsResponse,
- IndexInfoResponse,
- IndexInsertResponse,
- IndexListVectorsResponse,
- IndexQueryResponse,
- IndexUpsertResponse,
-)
-```
-
-Methods:
-
-- client.vectorize.indexes.create(\*, account_id, \*\*params) -> Optional[CreateIndex]
-- client.vectorize.indexes.list(\*, account_id) -> SyncSinglePage[CreateIndex]
-- client.vectorize.indexes.delete(index_name, \*, account_id) -> Optional[IndexDeleteResponse]
-- client.vectorize.indexes.delete_by_ids(index_name, \*, account_id, \*\*params) -> Optional[IndexDeleteByIDsResponse]
-- client.vectorize.indexes.get(index_name, \*, account_id) -> Optional[CreateIndex]
-- client.vectorize.indexes.get_by_ids(index_name, \*, account_id, \*\*params) -> object
-- client.vectorize.indexes.info(index_name, \*, account_id) -> Optional[IndexInfoResponse]
-- client.vectorize.indexes.insert(index_name, \*, account_id, \*\*params) -> Optional[IndexInsertResponse]
-- client.vectorize.indexes.list_vectors(index_name, \*, account_id, \*\*params) -> Optional[IndexListVectorsResponse]
-- client.vectorize.indexes.query(index_name, \*, account_id, \*\*params) -> Optional[IndexQueryResponse]
-- client.vectorize.indexes.upsert(index_name, \*, account_id, \*\*params) -> Optional[IndexUpsertResponse]
-
-### MetadataIndex
-
-Types:
-
-```python
-from cloudflare.types.vectorize.indexes import (
- MetadataIndexCreateResponse,
- MetadataIndexListResponse,
- MetadataIndexDeleteResponse,
-)
-```
-
-Methods:
-
-- client.vectorize.indexes.metadata_index.create(index_name, \*, account_id, \*\*params) -> Optional[MetadataIndexCreateResponse]
-- client.vectorize.indexes.metadata_index.list(index_name, \*, account_id) -> Optional[MetadataIndexListResponse]
-- client.vectorize.indexes.metadata_index.delete(index_name, \*, account_id, \*\*params) -> Optional[MetadataIndexDeleteResponse]
-
-# URLScanner
-
-Types:
-
-```python
-from cloudflare.types.url_scanner import URLScannerDomain, URLScannerTask
-```
-
-## Responses
-
-Types:
-
-```python
-from cloudflare.types.url_scanner import ResponseGetResponse
-```
-
-Methods:
-
-- client.url_scanner.responses.get(response_id, \*, account_id) -> str
-
-## Scans
-
-Types:
-
-```python
-from cloudflare.types.url_scanner import (
- ScanCreateResponse,
- ScanListResponse,
- ScanBulkCreateResponse,
- ScanDOMResponse,
- ScanGetResponse,
- ScanHARResponse,
-)
-```
-
-Methods:
-
-- client.url_scanner.scans.create(\*, account_id, \*\*params) -> ScanCreateResponse
-- client.url_scanner.scans.list(\*, account_id, \*\*params) -> ScanListResponse
-- client.url_scanner.scans.bulk_create(\*, account_id, \*\*params) -> ScanBulkCreateResponse
-- client.url_scanner.scans.dom(scan_id, \*, account_id) -> str
-- client.url_scanner.scans.get(scan_id, \*, account_id) -> ScanGetResponse
-- client.url_scanner.scans.har(scan_id, \*, account_id) -> ScanHARResponse
-- client.url_scanner.scans.screenshot(scan_id, \*, account_id, \*\*params) -> BinaryAPIResponse
-
-# Radar
-
-## AI
-
-### ToMarkdown
-
-Types:
-
-```python
-from cloudflare.types.radar.ai import ToMarkdownCreateResponse
-```
-
-Methods:
-
-- client.radar.ai.to_markdown.create(\*, account_id, \*\*params) -> SyncSinglePage[ToMarkdownCreateResponse]
-
-### Inference
-
-Types:
-
-```python
-from cloudflare.types.radar.ai import (
- InferenceSummaryV2Response,
- InferenceTimeseriesGroupsV2Response,
-)
-```
-
-Methods:
-
-- client.radar.ai.inference.summary_v2(dimension, \*\*params) -> InferenceSummaryV2Response
-- client.radar.ai.inference.timeseries_groups_v2(dimension, \*\*params) -> InferenceTimeseriesGroupsV2Response
-
-#### Summary
-
-Types:
-
-```python
-from cloudflare.types.radar.ai.inference import SummaryModelResponse, SummaryTaskResponse
-```
-
-Methods:
-
-- client.radar.ai.inference.summary.model(\*\*params) -> SummaryModelResponse
-- client.radar.ai.inference.summary.task(\*\*params) -> SummaryTaskResponse
-
-#### TimeseriesGroups
-
-##### Summary
-
-Types:
-
-```python
-from cloudflare.types.radar.ai.inference.timeseries_groups import (
- SummaryModelResponse,
- SummaryTaskResponse,
-)
-```
-
-Methods:
-
-- client.radar.ai.inference.timeseries_groups.summary.model(\*\*params) -> SummaryModelResponse
-- client.radar.ai.inference.timeseries_groups.summary.task(\*\*params) -> SummaryTaskResponse
-
-### Bots
-
-Types:
-
-```python
-from cloudflare.types.radar.ai import (
- BotSummaryV2Response,
- BotTimeseriesResponse,
- BotTimeseriesGroupsResponse,
-)
-```
-
-Methods:
-
-- client.radar.ai.bots.summary_v2(dimension, \*\*params) -> BotSummaryV2Response
-- client.radar.ai.bots.timeseries(\*\*params) -> BotTimeseriesResponse
-- client.radar.ai.bots.timeseries_groups(dimension, \*\*params) -> BotTimeseriesGroupsResponse
-
-#### Summary
-
-Types:
-
-```python
-from cloudflare.types.radar.ai.bots import SummaryUserAgentResponse
-```
-
-Methods:
-
-- client.radar.ai.bots.summary.user_agent(\*\*params) -> SummaryUserAgentResponse
-
-### TimeseriesGroups
-
-Types:
-
-```python
-from cloudflare.types.radar.ai import (
- TimeseriesGroupSummaryResponse,
- TimeseriesGroupTimeseriesResponse,
- TimeseriesGroupTimeseriesGroupsResponse,
- TimeseriesGroupUserAgentResponse,
-)
-```
-
-Methods:
-
-- client.radar.ai.timeseries_groups.summary(dimension, \*\*params) -> TimeseriesGroupSummaryResponse
-- client.radar.ai.timeseries_groups.timeseries(\*\*params) -> TimeseriesGroupTimeseriesResponse
-- client.radar.ai.timeseries_groups.timeseries_groups(dimension, \*\*params) -> TimeseriesGroupTimeseriesGroupsResponse
-- client.radar.ai.timeseries_groups.user_agent(\*\*params) -> TimeseriesGroupUserAgentResponse
-
-## CT
-
-Types:
-
-```python
-from cloudflare.types.radar import (
- CTSummaryResponse,
- CTTimeseriesResponse,
- CTTimeseriesGroupsResponse,
-)
-```
-
-Methods:
-
-- client.radar.ct.summary(dimension, \*\*params) -> CTSummaryResponse
-- client.radar.ct.timeseries(\*\*params) -> CTTimeseriesResponse
-- client.radar.ct.timeseries_groups(dimension, \*\*params) -> CTTimeseriesGroupsResponse
-
-### Authorities
-
-Types:
-
-```python
-from cloudflare.types.radar.ct import AuthorityListResponse, AuthorityGetResponse
-```
-
-Methods:
-
-- client.radar.ct.authorities.list(\*\*params) -> AuthorityListResponse
-- client.radar.ct.authorities.get(ca_slug, \*\*params) -> AuthorityGetResponse
-
-### Logs
-
-Types:
-
-```python
-from cloudflare.types.radar.ct import LogListResponse, LogGetResponse
-```
-
-Methods:
-
-- client.radar.ct.logs.list(\*\*params) -> LogListResponse
-- client.radar.ct.logs.get(log_slug, \*\*params) -> LogGetResponse
-
-## Annotations
-
-Types:
-
-```python
-from cloudflare.types.radar import AnnotationListResponse
-```
-
-Methods:
-
-- client.radar.annotations.list(\*\*params) -> AnnotationListResponse
-
-### Outages
-
-Types:
-
-```python
-from cloudflare.types.radar.annotations import OutageGetResponse, OutageLocationsResponse
-```
-
-Methods:
-
-- client.radar.annotations.outages.get(\*\*params) -> OutageGetResponse
-- client.radar.annotations.outages.locations(\*\*params) -> OutageLocationsResponse
-
-## BGP
-
-Types:
-
-```python
-from cloudflare.types.radar import BGPTimeseriesResponse
-```
-
-Methods:
-
-- client.radar.bgp.timeseries(\*\*params) -> BGPTimeseriesResponse
-
-### Leaks
-
-#### Events
-
-Types:
-
-```python
-from cloudflare.types.radar.bgp.leaks import EventListResponse
-```
-
-Methods:
-
-- client.radar.bgp.leaks.events.list(\*\*params) -> SyncV4PagePagination[EventListResponse]
-
-### Top
-
-Types:
-
-```python
-from cloudflare.types.radar.bgp import TopPrefixesResponse
-```
-
-Methods:
-
-- client.radar.bgp.top.prefixes(\*\*params) -> TopPrefixesResponse
-
-#### Ases
-
-Types:
-
-```python
-from cloudflare.types.radar.bgp.top import AseGetResponse, AsePrefixesResponse
-```
-
-Methods:
-
-- client.radar.bgp.top.ases.get(\*\*params) -> AseGetResponse
-- client.radar.bgp.top.ases.prefixes(\*\*params) -> AsePrefixesResponse
-
-### Hijacks
-
-#### Events
-
-Types:
-
-```python
-from cloudflare.types.radar.bgp.hijacks import EventListResponse
-```
-
-Methods:
-
-- client.radar.bgp.hijacks.events.list(\*\*params) -> SyncV4PagePagination[EventListResponse]
-
-### Routes
-
-Types:
-
-```python
-from cloudflare.types.radar.bgp import (
- RouteAsesResponse,
- RouteMoasResponse,
- RoutePfx2asResponse,
- RouteRealtimeResponse,
- RouteStatsResponse,
-)
-```
-
-Methods:
-
-- client.radar.bgp.routes.ases(\*\*params) -> RouteAsesResponse
-- client.radar.bgp.routes.moas(\*\*params) -> RouteMoasResponse
-- client.radar.bgp.routes.pfx2as(\*\*params) -> RoutePfx2asResponse
-- client.radar.bgp.routes.realtime(\*\*params) -> RouteRealtimeResponse
-- client.radar.bgp.routes.stats(\*\*params) -> RouteStatsResponse
-
-### IPs
-
-Types:
-
-```python
-from cloudflare.types.radar.bgp import IPTimeseriesResponse
-```
-
-Methods:
-
-- client.radar.bgp.ips.timeseries(\*\*params) -> IPTimeseriesResponse
-
-### RPKI
-
-#### ASPA
-
-Types:
-
-```python
-from cloudflare.types.radar.bgp.rpki import (
- ASPAChangesResponse,
- ASPASnapshotResponse,
- ASPATimeseriesResponse,
-)
-```
-
-Methods:
-
-- client.radar.bgp.rpki.aspa.changes(\*\*params) -> ASPAChangesResponse
-- client.radar.bgp.rpki.aspa.snapshot(\*\*params) -> ASPASnapshotResponse
-- client.radar.bgp.rpki.aspa.timeseries(\*\*params) -> ASPATimeseriesResponse
-
-## Bots
-
-Types:
-
-```python
-from cloudflare.types.radar import (
- BotListResponse,
- BotGetResponse,
- BotSummaryResponse,
- BotTimeseriesResponse,
- BotTimeseriesGroupsResponse,
-)
-```
-
-Methods:
-
-- client.radar.bots.list(\*\*params) -> BotListResponse
-- client.radar.bots.get(bot_slug, \*\*params) -> BotGetResponse
-- client.radar.bots.summary(dimension, \*\*params) -> BotSummaryResponse
-- client.radar.bots.timeseries(\*\*params) -> BotTimeseriesResponse
-- client.radar.bots.timeseries_groups(dimension, \*\*params) -> BotTimeseriesGroupsResponse
-
-### WebCrawlers
-
-Types:
-
-```python
-from cloudflare.types.radar.bots import (
- WebCrawlerSummaryResponse,
- WebCrawlerTimeseriesGroupsResponse,
-)
-```
-
-Methods:
-
-- client.radar.bots.web_crawlers.summary(dimension, \*\*params) -> WebCrawlerSummaryResponse
-- client.radar.bots.web_crawlers.timeseries_groups(dimension, \*\*params) -> WebCrawlerTimeseriesGroupsResponse
-
-## Datasets
-
-Types:
-
-```python
-from cloudflare.types.radar import DatasetListResponse, DatasetDownloadResponse, DatasetGetResponse
-```
-
-Methods:
-
-- client.radar.datasets.list(\*\*params) -> DatasetListResponse
-- client.radar.datasets.download(\*\*params) -> DatasetDownloadResponse
-- client.radar.datasets.get(alias) -> str
-
-## DNS
-
-Types:
-
-```python
-from cloudflare.types.radar import (
- DNSSummaryV2Response,
- DNSTimeseriesResponse,
- DNSTimeseriesGroupsV2Response,
-)
-```
-
-Methods:
-
-- client.radar.dns.summary_v2(dimension, \*\*params) -> DNSSummaryV2Response
-- client.radar.dns.timeseries(\*\*params) -> DNSTimeseriesResponse
-- client.radar.dns.timeseries_groups_v2(dimension, \*\*params) -> DNSTimeseriesGroupsV2Response
-
-### Top
-
-Types:
-
-```python
-from cloudflare.types.radar.dns import TopAsesResponse, TopLocationsResponse
-```
-
-Methods:
-
-- client.radar.dns.top.ases(\*\*params) -> TopAsesResponse
-- client.radar.dns.top.locations(\*\*params) -> TopLocationsResponse
-
-### Summary
-
-Types:
-
-```python
-from cloudflare.types.radar.dns import (
- SummaryCacheHitResponse,
- SummaryDNSSECResponse,
- SummaryDNSSECAwareResponse,
- SummaryDNSSECE2EResponse,
- SummaryIPVersionResponse,
- SummaryMatchingAnswerResponse,
- SummaryProtocolResponse,
- SummaryQueryTypeResponse,
- SummaryResponseCodeResponse,
- SummaryResponseTTLResponse,
-)
-```
-
-Methods:
-
-- client.radar.dns.summary.cache_hit(\*\*params) -> SummaryCacheHitResponse
-- client.radar.dns.summary.dnssec(\*\*params) -> SummaryDNSSECResponse
-- client.radar.dns.summary.dnssec_aware(\*\*params) -> SummaryDNSSECAwareResponse
-- client.radar.dns.summary.dnssec_e2e(\*\*params) -> SummaryDNSSECE2EResponse
-- client.radar.dns.summary.ip_version(\*\*params) -> SummaryIPVersionResponse
-- client.radar.dns.summary.matching_answer(\*\*params) -> SummaryMatchingAnswerResponse
-- client.radar.dns.summary.protocol(\*\*params) -> SummaryProtocolResponse
-- client.radar.dns.summary.query_type(\*\*params) -> SummaryQueryTypeResponse
-- client.radar.dns.summary.response_code(\*\*params) -> SummaryResponseCodeResponse
-- client.radar.dns.summary.response_ttl(\*\*params) -> SummaryResponseTTLResponse
-
-### TimeseriesGroups
-
-Types:
-
-```python
-from cloudflare.types.radar.dns import (
- TimeseriesGroupCacheHitResponse,
- TimeseriesGroupDNSSECResponse,
- TimeseriesGroupDNSSECAwareResponse,
- TimeseriesGroupDNSSECE2EResponse,
- TimeseriesGroupIPVersionResponse,
- TimeseriesGroupMatchingAnswerResponse,
- TimeseriesGroupProtocolResponse,
- TimeseriesGroupQueryTypeResponse,
- TimeseriesGroupResponseCodeResponse,
- TimeseriesGroupResponseTTLResponse,
-)
-```
-
-Methods:
-
-- client.radar.dns.timeseries_groups.cache_hit(\*\*params) -> TimeseriesGroupCacheHitResponse
-- client.radar.dns.timeseries_groups.dnssec(\*\*params) -> TimeseriesGroupDNSSECResponse
-- client.radar.dns.timeseries_groups.dnssec_aware(\*\*params) -> TimeseriesGroupDNSSECAwareResponse
-- client.radar.dns.timeseries_groups.dnssec_e2e(\*\*params) -> TimeseriesGroupDNSSECE2EResponse
-- client.radar.dns.timeseries_groups.ip_version(\*\*params) -> TimeseriesGroupIPVersionResponse
-- client.radar.dns.timeseries_groups.matching_answer(\*\*params) -> TimeseriesGroupMatchingAnswerResponse
-- client.radar.dns.timeseries_groups.protocol(\*\*params) -> TimeseriesGroupProtocolResponse
-- client.radar.dns.timeseries_groups.query_type(\*\*params) -> TimeseriesGroupQueryTypeResponse
-- client.radar.dns.timeseries_groups.response_code(\*\*params) -> TimeseriesGroupResponseCodeResponse
-- client.radar.dns.timeseries_groups.response_ttl(\*\*params) -> TimeseriesGroupResponseTTLResponse
-
-## NetFlows
-
-Types:
-
-```python
-from cloudflare.types.radar import (
- NetFlowsSummaryResponse,
- NetFlowsSummaryV2Response,
- NetFlowsTimeseriesResponse,
- NetFlowsTimeseriesGroupsResponse,
-)
-```
-
-Methods:
-
-- client.radar.netflows.summary(\*\*params) -> NetFlowsSummaryResponse
-- client.radar.netflows.summary_v2(dimension, \*\*params) -> NetFlowsSummaryV2Response
-- client.radar.netflows.timeseries(\*\*params) -> NetFlowsTimeseriesResponse
-- client.radar.netflows.timeseries_groups(dimension, \*\*params) -> NetFlowsTimeseriesGroupsResponse
-
-### Top
-
-Types:
-
-```python
-from cloudflare.types.radar.netflows import TopAsesResponse, TopLocationsResponse
-```
-
-Methods:
-
-- client.radar.netflows.top.ases(\*\*params) -> TopAsesResponse
-- client.radar.netflows.top.locations(\*\*params) -> TopLocationsResponse
-
-## Search
-
-Types:
-
-```python
-from cloudflare.types.radar import SearchGlobalResponse
-```
-
-Methods:
-
-- client.radar.search.global\_(\*\*params) -> SearchGlobalResponse
-
-## VerifiedBots
-
-### Top
-
-Types:
-
-```python
-from cloudflare.types.radar.verified_bots import TopBotsResponse, TopCategoriesResponse
-```
-
-Methods:
-
-- client.radar.verified_bots.top.bots(\*\*params) -> TopBotsResponse
-- client.radar.verified_bots.top.categories(\*\*params) -> TopCategoriesResponse
-
-## AS112
-
-Types:
-
-```python
-from cloudflare.types.radar import (
- AS112SummaryV2Response,
- AS112TimeseriesResponse,
- AS112TimeseriesGroupsV2Response,
-)
-```
-
-Methods:
-
-- client.radar.as112.summary_v2(dimension, \*\*params) -> AS112SummaryV2Response
-- client.radar.as112.timeseries(\*\*params) -> AS112TimeseriesResponse
-- client.radar.as112.timeseries_groups_v2(dimension, \*\*params) -> AS112TimeseriesGroupsV2Response
-
-### Summary
-
-Types:
-
-```python
-from cloudflare.types.radar.as112 import (
- SummaryDNSSECResponse,
- SummaryEdnsResponse,
- SummaryIPVersionResponse,
- SummaryProtocolResponse,
- SummaryQueryTypeResponse,
- SummaryResponseCodesResponse,
-)
-```
-
-Methods:
-
-- client.radar.as112.summary.dnssec(\*\*params) -> SummaryDNSSECResponse
-- client.radar.as112.summary.edns(\*\*params) -> SummaryEdnsResponse
-- client.radar.as112.summary.ip_version(\*\*params) -> SummaryIPVersionResponse
-- client.radar.as112.summary.protocol(\*\*params) -> SummaryProtocolResponse
-- client.radar.as112.summary.query_type(\*\*params) -> SummaryQueryTypeResponse
-- client.radar.as112.summary.response_codes(\*\*params) -> SummaryResponseCodesResponse
-
-### TimeseriesGroups
-
-Types:
-
-```python
-from cloudflare.types.radar.as112 import (
- TimeseriesGroupDNSSECResponse,
- TimeseriesGroupEdnsResponse,
- TimeseriesGroupIPVersionResponse,
- TimeseriesGroupProtocolResponse,
- TimeseriesGroupQueryTypeResponse,
- TimeseriesGroupResponseCodesResponse,
-)
-```
-
-Methods:
-
-- client.radar.as112.timeseries_groups.dnssec(\*\*params) -> TimeseriesGroupDNSSECResponse
-- client.radar.as112.timeseries_groups.edns(\*\*params) -> TimeseriesGroupEdnsResponse
-- client.radar.as112.timeseries_groups.ip_version(\*\*params) -> TimeseriesGroupIPVersionResponse
-- client.radar.as112.timeseries_groups.protocol(\*\*params) -> TimeseriesGroupProtocolResponse
-- client.radar.as112.timeseries_groups.query_type(\*\*params) -> TimeseriesGroupQueryTypeResponse
-- client.radar.as112.timeseries_groups.response_codes(\*\*params) -> TimeseriesGroupResponseCodesResponse
-
-### Top
-
-Types:
-
-```python
-from cloudflare.types.radar.as112 import (
- TopDNSSECResponse,
- TopEdnsResponse,
- TopIPVersionResponse,
- TopLocationsResponse,
-)
-```
-
-Methods:
-
-- client.radar.as112.top.dnssec(dnssec, \*\*params) -> TopDNSSECResponse
-- client.radar.as112.top.edns(edns, \*\*params) -> TopEdnsResponse
-- client.radar.as112.top.ip_version(ip_version, \*\*params) -> TopIPVersionResponse
-- client.radar.as112.top.locations(\*\*params) -> TopLocationsResponse
-
-## Email
-
-Types:
-
-```python
-from cloudflare.types.radar import RadarEmailSeries, RadarEmailSummary
-```
-
-### Routing
-
-Types:
-
-```python
-from cloudflare.types.radar.email import RoutingSummaryV2Response, RoutingTimeseriesGroupsV2Response
-```
-
-Methods:
-
-- client.radar.email.routing.summary_v2(dimension, \*\*params) -> RoutingSummaryV2Response
-- client.radar.email.routing.timeseries_groups_v2(dimension, \*\*params) -> RoutingTimeseriesGroupsV2Response
-
-#### Summary
-
-Types:
-
-```python
-from cloudflare.types.radar.email.routing import (
- SummaryARCResponse,
- SummaryDKIMResponse,
- SummaryDMARCResponse,
- SummaryEncryptedResponse,
- SummaryIPVersionResponse,
- SummarySPFResponse,
-)
-```
-
-Methods:
-
-- client.radar.email.routing.summary.arc(\*\*params) -> SummaryARCResponse
-- client.radar.email.routing.summary.dkim(\*\*params) -> SummaryDKIMResponse
-- client.radar.email.routing.summary.dmarc(\*\*params) -> SummaryDMARCResponse
-- client.radar.email.routing.summary.encrypted(\*\*params) -> SummaryEncryptedResponse
-- client.radar.email.routing.summary.ip_version(\*\*params) -> SummaryIPVersionResponse
-- client.radar.email.routing.summary.spf(\*\*params) -> SummarySPFResponse
-
-#### TimeseriesGroups
-
-Types:
-
-```python
-from cloudflare.types.radar.email.routing import (
- TimeseriesGroupARCResponse,
- TimeseriesGroupDKIMResponse,
- TimeseriesGroupDMARCResponse,
- TimeseriesGroupEncryptedResponse,
- TimeseriesGroupIPVersionResponse,
- TimeseriesGroupSPFResponse,
-)
-```
-
-Methods:
-
-- client.radar.email.routing.timeseries_groups.arc(\*\*params) -> TimeseriesGroupARCResponse
-- client.radar.email.routing.timeseries_groups.dkim(\*\*params) -> TimeseriesGroupDKIMResponse
-- client.radar.email.routing.timeseries_groups.dmarc(\*\*params) -> TimeseriesGroupDMARCResponse
-- client.radar.email.routing.timeseries_groups.encrypted(\*\*params) -> TimeseriesGroupEncryptedResponse
-- client.radar.email.routing.timeseries_groups.ip_version(\*\*params) -> TimeseriesGroupIPVersionResponse
-- client.radar.email.routing.timeseries_groups.spf(\*\*params) -> TimeseriesGroupSPFResponse
-
-### Security
-
-Types:
-
-```python
-from cloudflare.types.radar.email import (
- SecuritySummaryV2Response,
- SecurityTimeseriesGroupsV2Response,
-)
-```
-
-Methods:
-
-- client.radar.email.security.summary_v2(dimension, \*\*params) -> SecuritySummaryV2Response
-- client.radar.email.security.timeseries_groups_v2(dimension, \*\*params) -> SecurityTimeseriesGroupsV2Response
-
-#### Top
-
-##### TLDs
-
-Types:
-
-```python
-from cloudflare.types.radar.email.security.top import TLDGetResponse
-```
-
-Methods:
-
-- client.radar.email.security.top.tlds.get(\*\*params) -> TLDGetResponse
-
-###### Malicious
-
-Types:
-
-```python
-from cloudflare.types.radar.email.security.top.tlds import MaliciousGetResponse
-```
-
-Methods:
-
-- client.radar.email.security.top.tlds.malicious.get(malicious, \*\*params) -> MaliciousGetResponse
-
-###### Spam
-
-Types:
-
-```python
-from cloudflare.types.radar.email.security.top.tlds import SpamGetResponse
-```
-
-Methods:
-
-- client.radar.email.security.top.tlds.spam.get(spam, \*\*params) -> SpamGetResponse
-
-###### Spoof
-
-Types:
-
-```python
-from cloudflare.types.radar.email.security.top.tlds import SpoofGetResponse
-```
-
-Methods:
-
-- client.radar.email.security.top.tlds.spoof.get(spoof, \*\*params) -> SpoofGetResponse
-
-#### Summary
-
-Types:
-
-```python
-from cloudflare.types.radar.email.security import (
- SummaryARCResponse,
- SummaryDKIMResponse,
- SummaryDMARCResponse,
- SummaryMaliciousResponse,
- SummarySpamResponse,
- SummarySPFResponse,
- SummarySpoofResponse,
- SummaryThreatCategoryResponse,
- SummaryTLSVersionResponse,
-)
-```
-
-Methods:
-
-- client.radar.email.security.summary.arc(\*\*params) -> SummaryARCResponse
-- client.radar.email.security.summary.dkim(\*\*params) -> SummaryDKIMResponse
-- client.radar.email.security.summary.dmarc(\*\*params) -> SummaryDMARCResponse
-- client.radar.email.security.summary.malicious(\*\*params) -> SummaryMaliciousResponse
-- client.radar.email.security.summary.spam(\*\*params) -> SummarySpamResponse
-- client.radar.email.security.summary.spf(\*\*params) -> SummarySPFResponse
-- client.radar.email.security.summary.spoof(\*\*params) -> SummarySpoofResponse
-- client.radar.email.security.summary.threat_category(\*\*params) -> SummaryThreatCategoryResponse
-- client.radar.email.security.summary.tls_version(\*\*params) -> SummaryTLSVersionResponse
-
-#### TimeseriesGroups
-
-Types:
-
-```python
-from cloudflare.types.radar.email.security import (
- TimeseriesGroupARCResponse,
- TimeseriesGroupDKIMResponse,
- TimeseriesGroupDMARCResponse,
- TimeseriesGroupMaliciousResponse,
- TimeseriesGroupSpamResponse,
- TimeseriesGroupSPFResponse,
- TimeseriesGroupSpoofResponse,
- TimeseriesGroupThreatCategoryResponse,
- TimeseriesGroupTLSVersionResponse,
-)
-```
-
-Methods:
-
-- client.radar.email.security.timeseries_groups.arc(\*\*params) -> TimeseriesGroupARCResponse
-- client.radar.email.security.timeseries_groups.dkim(\*\*params) -> TimeseriesGroupDKIMResponse
-- client.radar.email.security.timeseries_groups.dmarc(\*\*params) -> TimeseriesGroupDMARCResponse
-- client.radar.email.security.timeseries_groups.malicious(\*\*params) -> TimeseriesGroupMaliciousResponse
-- client.radar.email.security.timeseries_groups.spam(\*\*params) -> TimeseriesGroupSpamResponse
-- client.radar.email.security.timeseries_groups.spf(\*\*params) -> TimeseriesGroupSPFResponse
-- client.radar.email.security.timeseries_groups.spoof(\*\*params) -> TimeseriesGroupSpoofResponse
-- client.radar.email.security.timeseries_groups.threat_category(\*\*params) -> TimeseriesGroupThreatCategoryResponse
-- client.radar.email.security.timeseries_groups.tls_version(\*\*params) -> TimeseriesGroupTLSVersionResponse
-
-## Attacks
-
-### Layer3
-
-Types:
-
-```python
-from cloudflare.types.radar.attacks import (
- Layer3SummaryV2Response,
- Layer3TimeseriesResponse,
- Layer3TimeseriesGroupsV2Response,
-)
-```
-
-Methods:
-
-- client.radar.attacks.layer3.summary_v2(dimension, \*\*params) -> Layer3SummaryV2Response
-- client.radar.attacks.layer3.timeseries(\*\*params) -> Layer3TimeseriesResponse
-- client.radar.attacks.layer3.timeseries_groups_v2(dimension, \*\*params) -> Layer3TimeseriesGroupsV2Response
-
-#### Summary
-
-Types:
-
-```python
-from cloudflare.types.radar.attacks.layer3 import (
- SummaryBitrateResponse,
- SummaryDurationResponse,
- SummaryIndustryResponse,
- SummaryIPVersionResponse,
- SummaryProtocolResponse,
- SummaryVectorResponse,
- SummaryVerticalResponse,
-)
-```
-
-Methods:
-
-- client.radar.attacks.layer3.summary.bitrate(\*\*params) -> SummaryBitrateResponse
-- client.radar.attacks.layer3.summary.duration(\*\*params) -> SummaryDurationResponse
-- client.radar.attacks.layer3.summary.industry(\*\*params) -> SummaryIndustryResponse
-- client.radar.attacks.layer3.summary.ip_version(\*\*params) -> SummaryIPVersionResponse
-- client.radar.attacks.layer3.summary.protocol(\*\*params) -> SummaryProtocolResponse
-- client.radar.attacks.layer3.summary.vector(\*\*params) -> SummaryVectorResponse
-- client.radar.attacks.layer3.summary.vertical(\*\*params) -> SummaryVerticalResponse
-
-#### TimeseriesGroups
-
-Types:
-
-```python
-from cloudflare.types.radar.attacks.layer3 import (
- TimeseriesGroupBitrateResponse,
- TimeseriesGroupDurationResponse,
- TimeseriesGroupIndustryResponse,
- TimeseriesGroupIPVersionResponse,
- TimeseriesGroupProtocolResponse,
- TimeseriesGroupVectorResponse,
- TimeseriesGroupVerticalResponse,
-)
-```
-
-Methods:
-
-- client.radar.attacks.layer3.timeseries_groups.bitrate(\*\*params) -> TimeseriesGroupBitrateResponse
-- client.radar.attacks.layer3.timeseries_groups.duration(\*\*params) -> TimeseriesGroupDurationResponse
-- client.radar.attacks.layer3.timeseries_groups.industry(\*\*params) -> TimeseriesGroupIndustryResponse
-- client.radar.attacks.layer3.timeseries_groups.ip_version(\*\*params) -> TimeseriesGroupIPVersionResponse
-- client.radar.attacks.layer3.timeseries_groups.protocol(\*\*params) -> TimeseriesGroupProtocolResponse
-- client.radar.attacks.layer3.timeseries_groups.vector(\*\*params) -> TimeseriesGroupVectorResponse
-- client.radar.attacks.layer3.timeseries_groups.vertical(\*\*params) -> TimeseriesGroupVerticalResponse
-
-#### Top
-
-Types:
-
-```python
-from cloudflare.types.radar.attacks.layer3 import (
- TopAttacksResponse,
- TopIndustryResponse,
- TopVerticalResponse,
-)
-```
-
-Methods:
-
-- client.radar.attacks.layer3.top.attacks(\*\*params) -> TopAttacksResponse
-- client.radar.attacks.layer3.top.industry(\*\*params) -> TopIndustryResponse
-- client.radar.attacks.layer3.top.vertical(\*\*params) -> TopVerticalResponse
-
-##### Locations
-
-Types:
-
-```python
-from cloudflare.types.radar.attacks.layer3.top import LocationOriginResponse, LocationTargetResponse
-```
-
-Methods:
-
-- client.radar.attacks.layer3.top.locations.origin(\*\*params) -> LocationOriginResponse
-- client.radar.attacks.layer3.top.locations.target(\*\*params) -> LocationTargetResponse
-
-### Layer7
-
-Types:
-
-```python
-from cloudflare.types.radar.attacks import (
- Layer7SummaryV2Response,
- Layer7TimeseriesResponse,
- Layer7TimeseriesGroupsV2Response,
-)
-```
-
-Methods:
-
-- client.radar.attacks.layer7.summary_v2(dimension, \*\*params) -> Layer7SummaryV2Response
-- client.radar.attacks.layer7.timeseries(\*\*params) -> Layer7TimeseriesResponse
-- client.radar.attacks.layer7.timeseries_groups_v2(dimension, \*\*params) -> Layer7TimeseriesGroupsV2Response
-
-#### Summary
-
-Types:
-
-```python
-from cloudflare.types.radar.attacks.layer7 import (
- SummaryHTTPMethodResponse,
- SummaryHTTPVersionResponse,
- SummaryIndustryResponse,
- SummaryIPVersionResponse,
- SummaryManagedRulesResponse,
- SummaryMitigationProductResponse,
- SummaryVerticalResponse,
-)
-```
-
-Methods:
-
-- client.radar.attacks.layer7.summary.http_method(\*\*params) -> SummaryHTTPMethodResponse
-- client.radar.attacks.layer7.summary.http_version(\*\*params) -> SummaryHTTPVersionResponse
-- client.radar.attacks.layer7.summary.industry(\*\*params) -> SummaryIndustryResponse
-- client.radar.attacks.layer7.summary.ip_version(\*\*params) -> SummaryIPVersionResponse
-- client.radar.attacks.layer7.summary.managed_rules(\*\*params) -> SummaryManagedRulesResponse
-- client.radar.attacks.layer7.summary.mitigation_product(\*\*params) -> SummaryMitigationProductResponse
-- client.radar.attacks.layer7.summary.vertical(\*\*params) -> SummaryVerticalResponse
-
-#### TimeseriesGroups
-
-Types:
-
-```python
-from cloudflare.types.radar.attacks.layer7 import (
- TimeseriesGroupHTTPMethodResponse,
- TimeseriesGroupHTTPVersionResponse,
- TimeseriesGroupIndustryResponse,
- TimeseriesGroupIPVersionResponse,
- TimeseriesGroupManagedRulesResponse,
- TimeseriesGroupMitigationProductResponse,
- TimeseriesGroupVerticalResponse,
-)
-```
-
-Methods:
-
-- client.radar.attacks.layer7.timeseries_groups.http_method(\*\*params) -> TimeseriesGroupHTTPMethodResponse
-- client.radar.attacks.layer7.timeseries_groups.http_version(\*\*params) -> TimeseriesGroupHTTPVersionResponse
-- client.radar.attacks.layer7.timeseries_groups.industry(\*\*params) -> TimeseriesGroupIndustryResponse
-- client.radar.attacks.layer7.timeseries_groups.ip_version(\*\*params) -> TimeseriesGroupIPVersionResponse
-- client.radar.attacks.layer7.timeseries_groups.managed_rules(\*\*params) -> TimeseriesGroupManagedRulesResponse
-- client.radar.attacks.layer7.timeseries_groups.mitigation_product(\*\*params) -> TimeseriesGroupMitigationProductResponse
-- client.radar.attacks.layer7.timeseries_groups.vertical(\*\*params) -> TimeseriesGroupVerticalResponse
-
-#### Top
-
-Types:
-
-```python
-from cloudflare.types.radar.attacks.layer7 import (
- TopAttacksResponse,
- TopIndustryResponse,
- TopVerticalResponse,
-)
-```
-
-Methods:
-
-- client.radar.attacks.layer7.top.attacks(\*\*params) -> TopAttacksResponse
-- client.radar.attacks.layer7.top.industry(\*\*params) -> TopIndustryResponse
-- client.radar.attacks.layer7.top.vertical(\*\*params) -> TopVerticalResponse
-
-##### Locations
-
-Types:
-
-```python
-from cloudflare.types.radar.attacks.layer7.top import LocationOriginResponse, LocationTargetResponse
-```
-
-Methods:
-
-- client.radar.attacks.layer7.top.locations.origin(\*\*params) -> LocationOriginResponse
-- client.radar.attacks.layer7.top.locations.target(\*\*params) -> LocationTargetResponse
-
-##### Ases
-
-Types:
-
-```python
-from cloudflare.types.radar.attacks.layer7.top import AseOriginResponse
-```
-
-Methods:
-
-- client.radar.attacks.layer7.top.ases.origin(\*\*params) -> AseOriginResponse
-
-## Entities
-
-Types:
-
-```python
-from cloudflare.types.radar import EntityGetResponse
-```
-
-Methods:
-
-- client.radar.entities.get(\*\*params) -> EntityGetResponse
-
-### ASNs
-
-Types:
-
-```python
-from cloudflare.types.radar.entities import (
- ASNListResponse,
- ASNAsSetResponse,
- ASNGetResponse,
- ASNIPResponse,
- ASNRelResponse,
-)
-```
-
-Methods:
-
-- client.radar.entities.asns.list(\*\*params) -> ASNListResponse
-- client.radar.entities.asns.as_set(asn, \*\*params) -> ASNAsSetResponse
-- client.radar.entities.asns.get(asn, \*\*params) -> ASNGetResponse
-- client.radar.entities.asns.ip(\*\*params) -> ASNIPResponse
-- client.radar.entities.asns.rel(asn, \*\*params) -> ASNRelResponse
-
-### Locations
-
-Types:
-
-```python
-from cloudflare.types.radar.entities import LocationListResponse, LocationGetResponse
-```
-
-Methods:
-
-- client.radar.entities.locations.list(\*\*params) -> LocationListResponse
-- client.radar.entities.locations.get(location, \*\*params) -> LocationGetResponse
-
-## Geolocations
-
-Types:
-
-```python
-from cloudflare.types.radar import GeolocationListResponse, GeolocationGetResponse
-```
-
-Methods:
-
-- client.radar.geolocations.list(\*\*params) -> GeolocationListResponse
-- client.radar.geolocations.get(geo_id, \*\*params) -> GeolocationGetResponse
-
-## HTTP
-
-Types:
-
-```python
-from cloudflare.types.radar import (
- HTTPSummaryV2Response,
- HTTPTimeseriesResponse,
- HTTPTimeseriesGroupsV2Response,
-)
-```
-
-Methods:
-
-- client.radar.http.summary_v2(dimension, \*\*params) -> HTTPSummaryV2Response
-- client.radar.http.timeseries(\*\*params) -> HTTPTimeseriesResponse
-- client.radar.http.timeseries_groups_v2(dimension, \*\*params) -> HTTPTimeseriesGroupsV2Response
-
-### Locations
-
-Types:
-
-```python
-from cloudflare.types.radar.http import LocationGetResponse
-```
-
-Methods:
-
-- client.radar.http.locations.get(\*\*params) -> LocationGetResponse
-
-#### BotClass
-
-Types:
-
-```python
-from cloudflare.types.radar.http.locations import BotClassGetResponse
-```
-
-Methods:
-
-- client.radar.http.locations.bot_class.get(bot_class, \*\*params) -> BotClassGetResponse
-
-#### DeviceType
-
-Types:
-
-```python
-from cloudflare.types.radar.http.locations import DeviceTypeGetResponse
-```
-
-Methods:
-
-- client.radar.http.locations.device_type.get(device_type, \*\*params) -> DeviceTypeGetResponse
-
-#### HTTPProtocol
-
-Types:
-
-```python
-from cloudflare.types.radar.http.locations import HTTPProtocolGetResponse
-```
-
-Methods:
-
-- client.radar.http.locations.http_protocol.get(http_protocol, \*\*params) -> HTTPProtocolGetResponse
-
-#### HTTPMethod
-
-Types:
-
-```python
-from cloudflare.types.radar.http.locations import HTTPMethodGetResponse
-```
-
-Methods:
-
-- client.radar.http.locations.http_method.get(http_version, \*\*params) -> HTTPMethodGetResponse
-
-#### IPVersion
-
-Types:
-
-```python
-from cloudflare.types.radar.http.locations import IPVersionGetResponse
-```
-
-Methods:
-
-- client.radar.http.locations.ip_version.get(ip_version, \*\*params) -> IPVersionGetResponse
-
-#### OS
-
-Types:
-
-```python
-from cloudflare.types.radar.http.locations import OSGetResponse
-```
-
-Methods:
-
-- client.radar.http.locations.os.get(os, \*\*params) -> OSGetResponse
-
-#### TLSVersion
-
-Types:
-
-```python
-from cloudflare.types.radar.http.locations import TLSVersionGetResponse
-```
-
-Methods:
-
-- client.radar.http.locations.tls_version.get(tls_version, \*\*params) -> TLSVersionGetResponse
-
-#### BrowserFamily
-
-Types:
-
-```python
-from cloudflare.types.radar.http.locations import BrowserFamilyGetResponse
-```
-
-Methods:
-
-- client.radar.http.locations.browser_family.get(browser_family, \*\*params) -> BrowserFamilyGetResponse
-
-### Ases
-
-Types:
-
-```python
-from cloudflare.types.radar.http import AseGetResponse
-```
-
-Methods:
-
-- client.radar.http.ases.get(\*\*params) -> AseGetResponse
-
-#### BotClass
-
-Types:
-
-```python
-from cloudflare.types.radar.http.ases import BotClassGetResponse
-```
-
-Methods:
-
-- client.radar.http.ases.bot_class.get(bot_class, \*\*params) -> BotClassGetResponse
-
-#### DeviceType
-
-Types:
-
-```python
-from cloudflare.types.radar.http.ases import DeviceTypeGetResponse
-```
-
-Methods:
-
-- client.radar.http.ases.device_type.get(device_type, \*\*params) -> DeviceTypeGetResponse
-
-#### HTTPProtocol
-
-Types:
-
-```python
-from cloudflare.types.radar.http.ases import HTTPProtocolGetResponse
-```
-
-Methods:
-
-- client.radar.http.ases.http_protocol.get(http_protocol, \*\*params) -> HTTPProtocolGetResponse
-
-#### HTTPMethod
-
-Types:
-
-```python
-from cloudflare.types.radar.http.ases import HTTPMethodGetResponse
-```
-
-Methods:
-
-- client.radar.http.ases.http_method.get(http_version, \*\*params) -> HTTPMethodGetResponse
-
-#### IPVersion
-
-Types:
-
-```python
-from cloudflare.types.radar.http.ases import IPVersionGetResponse
-```
-
-Methods:
-
-- client.radar.http.ases.ip_version.get(ip_version, \*\*params) -> IPVersionGetResponse
-
-#### OS
-
-Types:
-
-```python
-from cloudflare.types.radar.http.ases import OSGetResponse
-```
-
-Methods:
-
-- client.radar.http.ases.os.get(os, \*\*params) -> OSGetResponse
-
-#### TLSVersion
-
-Types:
-
-```python
-from cloudflare.types.radar.http.ases import TLSVersionGetResponse
-```
-
-Methods:
-
-- client.radar.http.ases.tls_version.get(tls_version, \*\*params) -> TLSVersionGetResponse
-
-#### BrowserFamily
-
-Types:
-
-```python
-from cloudflare.types.radar.http.ases import BrowserFamilyGetResponse
-```
-
-Methods:
-
-- client.radar.http.ases.browser_family.get(browser_family, \*\*params) -> BrowserFamilyGetResponse
-
-### Summary
-
-Types:
-
-```python
-from cloudflare.types.radar.http import (
- SummaryBotClassResponse,
- SummaryDeviceTypeResponse,
- SummaryHTTPProtocolResponse,
- SummaryHTTPVersionResponse,
- SummaryIPVersionResponse,
- SummaryOSResponse,
- SummaryPostQuantumResponse,
- SummaryTLSVersionResponse,
-)
-```
-
-Methods:
-
-- client.radar.http.summary.bot_class(\*\*params) -> SummaryBotClassResponse
-- client.radar.http.summary.device_type(\*\*params) -> SummaryDeviceTypeResponse
-- client.radar.http.summary.http_protocol(\*\*params) -> SummaryHTTPProtocolResponse
-- client.radar.http.summary.http_version(\*\*params) -> SummaryHTTPVersionResponse
-- client.radar.http.summary.ip_version(\*\*params) -> SummaryIPVersionResponse
-- client.radar.http.summary.os(\*\*params) -> SummaryOSResponse
-- client.radar.http.summary.post_quantum(\*\*params) -> SummaryPostQuantumResponse
-- client.radar.http.summary.tls_version(\*\*params) -> SummaryTLSVersionResponse
-
-### TimeseriesGroups
-
-Types:
-
-```python
-from cloudflare.types.radar.http import (
- TimeseriesGroupBotClassResponse,
- TimeseriesGroupBrowserResponse,
- TimeseriesGroupBrowserFamilyResponse,
- TimeseriesGroupDeviceTypeResponse,
- TimeseriesGroupHTTPProtocolResponse,
- TimeseriesGroupHTTPVersionResponse,
- TimeseriesGroupIPVersionResponse,
- TimeseriesGroupOSResponse,
- TimeseriesGroupPostQuantumResponse,
- TimeseriesGroupTLSVersionResponse,
-)
-```
-
-Methods:
-
-- client.radar.http.timeseries_groups.bot_class(\*\*params) -> TimeseriesGroupBotClassResponse
-- client.radar.http.timeseries_groups.browser(\*\*params) -> TimeseriesGroupBrowserResponse
-- client.radar.http.timeseries_groups.browser_family(\*\*params) -> TimeseriesGroupBrowserFamilyResponse
-- client.radar.http.timeseries_groups.device_type(\*\*params) -> TimeseriesGroupDeviceTypeResponse
-- client.radar.http.timeseries_groups.http_protocol(\*\*params) -> TimeseriesGroupHTTPProtocolResponse
-- client.radar.http.timeseries_groups.http_version(\*\*params) -> TimeseriesGroupHTTPVersionResponse
-- client.radar.http.timeseries_groups.ip_version(\*\*params) -> TimeseriesGroupIPVersionResponse
-- client.radar.http.timeseries_groups.os(\*\*params) -> TimeseriesGroupOSResponse
-- client.radar.http.timeseries_groups.post_quantum(\*\*params) -> TimeseriesGroupPostQuantumResponse
-- client.radar.http.timeseries_groups.tls_version(\*\*params) -> TimeseriesGroupTLSVersionResponse
-
-### Top
-
-Types:
-
-```python
-from cloudflare.types.radar.http import TopBrowserResponse, TopBrowserFamilyResponse
-```
-
-Methods:
-
-- client.radar.http.top.browser(\*\*params) -> TopBrowserResponse
-- client.radar.http.top.browser_family(\*\*params) -> TopBrowserFamilyResponse
-
-## Quality
-
-### IQI
-
-Types:
-
-```python
-from cloudflare.types.radar.quality import IQISummaryResponse, IQITimeseriesGroupsResponse
-```
-
-Methods:
-
-- client.radar.quality.iqi.summary(\*\*params) -> IQISummaryResponse
-- client.radar.quality.iqi.timeseries_groups(\*\*params) -> IQITimeseriesGroupsResponse
-
-### Speed
-
-Types:
-
-```python
-from cloudflare.types.radar.quality import SpeedHistogramResponse, SpeedSummaryResponse
-```
-
-Methods:
-
-- client.radar.quality.speed.histogram(\*\*params) -> SpeedHistogramResponse
-- client.radar.quality.speed.summary(\*\*params) -> SpeedSummaryResponse
-
-#### Top
-
-Types:
-
-```python
-from cloudflare.types.radar.quality.speed import TopAsesResponse, TopLocationsResponse
-```
-
-Methods:
-
-- client.radar.quality.speed.top.ases(\*\*params) -> TopAsesResponse
-- client.radar.quality.speed.top.locations(\*\*params) -> TopLocationsResponse
-
-## Ranking
-
-Types:
-
-```python
-from cloudflare.types.radar import RankingTimeseriesGroupsResponse, RankingTopResponse
-```
-
-Methods:
-
-- client.radar.ranking.timeseries_groups(\*\*params) -> RankingTimeseriesGroupsResponse
-- client.radar.ranking.top(\*\*params) -> RankingTopResponse
-
-### Domain
-
-Types:
-
-```python
-from cloudflare.types.radar.ranking import DomainGetResponse
-```
-
-Methods:
-
-- client.radar.ranking.domain.get(domain, \*\*params) -> DomainGetResponse
-
-### InternetServices
-
-Types:
-
-```python
-from cloudflare.types.radar.ranking import (
- InternetServiceCategoriesResponse,
- InternetServiceTimeseriesGroupsResponse,
- InternetServiceTopResponse,
-)
-```
-
-Methods:
-
-- client.radar.ranking.internet_services.categories(\*\*params) -> InternetServiceCategoriesResponse
-- client.radar.ranking.internet_services.timeseries_groups(\*\*params) -> InternetServiceTimeseriesGroupsResponse
-- client.radar.ranking.internet_services.top(\*\*params) -> InternetServiceTopResponse
-
-## TrafficAnomalies
-
-Types:
-
-```python
-from cloudflare.types.radar import TrafficAnomalyGetResponse
-```
-
-Methods:
-
-- client.radar.traffic_anomalies.get(\*\*params) -> TrafficAnomalyGetResponse
-
-### Locations
-
-Types:
-
-```python
-from cloudflare.types.radar.traffic_anomalies import LocationGetResponse
-```
-
-Methods:
-
-- client.radar.traffic_anomalies.locations.get(\*\*params) -> LocationGetResponse
-
-## TCPResetsTimeouts
-
-Types:
-
-```python
-from cloudflare.types.radar import (
- TCPResetsTimeoutSummaryResponse,
- TCPResetsTimeoutTimeseriesGroupsResponse,
-)
-```
-
-Methods:
-
-- client.radar.tcp_resets_timeouts.summary(\*\*params) -> TCPResetsTimeoutSummaryResponse
-- client.radar.tcp_resets_timeouts.timeseries_groups(\*\*params) -> TCPResetsTimeoutTimeseriesGroupsResponse
-
-## RobotsTXT
-
-### Top
-
-Types:
-
-```python
-from cloudflare.types.radar.robots_txt import TopDomainCategoriesResponse
-```
-
-Methods:
-
-- client.radar.robots_txt.top.domain_categories(\*\*params) -> TopDomainCategoriesResponse
-
-#### UserAgents
-
-Types:
-
-```python
-from cloudflare.types.radar.robots_txt.top import UserAgentDirectiveResponse
-```
-
-Methods:
-
-- client.radar.robots_txt.top.user_agents.directive(\*\*params) -> UserAgentDirectiveResponse
-
-## LeakedCredentials
-
-Types:
-
-```python
-from cloudflare.types.radar import (
- LeakedCredentialSummaryV2Response,
- LeakedCredentialTimeseriesGroupsV2Response,
-)
-```
-
-Methods:
-
-- client.radar.leaked_credentials.summary_v2(dimension, \*\*params) -> LeakedCredentialSummaryV2Response
-- client.radar.leaked_credentials.timeseries_groups_v2(dimension, \*\*params) -> LeakedCredentialTimeseriesGroupsV2Response
-
-### Summary
-
-Types:
-
-```python
-from cloudflare.types.radar.leaked_credentials import (
- SummaryBotClassResponse,
- SummaryCompromisedResponse,
-)
-```
-
-Methods:
-
-- client.radar.leaked_credentials.summary.bot_class(\*\*params) -> SummaryBotClassResponse
-- client.radar.leaked_credentials.summary.compromised(\*\*params) -> SummaryCompromisedResponse
-
-### TimeseriesGroups
-
-Types:
-
-```python
-from cloudflare.types.radar.leaked_credentials import (
- TimeseriesGroupBotClassResponse,
- TimeseriesGroupCompromisedResponse,
-)
-```
-
-Methods:
-
-- client.radar.leaked_credentials.timeseries_groups.bot_class(\*\*params) -> TimeseriesGroupBotClassResponse
-- client.radar.leaked_credentials.timeseries_groups.compromised(\*\*params) -> TimeseriesGroupCompromisedResponse
-
-# BotManagement
-
-Types:
-
-```python
-from cloudflare.types.bot_management import (
- BotFightModeConfiguration,
- SubscriptionConfiguration,
- SuperBotFightModeDefinitelyConfiguration,
- SuperBotFightModeLikelyConfiguration,
- BotManagementUpdateResponse,
- BotManagementGetResponse,
-)
-```
-
-Methods:
-
-- client.bot_management.update(\*, zone_id, \*\*params) -> Optional[BotManagementUpdateResponse]
-- client.bot_management.get(\*, zone_id) -> Optional[BotManagementGetResponse]
-
-# Fraud
-
-Types:
-
-```python
-from cloudflare.types.fraud import FraudSettings
-```
-
-Methods:
-
-- client.fraud.update(\*, zone_id, \*\*params) -> Optional[FraudSettings]
-- client.fraud.get(\*, zone_id) -> Optional[FraudSettings]
-
-# OriginPostQuantumEncryption
-
-Types:
-
-```python
-from cloudflare.types.origin_post_quantum_encryption import (
- OriginPostQuantumEncryptionUpdateResponse,
- OriginPostQuantumEncryptionGetResponse,
-)
-```
-
-Methods:
-
-- client.origin_post_quantum_encryption.update(\*, zone_id, \*\*params) -> Optional[OriginPostQuantumEncryptionUpdateResponse]
-- client.origin_post_quantum_encryption.get(\*, zone_id) -> Optional[OriginPostQuantumEncryptionGetResponse]
-
-# Zaraz
-
-Types:
-
-```python
-from cloudflare.types.zaraz import ButtonTextTranslation, NeoEvent
-```
-
-Methods:
-
-- client.zaraz.update(\*, zone_id, \*\*params) -> Workflow
-
-## Config
-
-Types:
-
-```python
-from cloudflare.types.zaraz import Configuration
-```
-
-Methods:
-
-- client.zaraz.config.update(\*, zone_id, \*\*params) -> Configuration
-- client.zaraz.config.get(\*, zone_id) -> Configuration
-
-## Default
-
-Methods:
-
-- client.zaraz.default.get(\*, zone_id) -> Configuration
-
-## Export
-
-Methods:
-
-- client.zaraz.export.get(\*, zone_id) -> Configuration
-
-## History
-
-Types:
-
-```python
-from cloudflare.types.zaraz import HistoryListResponse
-```
-
-Methods:
-
-- client.zaraz.history.update(\*, zone_id, \*\*params) -> Configuration
-- client.zaraz.history.list(\*, zone_id, \*\*params) -> SyncSinglePage[HistoryListResponse]
-
-### Configs
-
-Types:
-
-```python
-from cloudflare.types.zaraz.history import ConfigGetResponse
-```
-
-Methods:
-
-- client.zaraz.history.configs.get(\*, zone_id, \*\*params) -> ConfigGetResponse
-
-## Publish
-
-Types:
-
-```python
-from cloudflare.types.zaraz import PublishCreateResponse
-```
-
-Methods:
-
-- client.zaraz.publish.create(\*, zone_id, \*\*params) -> str
-
-## Workflow
-
-Types:
-
-```python
-from cloudflare.types.zaraz import Workflow
-```
-
-Methods:
-
-- client.zaraz.workflow.get(\*, zone_id) -> Workflow
-
-# Speed
-
-Types:
-
-```python
-from cloudflare.types.speed import LabeledRegion, LighthouseReport, Trend
-```
-
-## Schedule
-
-Types:
-
-```python
-from cloudflare.types.speed import Schedule, ScheduleCreateResponse, ScheduleDeleteResponse
-```
-
-Methods:
-
-- client.speed.schedule.create(url, \*, zone_id, \*\*params) -> Optional[ScheduleCreateResponse]
-- client.speed.schedule.delete(url, \*, zone_id, \*\*params) -> Optional[ScheduleDeleteResponse]
-- client.speed.schedule.get(url, \*, zone_id, \*\*params) -> Optional[Schedule]
-
-## Availabilities
-
-Types:
-
-```python
-from cloudflare.types.speed import Availability
-```
-
-Methods:
-
-- client.speed.availabilities.list(\*, zone_id) -> Optional[Availability]
-
-## Pages
-
-Types:
-
-```python
-from cloudflare.types.speed import PageListResponse
-```
-
-Methods:
-
-- client.speed.pages.list(\*, zone_id) -> SyncSinglePage[PageListResponse]
-- client.speed.pages.trend(url, \*, zone_id, \*\*params) -> Optional[Trend]
-
-### Tests
-
-Types:
-
-```python
-from cloudflare.types.speed.pages import Test, TestDeleteResponse
-```
-
-Methods:
-
-- client.speed.pages.tests.create(url, \*, zone_id, \*\*params) -> Optional[Test]
-- client.speed.pages.tests.list(url, \*, zone_id, \*\*params) -> SyncV4PagePaginationArray[Test]
-- client.speed.pages.tests.delete(url, \*, zone_id, \*\*params) -> Optional[TestDeleteResponse]
-- client.speed.pages.tests.get(test_id, \*, zone_id, url) -> Optional[Test]
-
-# DCVDelegation
-
-Types:
-
-```python
-from cloudflare.types.dcv_delegation import DCVDelegationUUID
-```
-
-Methods:
-
-- client.dcv_delegation.get(\*, zone_id) -> Optional[DCVDelegationUUID]
-
-# Hostnames
-
-## Settings
-
-### TLS
-
-Types:
-
-```python
-from cloudflare.types.hostnames.settings import (
- Setting,
- SettingValue,
- TLSDeleteResponse,
- TLSGetResponse,
-)
-```
-
-Methods:
-
-- client.hostnames.settings.tls.update(hostname, \*, zone_id, setting_id, \*\*params) -> Optional[Setting]
-- client.hostnames.settings.tls.delete(hostname, \*, zone_id, setting_id) -> Optional[TLSDeleteResponse]
-- client.hostnames.settings.tls.get(setting_id, \*, zone_id) -> SyncSinglePage[TLSGetResponse]
-
-# Snippets
-
-Types:
-
-```python
-from cloudflare.types.snippets import (
- SnippetUpdateResponse,
- SnippetListResponse,
- SnippetDeleteResponse,
- SnippetGetResponse,
-)
-```
-
-Methods:
-
-- client.snippets.update(snippet_name, \*, zone_id, \*\*params) -> SnippetUpdateResponse
-- client.snippets.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[SnippetListResponse]
-- client.snippets.delete(snippet_name, \*, zone_id) -> str
-- client.snippets.get(snippet_name, \*, zone_id) -> SnippetGetResponse
-
-## Content
-
-Methods:
-
-- client.snippets.content.get(snippet_name, \*, zone_id) -> BinaryAPIResponse
-
-## Rules
-
-Types:
-
-```python
-from cloudflare.types.snippets import RuleUpdateResponse, RuleListResponse, RuleDeleteResponse
-```
-
-Methods:
-
-- client.snippets.rules.update(\*, zone_id, \*\*params) -> SyncSinglePage[RuleUpdateResponse]
-- client.snippets.rules.list(\*, zone_id) -> SyncSinglePage[RuleListResponse]
-- client.snippets.rules.delete(\*, zone_id) -> SyncSinglePage[RuleDeleteResponse]
-
-# RealtimeKit
-
-## Apps
-
-Types:
-
-```python
-from cloudflare.types.realtime_kit import AppGetResponse, AppPostResponse
-```
-
-Methods:
-
-- client.realtime_kit.apps.get(\*, account_id) -> AppGetResponse
-- client.realtime_kit.apps.post(\*, account_id, \*\*params) -> AppPostResponse
-
-## Meetings
-
-Types:
-
-```python
-from cloudflare.types.realtime_kit import (
- MeetingCreateResponse,
- MeetingAddParticipantResponse,
- MeetingDeleteMeetingParticipantResponse,
- MeetingEditParticipantResponse,
- MeetingGetResponse,
- MeetingGetMeetingByIDResponse,
- MeetingGetMeetingParticipantResponse,
- MeetingGetMeetingParticipantsResponse,
- MeetingRefreshParticipantTokenResponse,
- MeetingReplaceMeetingByIDResponse,
- MeetingUpdateMeetingByIDResponse,
-)
-```
-
-Methods:
-
-- client.realtime_kit.meetings.create(app_id, \*, account_id, \*\*params) -> MeetingCreateResponse
-- client.realtime_kit.meetings.add_participant(meeting_id, \*, account_id, app_id, \*\*params) -> MeetingAddParticipantResponse
-- client.realtime_kit.meetings.delete_meeting_participant(participant_id, \*, account_id, app_id, meeting_id) -> MeetingDeleteMeetingParticipantResponse
-- client.realtime_kit.meetings.edit_participant(participant_id, \*, account_id, app_id, meeting_id, \*\*params) -> MeetingEditParticipantResponse
-- client.realtime_kit.meetings.get(app_id, \*, account_id, \*\*params) -> MeetingGetResponse
-- client.realtime_kit.meetings.get_meeting_by_id(meeting_id, \*, account_id, app_id, \*\*params) -> MeetingGetMeetingByIDResponse
-- client.realtime_kit.meetings.get_meeting_participant(participant_id, \*, account_id, app_id, meeting_id) -> MeetingGetMeetingParticipantResponse
-- client.realtime_kit.meetings.get_meeting_participants(meeting_id, \*, account_id, app_id, \*\*params) -> MeetingGetMeetingParticipantsResponse
-- client.realtime_kit.meetings.refresh_participant_token(participant_id, \*, account_id, app_id, meeting_id) -> MeetingRefreshParticipantTokenResponse
-- client.realtime_kit.meetings.replace_meeting_by_id(meeting_id, \*, account_id, app_id, \*\*params) -> MeetingReplaceMeetingByIDResponse
-- client.realtime_kit.meetings.update_meeting_by_id(meeting_id, \*, account_id, app_id, \*\*params) -> MeetingUpdateMeetingByIDResponse
-
-## Presets
-
-Types:
-
-```python
-from cloudflare.types.realtime_kit import (
- PresetCreateResponse,
- PresetUpdateResponse,
- PresetDeleteResponse,
- PresetGetResponse,
- PresetGetPresetByIDResponse,
-)
-```
-
-Methods:
-
-- client.realtime_kit.presets.create(app_id, \*, account_id, \*\*params) -> PresetCreateResponse
-- client.realtime_kit.presets.update(preset_id, \*, account_id, app_id, \*\*params) -> PresetUpdateResponse
-- client.realtime_kit.presets.delete(preset_id, \*, account_id, app_id) -> PresetDeleteResponse
-- client.realtime_kit.presets.get(app_id, \*, account_id, \*\*params) -> PresetGetResponse
-- client.realtime_kit.presets.get_preset_by_id(preset_id, \*, account_id, app_id) -> PresetGetPresetByIDResponse
-
-## Sessions
-
-Types:
-
-```python
-from cloudflare.types.realtime_kit import (
- SessionGetParticipantDataFromPeerIDResponse,
- SessionGetSessionChatResponse,
- SessionGetSessionDetailsResponse,
- SessionGetSessionParticipantDetailsResponse,
- SessionGetSessionParticipantsResponse,
- SessionGetSessionSummaryResponse,
- SessionGetSessionTranscriptsResponse,
- SessionGetSessionsResponse,
-)
-```
-
-Methods:
-
-- client.realtime_kit.sessions.generate_summary_of_transcripts(session_id, \*, account_id, app_id) -> None
-- client.realtime_kit.sessions.get_participant_data_from_peer_id(peer_id, \*, account_id, app_id, \*\*params) -> SessionGetParticipantDataFromPeerIDResponse
-- client.realtime_kit.sessions.get_session_chat(session_id, \*, account_id, app_id) -> SessionGetSessionChatResponse
-- client.realtime_kit.sessions.get_session_details(session_id, \*, account_id, app_id, \*\*params) -> SessionGetSessionDetailsResponse
-- client.realtime_kit.sessions.get_session_participant_details(participant_id, \*, account_id, app_id, session_id, \*\*params) -> SessionGetSessionParticipantDetailsResponse
-- client.realtime_kit.sessions.get_session_participants(session_id, \*, account_id, app_id, \*\*params) -> SessionGetSessionParticipantsResponse
-- client.realtime_kit.sessions.get_session_summary(session_id, \*, account_id, app_id) -> SessionGetSessionSummaryResponse
-- client.realtime_kit.sessions.get_session_transcripts(session_id, \*, account_id, app_id) -> SessionGetSessionTranscriptsResponse
-- client.realtime_kit.sessions.get_sessions(app_id, \*, account_id, \*\*params) -> SessionGetSessionsResponse
-
-## Recordings
-
-Types:
-
-```python
-from cloudflare.types.realtime_kit import (
- RecordingGetActiveRecordingsResponse,
- RecordingGetOneRecordingResponse,
- RecordingGetRecordingsResponse,
- RecordingPauseResumeStopRecordingResponse,
- RecordingStartRecordingsResponse,
-)
-```
-
-Methods:
-
-- client.realtime_kit.recordings.get_active_recordings(meeting_id, \*, account_id, app_id) -> RecordingGetActiveRecordingsResponse
-- client.realtime_kit.recordings.get_one_recording(recording_id, \*, account_id, app_id) -> RecordingGetOneRecordingResponse
-- client.realtime_kit.recordings.get_recordings(app_id, \*, account_id, \*\*params) -> RecordingGetRecordingsResponse
-- client.realtime_kit.recordings.pause_resume_stop_recording(recording_id, \*, account_id, app_id, \*\*params) -> RecordingPauseResumeStopRecordingResponse
-- client.realtime_kit.recordings.start_recordings(app_id, \*, account_id, \*\*params) -> RecordingStartRecordingsResponse
-- client.realtime_kit.recordings.start_track_recording(app_id, \*, account_id, \*\*params) -> None
-
-## Webhooks
-
-Types:
-
-```python
-from cloudflare.types.realtime_kit import (
- WebhookCreateWebhookResponse,
- WebhookDeleteWebhookResponse,
- WebhookEditWebhookResponse,
- WebhookGetWebhookByIDResponse,
- WebhookGetWebhooksResponse,
- WebhookReplaceWebhookResponse,
-)
-```
-
-Methods:
-
-- client.realtime_kit.webhooks.create_webhook(app_id, \*, account_id, \*\*params) -> WebhookCreateWebhookResponse
-- client.realtime_kit.webhooks.delete_webhook(webhook_id, \*, account_id, app_id) -> WebhookDeleteWebhookResponse
-- client.realtime_kit.webhooks.edit_webhook(webhook_id, \*, account_id, app_id, \*\*params) -> WebhookEditWebhookResponse
-- client.realtime_kit.webhooks.get_webhook_by_id(webhook_id, \*, account_id, app_id) -> WebhookGetWebhookByIDResponse
-- client.realtime_kit.webhooks.get_webhooks(app_id, \*, account_id) -> WebhookGetWebhooksResponse
-- client.realtime_kit.webhooks.replace_webhook(webhook_id, \*, account_id, app_id, \*\*params) -> WebhookReplaceWebhookResponse
-
-## ActiveSession
-
-Types:
-
-```python
-from cloudflare.types.realtime_kit import (
- ActiveSessionCreatePollResponse,
- ActiveSessionGetActiveSessionResponse,
- ActiveSessionKickAllParticipantsResponse,
- ActiveSessionKickParticipantsResponse,
-)
-```
-
-Methods:
-
-- client.realtime_kit.active_session.create_poll(meeting_id, \*, account_id, app_id, \*\*params) -> ActiveSessionCreatePollResponse
-- client.realtime_kit.active_session.get_active_session(meeting_id, \*, account_id, app_id) -> ActiveSessionGetActiveSessionResponse
-- client.realtime_kit.active_session.kick_all_participants(meeting_id, \*, account_id, app_id) -> ActiveSessionKickAllParticipantsResponse
-- client.realtime_kit.active_session.kick_participants(meeting_id, \*, account_id, app_id, \*\*params) -> ActiveSessionKickParticipantsResponse
-
-## Livestreams
-
-Types:
-
-```python
-from cloudflare.types.realtime_kit import (
- LivestreamCreateIndependentLivestreamResponse,
- LivestreamGetActiveLivestreamsForLivestreamIDResponse,
- LivestreamGetAllLivestreamsResponse,
- LivestreamGetLivestreamAnalyticsCompleteResponse,
- LivestreamGetLivestreamSessionDetailsForSessionIDResponse,
- LivestreamGetLivestreamSessionForLivestreamIDResponse,
- LivestreamGetMeetingActiveLivestreamsResponse,
- LivestreamGetOrgAnalyticsResponse,
- LivestreamStartLivestreamingAMeetingResponse,
- LivestreamStopLivestreamingAMeetingResponse,
-)
-```
-
-Methods:
-
-- client.realtime_kit.livestreams.create_independent_livestream(app_id, \*, account_id, \*\*params) -> LivestreamCreateIndependentLivestreamResponse
-- client.realtime_kit.livestreams.get_active_livestreams_for_livestream_id(livestream_id, \*, account_id, app_id) -> LivestreamGetActiveLivestreamsForLivestreamIDResponse
-- client.realtime_kit.livestreams.get_all_livestreams(app_id, \*, account_id, \*\*params) -> LivestreamGetAllLivestreamsResponse
-- client.realtime_kit.livestreams.get_livestream_analytics_complete(app_id, \*, account_id, \*\*params) -> LivestreamGetLivestreamAnalyticsCompleteResponse
-- client.realtime_kit.livestreams.get_livestream_session_details_for_session_id(livestream_session_id, \*, account_id, app_id) -> LivestreamGetLivestreamSessionDetailsForSessionIDResponse
-- client.realtime_kit.livestreams.get_livestream_session_for_livestream_id(livestream_id, \*, account_id, app_id, \*\*params) -> LivestreamGetLivestreamSessionForLivestreamIDResponse
-- client.realtime_kit.livestreams.get_meeting_active_livestreams(meeting_id, \*, account_id, app_id) -> LivestreamGetMeetingActiveLivestreamsResponse
-- client.realtime_kit.livestreams.get_org_analytics(app_id, \*, account_id, \*\*params) -> LivestreamGetOrgAnalyticsResponse
-- client.realtime_kit.livestreams.start_livestreaming_a_meeting(meeting_id, \*, account_id, app_id, \*\*params) -> LivestreamStartLivestreamingAMeetingResponse
-- client.realtime_kit.livestreams.stop_livestreaming_a_meeting(meeting_id, \*, account_id, app_id) -> LivestreamStopLivestreamingAMeetingResponse
-
-## Analytics
-
-Types:
-
-```python
-from cloudflare.types.realtime_kit import AnalyticsGetOrgAnalyticsResponse
-```
-
-Methods:
-
-- client.realtime_kit.analytics.get_org_analytics(app_id, \*, account_id, \*\*params) -> AnalyticsGetOrgAnalyticsResponse
-
-# Calls
-
-## SFU
-
-Types:
-
-```python
-from cloudflare.types.calls import (
- SFUCreateResponse,
- SFUUpdateResponse,
- SFUListResponse,
- SFUDeleteResponse,
- SFUGetResponse,
-)
-```
-
-Methods:
-
-- client.calls.sfu.create(\*, account_id, \*\*params) -> Optional[SFUCreateResponse]
-- client.calls.sfu.update(app_id, \*, account_id, \*\*params) -> Optional[SFUUpdateResponse]
-- client.calls.sfu.list(\*, account_id) -> SyncSinglePage[SFUListResponse]
-- client.calls.sfu.delete(app_id, \*, account_id) -> Optional[SFUDeleteResponse]
-- client.calls.sfu.get(app_id, \*, account_id) -> Optional[SFUGetResponse]
-
-## TURN
-
-Types:
-
-```python
-from cloudflare.types.calls import (
- TURNCreateResponse,
- TURNUpdateResponse,
- TURNListResponse,
- TURNDeleteResponse,
- TURNGetResponse,
-)
-```
-
-Methods:
-
-- client.calls.turn.create(\*, account_id, \*\*params) -> Optional[TURNCreateResponse]
-- client.calls.turn.update(key_id, \*, account_id, \*\*params) -> Optional[TURNUpdateResponse]
-- client.calls.turn.list(\*, account_id) -> SyncSinglePage[TURNListResponse]
-- client.calls.turn.delete(key_id, \*, account_id) -> Optional[TURNDeleteResponse]
-- client.calls.turn.get(key_id, \*, account_id) -> Optional[TURNGetResponse]
-
-# CloudforceOne
-
-## Scans
-
-### Results
-
-Types:
-
-```python
-from cloudflare.types.cloudforce_one.scans import ScanResult, ResultGetResponse
-```
-
-Methods:
-
-- client.cloudforce_one.scans.results.get(config_id, \*, account_id) -> ResultGetResponse
-
-### Config
-
-Types:
-
-```python
-from cloudflare.types.cloudforce_one.scans import (
- ConfigCreateResponse,
- ConfigListResponse,
- ConfigEditResponse,
-)
-```
-
-Methods:
-
-- client.cloudforce_one.scans.config.create(\*, account_id, \*\*params) -> Optional[ConfigCreateResponse]
-- client.cloudforce_one.scans.config.list(\*, account_id) -> SyncSinglePage[ConfigListResponse]
-- client.cloudforce_one.scans.config.delete(config_id, \*, account_id) -> object
-- client.cloudforce_one.scans.config.edit(config_id, \*, account_id, \*\*params) -> Optional[ConfigEditResponse]
-
-## BinaryStorage
-
-Types:
-
-```python
-from cloudflare.types.cloudforce_one import BinaryStorageCreateResponse
-```
-
-Methods:
-
-- client.cloudforce_one.binary_storage.create(\*, account_id, \*\*params) -> BinaryStorageCreateResponse
-- client.cloudforce_one.binary_storage.get(hash, \*, account_id) -> None
-
-## Requests
-
-Types:
-
-```python
-from cloudflare.types.cloudforce_one import (
- Item,
- ListItem,
- Quota,
- RequestConstants,
- RequestTypes,
- RequestDeleteResponse,
- RequestTypesResponse,
-)
-```
-
-Methods:
-
-- client.cloudforce_one.requests.create(\*, account_id, \*\*params) -> Optional[Item]
-- client.cloudforce_one.requests.update(request_id, \*, account_id, \*\*params) -> Optional[Item]
-- client.cloudforce_one.requests.list(\*, account_id, \*\*params) -> SyncSinglePage[ListItem]
-- client.cloudforce_one.requests.delete(request_id, \*, account_id) -> RequestDeleteResponse
-- client.cloudforce_one.requests.constants(\*, account_id) -> Optional[RequestConstants]
-- client.cloudforce_one.requests.get(request_id, \*, account_id) -> Optional[Item]
-- client.cloudforce_one.requests.quota(\*, account_id) -> Optional[Quota]
-- client.cloudforce_one.requests.types(\*, account_id) -> SyncSinglePage[RequestTypesResponse]
-
-### Message
-
-Types:
-
-```python
-from cloudflare.types.cloudforce_one.requests import Message, MessageDeleteResponse
-```
-
-Methods:
-
-- client.cloudforce_one.requests.message.create(request_id, \*, account_id, \*\*params) -> Optional[Message]
-- client.cloudforce_one.requests.message.update(message_id, \*, account_id, request_id, \*\*params) -> Optional[Message]
-- client.cloudforce_one.requests.message.delete(message_id, \*, account_id, request_id) -> MessageDeleteResponse
-- client.cloudforce_one.requests.message.get(request_id, \*, account_id, \*\*params) -> SyncSinglePage[Message]
-
-### Priority
-
-Types:
-
-```python
-from cloudflare.types.cloudforce_one.requests import (
- Label,
- Priority,
- PriorityEdit,
- PriorityDeleteResponse,
-)
-```
-
-Methods:
-
-- client.cloudforce_one.requests.priority.create(\*, account_id, \*\*params) -> Optional[Priority]
-- client.cloudforce_one.requests.priority.update(priority_id, \*, account_id, \*\*params) -> Optional[Item]
-- client.cloudforce_one.requests.priority.delete(priority_id, \*, account_id) -> PriorityDeleteResponse
-- client.cloudforce_one.requests.priority.get(priority_id, \*, account_id) -> Optional[Item]
-- client.cloudforce_one.requests.priority.quota(\*, account_id) -> Optional[Quota]
-
-### Assets
-
-Types:
-
-```python
-from cloudflare.types.cloudforce_one.requests import (
- AssetCreateResponse,
- AssetUpdateResponse,
- AssetDeleteResponse,
- AssetGetResponse,
-)
-```
-
-Methods:
-
-- client.cloudforce_one.requests.assets.create(request_id, \*, account_id, \*\*params) -> SyncSinglePage[AssetCreateResponse]
-- client.cloudforce_one.requests.assets.update(asset_id, \*, account_id, request_id, \*\*params) -> Optional[AssetUpdateResponse]
-- client.cloudforce_one.requests.assets.delete(asset_id, \*, account_id, request_id) -> AssetDeleteResponse
-- client.cloudforce_one.requests.assets.get(asset_id, \*, account_id, request_id) -> SyncSinglePage[AssetGetResponse]
-
-## ThreatEvents
-
-Types:
-
-```python
-from cloudflare.types.cloudforce_one import (
- ThreatEventCreateResponse,
- ThreatEventListResponse,
- ThreatEventDeleteResponse,
- ThreatEventBulkCreateResponse,
- ThreatEventEditResponse,
- ThreatEventGetResponse,
-)
-```
-
-Methods:
-
-- client.cloudforce_one.threat_events.create(\*, path_account_id, \*\*params) -> ThreatEventCreateResponse
-- client.cloudforce_one.threat_events.list(\*, account_id, \*\*params) -> ThreatEventListResponse
-- client.cloudforce_one.threat_events.delete(event_id, \*, account_id) -> ThreatEventDeleteResponse
-- client.cloudforce_one.threat_events.bulk_create(\*, account_id, \*\*params) -> ThreatEventBulkCreateResponse
-- client.cloudforce_one.threat_events.edit(event_id, \*, account_id, \*\*params) -> ThreatEventEditResponse
-- client.cloudforce_one.threat_events.get(event_id, \*, account_id) -> ThreatEventGetResponse
-
-### Attackers
-
-Types:
-
-```python
-from cloudflare.types.cloudforce_one.threat_events import AttackerListResponse
-```
-
-Methods:
-
-- client.cloudforce_one.threat_events.attackers.list(\*, account_id, \*\*params) -> AttackerListResponse
-
-### Categories
-
-Types:
-
-```python
-from cloudflare.types.cloudforce_one.threat_events import (
- CategoryCreateResponse,
- CategoryListResponse,
- CategoryDeleteResponse,
- CategoryEditResponse,
- CategoryGetResponse,
-)
-```
-
-Methods:
-
-- client.cloudforce_one.threat_events.categories.create(\*, account_id, \*\*params) -> CategoryCreateResponse
-- client.cloudforce_one.threat_events.categories.list(\*, account_id, \*\*params) -> CategoryListResponse
-- client.cloudforce_one.threat_events.categories.delete(category_id, \*, account_id) -> CategoryDeleteResponse
-- client.cloudforce_one.threat_events.categories.edit(category_id, \*, account_id, \*\*params) -> CategoryEditResponse
-- client.cloudforce_one.threat_events.categories.get(category_id, \*, account_id) -> CategoryGetResponse
-
-### Countries
-
-Types:
-
-```python
-from cloudflare.types.cloudforce_one.threat_events import CountryListResponse
-```
-
-Methods:
-
-- client.cloudforce_one.threat_events.countries.list(\*, account_id) -> CountryListResponse
-
-### Datasets
-
-Types:
-
-```python
-from cloudflare.types.cloudforce_one.threat_events import (
- DatasetCreateResponse,
- DatasetListResponse,
- DatasetEditResponse,
- DatasetGetResponse,
- DatasetRawResponse,
-)
-```
-
-Methods:
-
-- client.cloudforce_one.threat_events.datasets.create(\*, account_id, \*\*params) -> DatasetCreateResponse
-- client.cloudforce_one.threat_events.datasets.list(\*, account_id) -> DatasetListResponse
-- client.cloudforce_one.threat_events.datasets.edit(dataset_id, \*, account_id, \*\*params) -> DatasetEditResponse
-- client.cloudforce_one.threat_events.datasets.get(dataset_id, \*, account_id) -> DatasetGetResponse
-- client.cloudforce_one.threat_events.datasets.raw(event_id, \*, account_id, dataset_id) -> DatasetRawResponse
-
-### IndicatorTypes
-
-Types:
-
-```python
-from cloudflare.types.cloudforce_one.threat_events import IndicatorTypeListResponse
-```
-
-Methods:
-
-- client.cloudforce_one.threat_events.indicator_types.list(\*, account_id) -> IndicatorTypeListResponse
-
-### Raw
-
-Types:
-
-```python
-from cloudflare.types.cloudforce_one.threat_events import RawEditResponse, RawGetResponse
-```
-
-Methods:
-
-- client.cloudforce_one.threat_events.raw.edit(raw_id, \*, account_id, event_id, \*\*params) -> RawEditResponse
-- client.cloudforce_one.threat_events.raw.get(raw_id, \*, account_id, event_id) -> RawGetResponse
-
-### Relate
-
-Types:
-
-```python
-from cloudflare.types.cloudforce_one.threat_events import RelateDeleteResponse
-```
-
-Methods:
-
-- client.cloudforce_one.threat_events.relate.delete(event_id, \*, account_id) -> RelateDeleteResponse
-
-### Tags
-
-Types:
-
-```python
-from cloudflare.types.cloudforce_one.threat_events import TagCreateResponse
-```
-
-Methods:
-
-- client.cloudforce_one.threat_events.tags.create(\*, account_id, \*\*params) -> TagCreateResponse
-
-### EventTags
-
-Types:
-
-```python
-from cloudflare.types.cloudforce_one.threat_events import (
- EventTagCreateResponse,
- EventTagDeleteResponse,
-)
-```
-
-Methods:
-
-- client.cloudforce_one.threat_events.event_tags.create(event_id, \*, account_id, \*\*params) -> EventTagCreateResponse
-- client.cloudforce_one.threat_events.event_tags.delete(event_id, \*, account_id) -> EventTagDeleteResponse
-
-### TargetIndustries
-
-Types:
-
-```python
-from cloudflare.types.cloudforce_one.threat_events import TargetIndustryListResponse
-```
-
-Methods:
-
-- client.cloudforce_one.threat_events.target_industries.list(\*, account_id, \*\*params) -> TargetIndustryListResponse
-
-# AIGateway
-
-Types:
-
-```python
-from cloudflare.types.ai_gateway import (
- AIGatewayCreateResponse,
- AIGatewayUpdateResponse,
- AIGatewayListResponse,
- AIGatewayDeleteResponse,
- AIGatewayGetResponse,
-)
-```
-
-Methods:
-
-- client.ai_gateway.create(\*, account_id, \*\*params) -> AIGatewayCreateResponse
-- client.ai_gateway.update(id, \*, account_id, \*\*params) -> AIGatewayUpdateResponse
-- client.ai_gateway.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[AIGatewayListResponse]
-- client.ai_gateway.delete(id, \*, account_id) -> AIGatewayDeleteResponse
-- client.ai_gateway.get(id, \*, account_id) -> AIGatewayGetResponse
-
-## EvaluationTypes
-
-Types:
-
-```python
-from cloudflare.types.ai_gateway import EvaluationTypeListResponse
-```
-
-Methods:
-
-- client.ai_gateway.evaluation_types.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[EvaluationTypeListResponse]
-
-## Logs
-
-Types:
-
-```python
-from cloudflare.types.ai_gateway import LogListResponse, LogDeleteResponse, LogGetResponse
-```
-
-Methods:
-
-- client.ai_gateway.logs.list(gateway_id, \*, account_id, \*\*params) -> SyncV4PagePaginationArray[LogListResponse]
-- client.ai_gateway.logs.delete(gateway_id, \*, account_id, \*\*params) -> LogDeleteResponse
-- client.ai_gateway.logs.edit(id, \*, account_id, gateway_id, \*\*params) -> object
-- client.ai_gateway.logs.get(id, \*, account_id, gateway_id) -> LogGetResponse
-- client.ai_gateway.logs.request(id, \*, account_id, gateway_id) -> object
-- client.ai_gateway.logs.response(id, \*, account_id, gateway_id) -> object
-
-## Datasets
-
-Types:
-
-```python
-from cloudflare.types.ai_gateway import (
- DatasetCreateResponse,
- DatasetUpdateResponse,
- DatasetListResponse,
- DatasetDeleteResponse,
- DatasetGetResponse,
-)
-```
-
-Methods:
-
-- client.ai_gateway.datasets.create(gateway_id, \*, account_id, \*\*params) -> DatasetCreateResponse
-- client.ai_gateway.datasets.update(id, \*, account_id, gateway_id, \*\*params) -> DatasetUpdateResponse
-- client.ai_gateway.datasets.list(gateway_id, \*, account_id, \*\*params) -> SyncV4PagePaginationArray[DatasetListResponse]
-- client.ai_gateway.datasets.delete(id, \*, account_id, gateway_id) -> DatasetDeleteResponse
-- client.ai_gateway.datasets.get(id, \*, account_id, gateway_id) -> DatasetGetResponse
-
-## Evaluations
-
-Types:
-
-```python
-from cloudflare.types.ai_gateway import (
- EvaluationCreateResponse,
- EvaluationListResponse,
- EvaluationDeleteResponse,
- EvaluationGetResponse,
-)
-```
-
-Methods:
-
-- client.ai_gateway.evaluations.create(gateway_id, \*, account_id, \*\*params) -> EvaluationCreateResponse
-- client.ai_gateway.evaluations.list(gateway_id, \*, account_id, \*\*params) -> SyncV4PagePaginationArray[EvaluationListResponse]
-- client.ai_gateway.evaluations.delete(id, \*, account_id, gateway_id) -> EvaluationDeleteResponse
-- client.ai_gateway.evaluations.get(id, \*, account_id, gateway_id) -> EvaluationGetResponse
-
-## DynamicRouting
-
-Types:
-
-```python
-from cloudflare.types.ai_gateway import (
- DynamicRoutingCreateResponse,
- DynamicRoutingUpdateResponse,
- DynamicRoutingListResponse,
- DynamicRoutingDeleteResponse,
- DynamicRoutingCreateDeploymentResponse,
- DynamicRoutingCreateVersionResponse,
- DynamicRoutingGetResponse,
- DynamicRoutingGetVersionResponse,
- DynamicRoutingListDeploymentsResponse,
- DynamicRoutingListVersionsResponse,
-)
-```
-
-Methods:
-
-- client.ai_gateway.dynamic_routing.create(gateway_id, \*, account_id, \*\*params) -> DynamicRoutingCreateResponse
-- client.ai_gateway.dynamic_routing.update(id, \*, account_id, gateway_id, \*\*params) -> DynamicRoutingUpdateResponse
-- client.ai_gateway.dynamic_routing.list(gateway_id, \*, account_id) -> DynamicRoutingListResponse
-- client.ai_gateway.dynamic_routing.delete(id, \*, account_id, gateway_id) -> DynamicRoutingDeleteResponse
-- client.ai_gateway.dynamic_routing.create_deployment(id, \*, account_id, gateway_id, \*\*params) -> DynamicRoutingCreateDeploymentResponse
-- client.ai_gateway.dynamic_routing.create_version(id, \*, account_id, gateway_id, \*\*params) -> DynamicRoutingCreateVersionResponse
-- client.ai_gateway.dynamic_routing.get(id, \*, account_id, gateway_id) -> DynamicRoutingGetResponse
-- client.ai_gateway.dynamic_routing.get_version(version_id, \*, account_id, gateway_id, id) -> DynamicRoutingGetVersionResponse
-- client.ai_gateway.dynamic_routing.list_deployments(id, \*, account_id, gateway_id) -> DynamicRoutingListDeploymentsResponse
-- client.ai_gateway.dynamic_routing.list_versions(id, \*, account_id, gateway_id) -> DynamicRoutingListVersionsResponse
-
-## ProviderConfigs
-
-Types:
-
-```python
-from cloudflare.types.ai_gateway import ProviderConfigCreateResponse, ProviderConfigListResponse
-```
-
-Methods:
-
-- client.ai_gateway.provider_configs.create(gateway_id, \*, account_id, \*\*params) -> ProviderConfigCreateResponse
-- client.ai_gateway.provider_configs.list(gateway_id, \*, account_id, \*\*params) -> SyncV4PagePaginationArray[ProviderConfigListResponse]
-
-## URLs
-
-Types:
-
-```python
-from cloudflare.types.ai_gateway import URLGetResponse
-```
-
-Methods:
-
-- client.ai_gateway.urls.get(provider, \*, account_id, gateway_id) -> str
-
-# IAM
-
-## PermissionGroups
-
-Types:
-
-```python
-from cloudflare.types.iam import PermissionGroupListResponse, PermissionGroupGetResponse
-```
-
-Methods:
-
-- client.iam.permission_groups.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[PermissionGroupListResponse]
-- client.iam.permission_groups.get(permission_group_id, \*, account_id) -> Optional[PermissionGroupGetResponse]
-
-## ResourceGroups
-
-Types:
-
-```python
-from cloudflare.types.iam import (
- ResourceGroupCreateResponse,
- ResourceGroupUpdateResponse,
- ResourceGroupListResponse,
- ResourceGroupDeleteResponse,
- ResourceGroupGetResponse,
-)
-```
-
-Methods:
-
-- client.iam.resource_groups.create(\*, account_id, \*\*params) -> Optional[ResourceGroupCreateResponse]
-- client.iam.resource_groups.update(resource_group_id, \*, account_id, \*\*params) -> Optional[ResourceGroupUpdateResponse]
-- client.iam.resource_groups.list(\*, account_id, \*\*params) -> SyncSinglePage[ResourceGroupListResponse]
-- client.iam.resource_groups.delete(resource_group_id, \*, account_id) -> Optional[ResourceGroupDeleteResponse]
-- client.iam.resource_groups.get(resource_group_id, \*, account_id) -> Optional[ResourceGroupGetResponse]
-
-## UserGroups
-
-Types:
-
-```python
-from cloudflare.types.iam import (
- UserGroupCreateResponse,
- UserGroupUpdateResponse,
- UserGroupListResponse,
- UserGroupDeleteResponse,
- UserGroupGetResponse,
-)
-```
-
-Methods:
-
-- client.iam.user_groups.create(\*, account_id, \*\*params) -> Optional[UserGroupCreateResponse]
-- client.iam.user_groups.update(user_group_id, \*, account_id, \*\*params) -> Optional[UserGroupUpdateResponse]
-- client.iam.user_groups.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[UserGroupListResponse]
-- client.iam.user_groups.delete(user_group_id, \*, account_id) -> Optional[UserGroupDeleteResponse]
-- client.iam.user_groups.get(user_group_id, \*, account_id) -> Optional[UserGroupGetResponse]
-
-### Members
-
-Types:
-
-```python
-from cloudflare.types.iam.user_groups import (
- MemberCreateResponse,
- MemberUpdateResponse,
- MemberListResponse,
- MemberDeleteResponse,
-)
-```
-
-Methods:
-
-- client.iam.user_groups.members.create(user_group_id, \*, account_id, \*\*params) -> Optional[MemberCreateResponse]
-- client.iam.user_groups.members.update(user_group_id, \*, account_id, \*\*params) -> SyncSinglePage[MemberUpdateResponse]
-- client.iam.user_groups.members.list(user_group_id, \*, account_id, \*\*params) -> SyncV4PagePaginationArray[MemberListResponse]
-- client.iam.user_groups.members.delete(member_id, \*, account_id, user_group_id) -> Optional[MemberDeleteResponse]
-
-## SSO
-
-Types:
-
-```python
-from cloudflare.types.iam import (
- SSOCreateResponse,
- SSOUpdateResponse,
- SSOListResponse,
- SSODeleteResponse,
- SSOBeginVerificationResponse,
- SSOGetResponse,
-)
-```
-
-Methods:
-
-- client.iam.sso.create(\*, account_id, \*\*params) -> Optional[SSOCreateResponse]
-- client.iam.sso.update(sso_connector_id, \*, account_id, \*\*params) -> Optional[SSOUpdateResponse]
-- client.iam.sso.list(\*, account_id) -> SyncSinglePage[SSOListResponse]
-- client.iam.sso.delete(sso_connector_id, \*, account_id) -> Optional[SSODeleteResponse]
-- client.iam.sso.begin_verification(sso_connector_id, \*, account_id) -> SSOBeginVerificationResponse
-- client.iam.sso.get(sso_connector_id, \*, account_id) -> Optional[SSOGetResponse]
-
-# CloudConnector
-
-## Rules
-
-Types:
-
-```python
-from cloudflare.types.cloud_connector import RuleUpdateResponse, RuleListResponse
-```
-
-Methods:
-
-- client.cloud_connector.rules.update(\*, zone_id, \*\*params) -> SyncSinglePage[RuleUpdateResponse]
-- client.cloud_connector.rules.list(\*, zone_id) -> SyncSinglePage[RuleListResponse]
-
-# BotnetFeed
-
-## ASN
-
-Types:
-
-```python
-from cloudflare.types.botnet_feed import ASNDayReportResponse, ASNFullReportResponse
-```
-
-Methods:
-
-- client.botnet_feed.asn.day_report(asn_id, \*, account_id, \*\*params) -> Optional[ASNDayReportResponse]
-- client.botnet_feed.asn.full_report(asn_id, \*, account_id) -> Optional[ASNFullReportResponse]
-
-## Configs
-
-### ASN
-
-Types:
-
-```python
-from cloudflare.types.botnet_feed.configs import ASNDeleteResponse, ASNGetResponse
-```
-
-Methods:
-
-- client.botnet_feed.configs.asn.delete(asn_id, \*, account_id) -> Optional[ASNDeleteResponse]
-- client.botnet_feed.configs.asn.get(\*, account_id) -> Optional[ASNGetResponse]
-
-# SecurityTXT
-
-Types:
-
-```python
-from cloudflare.types.security_txt import (
- SecurityTXTUpdateResponse,
- SecurityTXTDeleteResponse,
- SecurityTXTGetResponse,
-)
-```
-
-Methods:
-
-- client.security_txt.update(\*, zone_id, \*\*params) -> SecurityTXTUpdateResponse
-- client.security_txt.delete(\*, zone_id) -> SecurityTXTDeleteResponse
-- client.security_txt.get(\*, zone_id) -> Optional[SecurityTXTGetResponse]
-
-# Workflows
-
-Types:
-
-```python
-from cloudflare.types.workflows import (
- WorkflowUpdateResponse,
- WorkflowListResponse,
- WorkflowDeleteResponse,
- WorkflowGetResponse,
-)
-```
-
-Methods:
-
-- client.workflows.update(workflow_name, \*, account_id, \*\*params) -> WorkflowUpdateResponse
-- client.workflows.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[WorkflowListResponse]
-- client.workflows.delete(workflow_name, \*, account_id) -> WorkflowDeleteResponse
-- client.workflows.get(workflow_name, \*, account_id) -> WorkflowGetResponse
-
-## Instances
-
-Types:
-
-```python
-from cloudflare.types.workflows import (
- InstanceCreateResponse,
- InstanceListResponse,
- InstanceBulkResponse,
- InstanceGetResponse,
-)
-```
-
-Methods:
+# [OriginCACertificates](src/cloudflare/resources/origin_ca_certificates/api.md)
-- client.workflows.instances.create(workflow_name, \*, account_id, \*\*params) -> InstanceCreateResponse
-- client.workflows.instances.list(workflow_name, \*, account_id, \*\*params) -> SyncV4PagePaginationArray[InstanceListResponse]
-- client.workflows.instances.bulk(workflow_name, \*, account_id, \*\*params) -> SyncSinglePage[InstanceBulkResponse]
-- client.workflows.instances.get(instance_id, \*, account_id, workflow_name) -> InstanceGetResponse
+# [IPs](src/cloudflare/resources/ips/api.md)
-### Status
+# [Memberships](src/cloudflare/resources/memberships/api.md)
-Types:
+# [User](src/cloudflare/resources/user/api.md)
-```python
-from cloudflare.types.workflows.instances import StatusEditResponse
-```
-
-Methods:
-
-- client.workflows.instances.status.edit(instance_id, \*, account_id, workflow_name, \*\*params) -> StatusEditResponse
-
-### Events
-
-Methods:
-
-- client.workflows.instances.events.create(event_type, \*, account_id, workflow_name, instance_id, \*\*params) -> object
-
-## Versions
-
-Types:
-
-```python
-from cloudflare.types.workflows import VersionListResponse, VersionGetResponse
-```
-
-Methods:
-
-- client.workflows.versions.list(workflow_name, \*, account_id, \*\*params) -> SyncV4PagePaginationArray[VersionListResponse]
-- client.workflows.versions.get(version_id, \*, account_id, workflow_name) -> VersionGetResponse
-
-# ResourceSharing
-
-Types:
-
-```python
-from cloudflare.types.resource_sharing import (
- ResourceSharingCreateResponse,
- ResourceSharingUpdateResponse,
- ResourceSharingListResponse,
- ResourceSharingDeleteResponse,
- ResourceSharingGetResponse,
-)
-```
-
-Methods:
-
-- client.resource_sharing.create(\*, account_id, \*\*params) -> Optional[ResourceSharingCreateResponse]
-- client.resource_sharing.update(share_id, \*, account_id, \*\*params) -> Optional[ResourceSharingUpdateResponse]
-- client.resource_sharing.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[ResourceSharingListResponse]
-- client.resource_sharing.delete(share_id, \*, account_id) -> Optional[ResourceSharingDeleteResponse]
-- client.resource_sharing.get(share_id, \*, account_id, \*\*params) -> Optional[ResourceSharingGetResponse]
-
-## Recipients
-
-Types:
-
-```python
-from cloudflare.types.resource_sharing import (
- RecipientCreateResponse,
- RecipientListResponse,
- RecipientDeleteResponse,
- RecipientGetResponse,
-)
-```
-
-Methods:
-
-- client.resource_sharing.recipients.create(share_id, \*, path_account_id, \*\*params) -> Optional[RecipientCreateResponse]
-- client.resource_sharing.recipients.list(share_id, \*, account_id, \*\*params) -> SyncV4PagePaginationArray[RecipientListResponse]
-- client.resource_sharing.recipients.delete(recipient_id, \*, account_id, share_id) -> Optional[RecipientDeleteResponse]
-- client.resource_sharing.recipients.get(recipient_id, \*, account_id, share_id, \*\*params) -> Optional[RecipientGetResponse]
-
-## Resources
-
-Types:
-
-```python
-from cloudflare.types.resource_sharing import (
- ResourceCreateResponse,
- ResourceUpdateResponse,
- ResourceListResponse,
- ResourceDeleteResponse,
- ResourceGetResponse,
-)
-```
-
-Methods:
-
-- client.resource_sharing.resources.create(share_id, \*, account_id, \*\*params) -> Optional[ResourceCreateResponse]
-- client.resource_sharing.resources.update(resource_id, \*, account_id, share_id, \*\*params) -> Optional[ResourceUpdateResponse]
-- client.resource_sharing.resources.list(share_id, \*, account_id, \*\*params) -> SyncV4PagePaginationArray[ResourceListResponse]
-- client.resource_sharing.resources.delete(resource_id, \*, account_id, share_id) -> Optional[ResourceDeleteResponse]
-- client.resource_sharing.resources.get(resource_id, \*, account_id, share_id) -> Optional[ResourceGetResponse]
-
-# LeakedCredentialChecks
-
-Types:
-
-```python
-from cloudflare.types.leaked_credential_checks import (
- LeakedCredentialCheckCreateResponse,
- LeakedCredentialCheckGetResponse,
-)
-```
-
-Methods:
-
-- client.leaked_credential_checks.create(\*, zone_id, \*\*params) -> LeakedCredentialCheckCreateResponse
-- client.leaked_credential_checks.get(\*, zone_id) -> LeakedCredentialCheckGetResponse
-
-## Detections
-
-Types:
-
-```python
-from cloudflare.types.leaked_credential_checks import (
- DetectionCreateResponse,
- DetectionUpdateResponse,
- DetectionListResponse,
- DetectionGetResponse,
-)
-```
-
-Methods:
-
-- client.leaked_credential_checks.detections.create(\*, zone_id, \*\*params) -> DetectionCreateResponse
-- client.leaked_credential_checks.detections.update(detection_id, \*, zone_id, \*\*params) -> DetectionUpdateResponse
-- client.leaked_credential_checks.detections.list(\*, zone_id) -> SyncSinglePage[DetectionListResponse]
-- client.leaked_credential_checks.detections.delete(detection_id, \*, zone_id) -> object
-- client.leaked_credential_checks.detections.get(detection_id, \*, zone_id) -> DetectionGetResponse
-
-# ContentScanning
-
-Types:
-
-```python
-from cloudflare.types.content_scanning import (
- ContentScanningCreateResponse,
- ContentScanningUpdateResponse,
- ContentScanningGetResponse,
-)
-```
-
-Methods:
-
-- client.content_scanning.create(\*, zone_id, \*\*params) -> ContentScanningCreateResponse
-- client.content_scanning.update(\*, zone_id, \*\*params) -> ContentScanningUpdateResponse
-- client.content_scanning.disable(\*, zone_id) -> object
-- client.content_scanning.enable(\*, zone_id) -> object
-- client.content_scanning.get(\*, zone_id) -> ContentScanningGetResponse
-
-## Payloads
-
-Types:
-
-```python
-from cloudflare.types.content_scanning import (
- PayloadCreateResponse,
- PayloadListResponse,
- PayloadDeleteResponse,
-)
-```
-
-Methods:
-
-- client.content_scanning.payloads.create(\*, zone_id, \*\*params) -> SyncSinglePage[PayloadCreateResponse]
-- client.content_scanning.payloads.list(\*, zone_id) -> SyncSinglePage[PayloadListResponse]
-- client.content_scanning.payloads.delete(expression_id, \*, zone_id) -> SyncSinglePage[PayloadDeleteResponse]
-
-## Settings
-
-Types:
-
-```python
-from cloudflare.types.content_scanning import SettingGetResponse
-```
-
-Methods:
-
-- client.content_scanning.settings.get(\*, zone_id) -> SettingGetResponse
-
-# AbuseReports
-
-Types:
-
-```python
-from cloudflare.types.abuse_reports import (
- AbuseReportCreateResponse,
- AbuseReportListResponse,
- AbuseReportGetResponse,
-)
-```
-
-Methods:
-
-- client.abuse_reports.create(report_param, \*, account_id, \*\*params) -> str
-- client.abuse_reports.list(\*, account_id, \*\*params) -> SyncV4PagePagination[Optional[AbuseReportListResponse]]
-- client.abuse_reports.get(report_param, \*, account_id) -> AbuseReportGetResponse
-
-## Mitigations
-
-Types:
-
-```python
-from cloudflare.types.abuse_reports import MitigationListResponse, MitigationReviewResponse
-```
-
-Methods:
-
-- client.abuse_reports.mitigations.list(report_id, \*, account_id, \*\*params) -> SyncV4PagePagination[Optional[MitigationListResponse]]
-- client.abuse_reports.mitigations.review(report_id, \*, account_id, \*\*params) -> SyncSinglePage[MitigationReviewResponse]
-
-# AI
-
-Types:
-
-```python
-from cloudflare.types.ai import AIRunResponse
-```
-
-Methods:
-
-- client.ai.run(model_name, \*, account_id, \*\*params) -> Optional[AIRunResponse]
-
-## Finetunes
-
-Types:
-
-```python
-from cloudflare.types.ai import FinetuneCreateResponse, FinetuneListResponse
-```
-
-Methods:
-
-- client.ai.finetunes.create(\*, account_id, \*\*params) -> FinetuneCreateResponse
-- client.ai.finetunes.list(\*, account_id) -> FinetuneListResponse
-
-### Assets
-
-Types:
-
-```python
-from cloudflare.types.ai.finetunes import AssetCreateResponse
-```
-
-Methods:
-
-- client.ai.finetunes.assets.create(finetune_id, \*, account_id, \*\*params) -> AssetCreateResponse
-
-### Public
-
-Types:
-
-```python
-from cloudflare.types.ai.finetunes import PublicListResponse
-```
-
-Methods:
-
-- client.ai.finetunes.public.list(\*, account_id, \*\*params) -> SyncSinglePage[PublicListResponse]
-
-## Authors
-
-Methods:
-
-- client.ai.authors.list(\*, account_id) -> SyncSinglePage[object]
-
-## Tasks
-
-Methods:
-
-- client.ai.tasks.list(\*, account_id) -> SyncSinglePage[object]
-
-## Models
-
-Methods:
+# [Zones](src/cloudflare/resources/zones/api.md)
-- client.ai.models.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[object]
+# [LoadBalancers](src/cloudflare/resources/load_balancers/api.md)
-### Schema
+# [Cache](src/cloudflare/resources/cache/api.md)
-Methods:
+# [SSL](src/cloudflare/resources/ssl/api.md)
-- client.ai.models.schema.get(\*, account_id, \*\*params) -> object
+# [ACM](src/cloudflare/resources/acm/api.md)
-## ToMarkdown
+# [Argo](src/cloudflare/resources/argo/api.md)
-Types:
+# [CertificateAuthorities](src/cloudflare/resources/certificate_authorities/api.md)
-```python
-from cloudflare.types.ai import ToMarkdownSupportedResponse, ToMarkdownTransformResponse
-```
-
-Methods:
-
-- client.ai.to_markdown.supported(\*, account_id) -> SyncSinglePage[ToMarkdownSupportedResponse]
-- client.ai.to_markdown.transform(\*, account_id, \*\*params) -> SyncSinglePage[ToMarkdownTransformResponse]
-
-# AISearch
-
-## Instances
-
-Types:
-
-```python
-from cloudflare.types.aisearch import (
- InstanceCreateResponse,
- InstanceUpdateResponse,
- InstanceListResponse,
- InstanceDeleteResponse,
- InstanceChatCompletionsResponse,
- InstanceReadResponse,
- InstanceSearchResponse,
- InstanceStatsResponse,
-)
-```
-
-Methods:
-
-- client.aisearch.instances.create(\*, account_id, \*\*params) -> InstanceCreateResponse
-- client.aisearch.instances.update(id, \*, account_id, \*\*params) -> InstanceUpdateResponse
-- client.aisearch.instances.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[InstanceListResponse]
-- client.aisearch.instances.delete(id, \*, account_id) -> InstanceDeleteResponse
-- client.aisearch.instances.chat_completions(id, \*, account_id, \*\*params) -> InstanceChatCompletionsResponse
-- client.aisearch.instances.read(id, \*, account_id) -> InstanceReadResponse
-- client.aisearch.instances.search(id, \*, account_id, \*\*params) -> InstanceSearchResponse
-- client.aisearch.instances.stats(id, \*, account_id) -> InstanceStatsResponse
-
-### Items
-
-Types:
-
-```python
-from cloudflare.types.aisearch.instances import ItemListResponse, ItemGetResponse
-```
-
-Methods:
-
-- client.aisearch.instances.items.list(id, \*, account_id, \*\*params) -> SyncV4PagePaginationArray[ItemListResponse]
-- client.aisearch.instances.items.get(item_id, \*, account_id, id) -> ItemGetResponse
-
-### Jobs
-
-Types:
-
-```python
-from cloudflare.types.aisearch.instances import (
- JobCreateResponse,
- JobListResponse,
- JobGetResponse,
- JobLogsResponse,
-)
-```
-
-Methods:
-
-- client.aisearch.instances.jobs.create(id, \*, account_id) -> JobCreateResponse
-- client.aisearch.instances.jobs.list(id, \*, account_id, \*\*params) -> SyncV4PagePaginationArray[JobListResponse]
-- client.aisearch.instances.jobs.get(job_id, \*, account_id, id) -> JobGetResponse
-- client.aisearch.instances.jobs.logs(job_id, \*, account_id, id, \*\*params) -> JobLogsResponse
-
-## Tokens
-
-Types:
-
-```python
-from cloudflare.types.aisearch import (
- TokenCreateResponse,
- TokenUpdateResponse,
- TokenListResponse,
- TokenDeleteResponse,
- TokenReadResponse,
-)
-```
-
-Methods:
-
-- client.aisearch.tokens.create(\*, account_id, \*\*params) -> TokenCreateResponse
-- client.aisearch.tokens.update(id, \*, account_id, \*\*params) -> TokenUpdateResponse
-- client.aisearch.tokens.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[TokenListResponse]
-- client.aisearch.tokens.delete(id, \*, account_id) -> TokenDeleteResponse
-- client.aisearch.tokens.read(id, \*, account_id) -> TokenReadResponse
-
-# SecurityCenter
-
-## Insights
-
-Types:
-
-```python
-from cloudflare.types.security_center import InsightListResponse, InsightDismissResponse
-```
-
-Methods:
-
-- client.security_center.insights.list(\*, account_id, zone_id, \*\*params) -> SyncV4PagePagination[Optional[InsightListResponse]]
-- client.security_center.insights.dismiss(issue_id, \*, account_id, zone_id, \*\*params) -> InsightDismissResponse
-
-### Class
-
-Types:
-
-```python
-from cloudflare.types.security_center.insights import ClassGetResponse
-```
-
-Methods:
-
-- client.security*center.insights.class*.get(\*, account_id, zone_id, \*\*params) -> Optional[ClassGetResponse]
-
-### Severity
-
-Types:
-
-```python
-from cloudflare.types.security_center.insights import SeverityGetResponse
-```
-
-Methods:
-
-- client.security_center.insights.severity.get(\*, account_id, zone_id, \*\*params) -> Optional[SeverityGetResponse]
-
-### Type
-
-Types:
-
-```python
-from cloudflare.types.security_center.insights import TypeGetResponse
-```
-
-Methods:
+# [ClientCertificates](src/cloudflare/resources/client_certificates/api.md)
-- client.security_center.insights.type.get(\*, account_id, zone_id, \*\*params) -> Optional[TypeGetResponse]
+# [CustomCertificates](src/cloudflare/resources/custom_certificates/api.md)
-# BrowserRendering
+# [CustomHostnames](src/cloudflare/resources/custom_hostnames/api.md)
-## Content
+# [CustomNameservers](src/cloudflare/resources/custom_nameservers/api.md)
-Types:
+# [DNSFirewall](src/cloudflare/resources/dns_firewall/api.md)
-```python
-from cloudflare.types.browser_rendering import ContentCreateResponse
-```
-
-Methods:
-
-- client.browser_rendering.content.create(\*, account_id, \*\*params) -> str
-
-## PDF
-
-Methods:
-
-- client.browser_rendering.pdf.create(\*, account_id, \*\*params) -> BinaryAPIResponse
-
-## Scrape
-
-Types:
-
-```python
-from cloudflare.types.browser_rendering import ScrapeCreateResponse
-```
-
-Methods:
-
-- client.browser_rendering.scrape.create(\*, account_id, \*\*params) -> ScrapeCreateResponse
-
-## Screenshot
-
-Types:
+# [DNS](src/cloudflare/resources/dns/api.md)
-```python
-from cloudflare.types.browser_rendering import ScreenshotCreateResponse
-```
-
-Methods:
-
-- client.browser_rendering.screenshot.create(\*, account_id, \*\*params) -> ScreenshotCreateResponse
+# [EmailSecurity](src/cloudflare/resources/email_security/api.md)
-## Snapshot
-
-Types:
-
-```python
-from cloudflare.types.browser_rendering import SnapshotCreateResponse
-```
+# [EmailRouting](src/cloudflare/resources/email_routing/api.md)
-Methods:
+# [EmailSending](src/cloudflare/resources/email_sending/api.md)
-- client.browser_rendering.snapshot.create(\*, account_id, \*\*params) -> Optional[SnapshotCreateResponse]
+# [Filters](src/cloudflare/resources/filters/api.md)
-## Json
+# [Firewall](src/cloudflare/resources/firewall/api.md)
-Types:
+# [Healthchecks](src/cloudflare/resources/healthchecks/api.md)
-```python
-from cloudflare.types.browser_rendering import JsonCreateResponse
-```
+# [KeylessCertificates](src/cloudflare/resources/keyless_certificates/api.md)
-Methods:
+# [Logpush](src/cloudflare/resources/logpush/api.md)
-- client.browser_rendering.json.create(\*, account_id, \*\*params) -> JsonCreateResponse
+# [Logs](src/cloudflare/resources/logs/api.md)
-## Links
+# [OriginTLSClientAuth](src/cloudflare/resources/origin_tls_client_auth/api.md)
-Types:
+# [PageRules](src/cloudflare/resources/page_rules/api.md)
-```python
-from cloudflare.types.browser_rendering import LinkCreateResponse
-```
+# [RateLimits](src/cloudflare/resources/rate_limits/api.md)
-Methods:
+# [WaitingRooms](src/cloudflare/resources/waiting_rooms/api.md)
-- client.browser_rendering.links.create(\*, account_id, \*\*params) -> LinkCreateResponse
+# [Web3](src/cloudflare/resources/web3/api.md)
-## Markdown
+# [Workers](src/cloudflare/resources/workers/api.md)
-Types:
+# [KV](src/cloudflare/resources/kv/api.md)
-```python
-from cloudflare.types.browser_rendering import MarkdownCreateResponse
-```
+# [DurableObjects](src/cloudflare/resources/durable_objects/api.md)
-Methods:
+# [Queues](src/cloudflare/resources/queues/api.md)
-- client.browser_rendering.markdown.create(\*, account_id, \*\*params) -> str
+# [APIGateway](src/cloudflare/resources/api_gateway/api.md)
-# CustomPages
+# [ManagedTransforms](src/cloudflare/resources/managed_transforms/api.md)
-Types:
+# [PageShield](src/cloudflare/resources/page_shield/api.md)
-```python
-from cloudflare.types.custom_pages import (
- CustomPageUpdateResponse,
- CustomPageListResponse,
- CustomPageGetResponse,
-)
-```
+# [Rulesets](src/cloudflare/resources/rulesets/api.md)
-Methods:
+# [URLNormalization](src/cloudflare/resources/url_normalization/api.md)
-- client.custom_pages.update(identifier, \*, account_id, zone_id, \*\*params) -> Optional[CustomPageUpdateResponse]
-- client.custom_pages.list(\*, account_id, zone_id) -> SyncSinglePage[CustomPageListResponse]
-- client.custom_pages.get(identifier, \*, account_id, zone_id) -> Optional[CustomPageGetResponse]
+# [Spectrum](src/cloudflare/resources/spectrum/api.md)
-# SecretsStore
+# [Addressing](src/cloudflare/resources/addressing/api.md)
-## Stores
+# [AuditLogs](src/cloudflare/resources/audit_logs/api.md)
-Types:
+# [Billing](src/cloudflare/resources/billing/api.md)
-```python
-from cloudflare.types.secrets_store import (
- StoreCreateResponse,
- StoreListResponse,
- StoreDeleteResponse,
-)
-```
+# [BrandProtection](src/cloudflare/resources/brand_protection/api.md)
-Methods:
+# [Diagnostics](src/cloudflare/resources/diagnostics/api.md)
-- client.secrets_store.stores.create(\*, account_id, \*\*params) -> SyncSinglePage[StoreCreateResponse]
-- client.secrets_store.stores.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[StoreListResponse]
-- client.secrets_store.stores.delete(store_id, \*, account_id) -> Optional[StoreDeleteResponse]
+# [Images](src/cloudflare/resources/images/api.md)
-### Secrets
+# [Intel](src/cloudflare/resources/intel/api.md)
-Types:
+# [MagicTransit](src/cloudflare/resources/magic_transit/api.md)
-```python
-from cloudflare.types.secrets_store.stores import (
- SecretCreateResponse,
- SecretListResponse,
- SecretDeleteResponse,
- SecretBulkDeleteResponse,
- SecretDuplicateResponse,
- SecretEditResponse,
- SecretGetResponse,
-)
-```
+# [MagicNetworkMonitoring](src/cloudflare/resources/magic_network_monitoring/api.md)
-Methods:
+# [MagicCloudNetworking](src/cloudflare/resources/magic_cloud_networking/api.md)
-- client.secrets_store.stores.secrets.create(store_id, \*, account_id, \*\*params) -> SyncSinglePage[SecretCreateResponse]
-- client.secrets_store.stores.secrets.list(store_id, \*, account_id, \*\*params) -> SyncV4PagePaginationArray[SecretListResponse]
-- client.secrets_store.stores.secrets.delete(secret_id, \*, account_id, store_id) -> Optional[SecretDeleteResponse]
-- client.secrets_store.stores.secrets.bulk_delete(store_id, \*, account_id) -> SyncSinglePage[SecretBulkDeleteResponse]
-- client.secrets_store.stores.secrets.duplicate(secret_id, \*, account_id, store_id, \*\*params) -> Optional[SecretDuplicateResponse]
-- client.secrets_store.stores.secrets.edit(secret_id, \*, account_id, store_id, \*\*params) -> Optional[SecretEditResponse]
-- client.secrets_store.stores.secrets.get(secret_id, \*, account_id, store_id) -> Optional[SecretGetResponse]
+# [NetworkInterconnects](src/cloudflare/resources/network_interconnects/api.md)
-## Quota
+# [MTLSCertificates](src/cloudflare/resources/mtls_certificates/api.md)
-Types:
+# [Pages](src/cloudflare/resources/pages/api.md)
-```python
-from cloudflare.types.secrets_store import QuotaGetResponse
-```
+# [Registrar](src/cloudflare/resources/registrar/api.md)
-Methods:
+# [RequestTracers](src/cloudflare/resources/request_tracers/api.md)
-- client.secrets_store.quota.get(\*, account_id) -> Optional[QuotaGetResponse]
+# [Rules](src/cloudflare/resources/rules/api.md)
-# Pipelines
+# [Stream](src/cloudflare/resources/stream/api.md)
-Types:
+# [Alerting](src/cloudflare/resources/alerting/api.md)
-```python
-from cloudflare.types.pipelines import (
- PipelineCreateResponse,
- PipelineUpdateResponse,
- PipelineListResponse,
- PipelineCreateV1Response,
- PipelineGetResponse,
- PipelineGetV1Response,
- PipelineListV1Response,
- PipelineValidateSqlResponse,
-)
-```
+# [D1](src/cloudflare/resources/d1/api.md)
-Methods:
+# [R2](src/cloudflare/resources/r2/api.md)
-- client.pipelines.create(\*, account_id, \*\*params) -> PipelineCreateResponse
-- client.pipelines.update(pipeline_name, \*, account_id, \*\*params) -> PipelineUpdateResponse
-- client.pipelines.list(\*, account_id, \*\*params) -> PipelineListResponse
-- client.pipelines.delete(pipeline_name, \*, account_id) -> None
-- client.pipelines.create_v1(\*, account_id, \*\*params) -> PipelineCreateV1Response
-- client.pipelines.delete_v1(pipeline_id, \*, account_id) -> None
-- client.pipelines.get(pipeline_name, \*, account_id) -> PipelineGetResponse
-- client.pipelines.get_v1(pipeline_id, \*, account_id) -> PipelineGetV1Response
-- client.pipelines.list_v1(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[PipelineListV1Response]
-- client.pipelines.validate_sql(\*, account_id, \*\*params) -> PipelineValidateSqlResponse
+# [R2DataCatalog](src/cloudflare/resources/r2_data_catalog/api.md)
-## Sinks
+# [WorkersForPlatforms](src/cloudflare/resources/workers_for_platforms/api.md)
-Types:
+# [ZeroTrust](src/cloudflare/resources/zero_trust/api.md)
-```python
-from cloudflare.types.pipelines import SinkCreateResponse, SinkListResponse, SinkGetResponse
-```
+# [Turnstile](src/cloudflare/resources/turnstile/api.md)
-Methods:
+# [Connectivity](src/cloudflare/resources/connectivity/api.md)
-- client.pipelines.sinks.create(\*, account_id, \*\*params) -> SinkCreateResponse
-- client.pipelines.sinks.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[SinkListResponse]
-- client.pipelines.sinks.delete(sink_id, \*, account_id, \*\*params) -> None
-- client.pipelines.sinks.get(sink_id, \*, account_id) -> SinkGetResponse
+# [Hyperdrive](src/cloudflare/resources/hyperdrive/api.md)
-## Streams
+# [RUM](src/cloudflare/resources/rum/api.md)
-Types:
+# [Vectorize](src/cloudflare/resources/vectorize/api.md)
-```python
-from cloudflare.types.pipelines import (
- StreamCreateResponse,
- StreamUpdateResponse,
- StreamListResponse,
- StreamGetResponse,
-)
-```
+# [URLScanner](src/cloudflare/resources/url_scanner/api.md)
-Methods:
+# [VulnerabilityScanner](src/cloudflare/resources/vulnerability_scanner/api.md)
-- client.pipelines.streams.create(\*, account_id, \*\*params) -> StreamCreateResponse
-- client.pipelines.streams.update(stream_id, \*, account_id, \*\*params) -> StreamUpdateResponse
-- client.pipelines.streams.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[StreamListResponse]
-- client.pipelines.streams.delete(stream_id, \*, account_id, \*\*params) -> None
-- client.pipelines.streams.get(stream_id, \*, account_id) -> StreamGetResponse
+# [Radar](src/cloudflare/resources/radar/api.md)
-# SchemaValidation
+# [BotManagement](src/cloudflare/resources/bot_management/api.md)
-## Schemas
+# [Fraud](src/cloudflare/resources/fraud/api.md)
-Types:
+# [OriginPostQuantumEncryption](src/cloudflare/resources/origin_post_quantum_encryption/api.md)
-```python
-from cloudflare.types.schema_validation import PublicSchema, SchemaDeleteResponse
-```
+# [GoogleTagGateway](src/cloudflare/resources/google_tag_gateway/api.md)
-Methods:
+# [Zaraz](src/cloudflare/resources/zaraz/api.md)
-- client.schema_validation.schemas.create(\*, zone_id, \*\*params) -> PublicSchema
-- client.schema_validation.schemas.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[PublicSchema]
-- client.schema_validation.schemas.delete(schema_id, \*, zone_id) -> SchemaDeleteResponse
-- client.schema_validation.schemas.edit(schema_id, \*, zone_id, \*\*params) -> PublicSchema
-- client.schema_validation.schemas.get(schema_id, \*, zone_id, \*\*params) -> PublicSchema
+# [Speed](src/cloudflare/resources/speed/api.md)
-## Settings
+# [DCVDelegation](src/cloudflare/resources/dcv_delegation/api.md)
-Types:
+# [Hostnames](src/cloudflare/resources/hostnames/api.md)
-```python
-from cloudflare.types.schema_validation import (
- SettingUpdateResponse,
- SettingEditResponse,
- SettingGetResponse,
-)
-```
+# [Snippets](src/cloudflare/resources/snippets/api.md)
-Methods:
+# [RealtimeKit](src/cloudflare/resources/realtime_kit/api.md)
-- client.schema_validation.settings.update(\*, zone_id, \*\*params) -> SettingUpdateResponse
-- client.schema_validation.settings.edit(\*, zone_id, \*\*params) -> SettingEditResponse
-- client.schema_validation.settings.get(\*, zone_id) -> SettingGetResponse
+# [Calls](src/cloudflare/resources/calls/api.md)
-### Operations
+# [CloudforceOne](src/cloudflare/resources/cloudforce_one/api.md)
-Types:
+# [AIGateway](src/cloudflare/resources/ai_gateway/api.md)
-```python
-from cloudflare.types.schema_validation.settings import (
- OperationUpdateResponse,
- OperationListResponse,
- OperationDeleteResponse,
- OperationBulkEditResponse,
- OperationGetResponse,
-)
-```
+# [IAM](src/cloudflare/resources/iam/api.md)
-Methods:
+# [CloudConnector](src/cloudflare/resources/cloud_connector/api.md)
-- client.schema_validation.settings.operations.update(operation_id, \*, zone_id, \*\*params) -> OperationUpdateResponse
-- client.schema_validation.settings.operations.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[OperationListResponse]
-- client.schema_validation.settings.operations.delete(operation_id, \*, zone_id) -> OperationDeleteResponse
-- client.schema_validation.settings.operations.bulk_edit(\*, zone_id, \*\*params) -> OperationBulkEditResponse
-- client.schema_validation.settings.operations.get(operation_id, \*, zone_id) -> OperationGetResponse
+# [BotnetFeed](src/cloudflare/resources/botnet_feed/api.md)
-# TokenValidation
+# [SecurityTXT](src/cloudflare/resources/security_txt/api.md)
-## Configuration
+# [Workflows](src/cloudflare/resources/workflows/api.md)
-Types:
+# [ResourceSharing](src/cloudflare/resources/resource_sharing/api.md)
-```python
-from cloudflare.types.token_validation import (
- TokenConfig,
- ConfigurationDeleteResponse,
- ConfigurationEditResponse,
-)
-```
+# [ResourceTagging](src/cloudflare/resources/resource_tagging/api.md)
-Methods:
+# [LeakedCredentialChecks](src/cloudflare/resources/leaked_credential_checks/api.md)
-- client.token_validation.configuration.create(\*, zone_id, \*\*params) -> TokenConfig
-- client.token_validation.configuration.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[TokenConfig]
-- client.token_validation.configuration.delete(config_id, \*, zone_id) -> ConfigurationDeleteResponse
-- client.token_validation.configuration.edit(config_id, \*, zone_id, \*\*params) -> ConfigurationEditResponse
-- client.token_validation.configuration.get(config_id, \*, zone_id) -> TokenConfig
+# [ContentScanning](src/cloudflare/resources/content_scanning/api.md)
-### Credentials
+# [AbuseReports](src/cloudflare/resources/abuse_reports/api.md)
-Types:
+# [AI](src/cloudflare/resources/ai/api.md)
-```python
-from cloudflare.types.token_validation.configuration import CredentialUpdateResponse
-```
+# [AISearch](src/cloudflare/resources/aisearch/api.md)
-Methods:
+# [SecurityCenter](src/cloudflare/resources/security_center/api.md)
-- client.token_validation.configuration.credentials.update(config_id, \*, zone_id, \*\*params) -> CredentialUpdateResponse
+# [BrowserRendering](src/cloudflare/resources/browser_rendering/api.md)
-## Rules
+# [CustomPages](src/cloudflare/resources/custom_pages/api.md)
-Types:
+# [SecretsStore](src/cloudflare/resources/secrets_store/api.md)
-```python
-from cloudflare.types.token_validation import TokenValidationRule
-```
+# [Pipelines](src/cloudflare/resources/pipelines/api.md)
-Methods:
+# [SchemaValidation](src/cloudflare/resources/schema_validation/api.md)
-- client.token_validation.rules.create(\*, zone_id, \*\*params) -> TokenValidationRule
-- client.token_validation.rules.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[TokenValidationRule]
-- client.token_validation.rules.delete(rule_id, \*, zone_id) -> object
-- client.token_validation.rules.bulk_create(\*, zone_id, \*\*params) -> SyncSinglePage[TokenValidationRule]
-- client.token_validation.rules.bulk_edit(\*, zone_id, \*\*params) -> SyncSinglePage[TokenValidationRule]
-- client.token_validation.rules.edit(rule_id, \*, zone_id, \*\*params) -> TokenValidationRule
-- client.token_validation.rules.get(rule_id, \*, zone_id) -> TokenValidationRule
+# [TokenValidation](src/cloudflare/resources/token_validation/api.md)
diff --git a/examples/ai/demo.py b/examples/ai/demo.py
deleted file mode 100644
index 8244662c683..00000000000
--- a/examples/ai/demo.py
+++ /dev/null
@@ -1,20 +0,0 @@
-import os
-import sys
-
-from cloudflare import Cloudflare
-
-account_id = os.getenv("CLOUDFLARE_ACCOUNT_ID")
-if account_id is None:
- sys.exit("CLOUDFLARE_ACCOUNT_ID is not defined")
-
-client = Cloudflare()
-
-t = client.ai.run(
- "@cf/meta/m2m100-1.2b",
- account_id=account_id,
- text="I'll have an order of the moule frites",
- target_lang="french",
- source_lang="english",
-)
-
-# print(t['translated_text'])
diff --git a/pyproject.toml b/pyproject.toml
index a5a2adb78ec..e3ea96e58e4 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "cloudflare"
-version = "5.0.0-beta.1"
+version = "5.0.0-beta.2"
description = "The official Python library for the cloudflare API"
dynamic = ["readme"]
license = "Apache-2.0"
@@ -11,7 +11,7 @@ authors = [
dependencies = [
"httpx>=0.23.0, <1",
"pydantic>=1.9.0, <3",
- "typing-extensions>=4.10, <5",
+ "typing-extensions>=4.14, <5",
"anyio>=3.5.0, <5",
"distro>=1.7.0, <2",
"sniffio",
@@ -70,7 +70,7 @@ format = { chain = [
# run formatting again to fix any inconsistencies when imports are stripped
"format:ruff",
]}
-"format:docs" = "python scripts/utils/ruffen-docs.py README.md api.md"
+"format:docs" = "bash -c 'python scripts/utils/ruffen-docs.py README.md $(find . -type f -name api.md)'"
"format:ruff" = "ruff format"
"lint" = { chain = [
diff --git a/requirements-dev.lock b/requirements-dev.lock
index 9fb207c1220..be86ad20d91 100644
--- a/requirements-dev.lock
+++ b/requirements-dev.lock
@@ -12,14 +12,14 @@
-e file:.
aiohappyeyeballs==2.6.1
# via aiohttp
-aiohttp==3.13.2
+aiohttp==3.13.3
# via cloudflare
# via httpx-aiohttp
aiosignal==1.4.0
# via aiohttp
annotated-types==0.7.0
# via pydantic
-anyio==4.12.0
+anyio==4.12.1
# via cloudflare
# via httpx
argcomplete==3.6.3
@@ -31,7 +31,7 @@ attrs==25.4.0
# via nox
backports-asyncio-runner==1.2.0
# via pytest-asyncio
-certifi==2025.11.12
+certifi==2026.1.4
# via httpcore
# via httpx
colorama==0.4.6
@@ -64,7 +64,7 @@ httpx==0.28.1
# via cloudflare
# via httpx-aiohttp
# via respx
-httpx-aiohttp==0.1.9
+httpx-aiohttp==0.1.12
# via cloudflare
humanize==4.13.0
# via nox
@@ -72,7 +72,7 @@ idna==3.11
# via anyio
# via httpx
# via yarl
-importlib-metadata==8.7.0
+importlib-metadata==8.7.1
iniconfig==2.1.0
# via pytest
markdown-it-py==3.0.0
@@ -85,14 +85,14 @@ multidict==6.7.0
mypy==1.17.0
mypy-extensions==1.1.0
# via mypy
-nodeenv==1.9.1
+nodeenv==1.10.0
# via pyright
nox==2025.11.12
packaging==25.0
# via dependency-groups
# via nox
# via pytest
-pathspec==0.12.1
+pathspec==1.0.3
# via mypy
platformdirs==4.4.0
# via virtualenv
@@ -118,13 +118,13 @@ python-dateutil==2.9.0.post0
# via time-machine
respx==0.22.0
rich==14.2.0
-ruff==0.14.7
+ruff==0.14.13
six==1.17.0
# via python-dateutil
sniffio==1.3.1
# via cloudflare
time-machine==2.19.0
-tomli==2.3.0
+tomli==2.4.0
# via dependency-groups
# via mypy
# via nox
@@ -144,7 +144,7 @@ typing-extensions==4.15.0
# via virtualenv
typing-inspection==0.4.2
# via pydantic
-virtualenv==20.35.4
+virtualenv==20.36.1
# via nox
yarl==1.22.0
# via aiohttp
diff --git a/requirements.lock b/requirements.lock
index c948e87d644..67880761fcb 100644
--- a/requirements.lock
+++ b/requirements.lock
@@ -12,21 +12,21 @@
-e file:.
aiohappyeyeballs==2.6.1
# via aiohttp
-aiohttp==3.13.2
+aiohttp==3.13.3
# via cloudflare
# via httpx-aiohttp
aiosignal==1.4.0
# via aiohttp
annotated-types==0.7.0
# via pydantic
-anyio==4.12.0
+anyio==4.12.1
# via cloudflare
# via httpx
async-timeout==5.0.1
# via aiohttp
attrs==25.4.0
# via aiohttp
-certifi==2025.11.12
+certifi==2026.1.4
# via httpcore
# via httpx
distro==1.9.0
@@ -43,7 +43,7 @@ httpcore==1.0.9
httpx==0.28.1
# via cloudflare
# via httpx-aiohttp
-httpx-aiohttp==0.1.9
+httpx-aiohttp==0.1.12
# via cloudflare
idna==3.11
# via anyio
diff --git a/scripts/mock b/scripts/mock
index 0b28f6ea23d..bcf3b392b3b 100755
--- a/scripts/mock
+++ b/scripts/mock
@@ -21,11 +21,22 @@ echo "==> Starting mock server with URL ${URL}"
# Run prism mock on the given spec
if [ "$1" == "--daemon" ]; then
+ # Pre-install the package so the download doesn't eat into the startup timeout
+ npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism --version
+
npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log &
- # Wait for server to come online
+ # Wait for server to come online (max 30s)
echo -n "Waiting for server"
+ attempts=0
while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do
+ attempts=$((attempts + 1))
+ if [ "$attempts" -ge 300 ]; then
+ echo
+ echo "Timed out waiting for Prism server to start"
+ cat .prism.log
+ exit 1
+ fi
echo -n "."
sleep 0.1
done
diff --git a/src/cloudflare/_base_client.py b/src/cloudflare/_base_client.py
index e6310e5837d..3d7dc067190 100644
--- a/src/cloudflare/_base_client.py
+++ b/src/cloudflare/_base_client.py
@@ -88,6 +88,7 @@
APIConnectionError,
APIResponseValidationError,
)
+from ._utils._json import openapi_dumps
log: logging.Logger = logging.getLogger(__name__)
@@ -563,6 +564,10 @@ def _build_request(
files = cast(HttpxRequestFiles, ForceMultipartDict())
prepared_url = self._prepare_url(options.url)
+ # preserve hard-coded query params from the url
+ if params and prepared_url.query:
+ params = {**dict(prepared_url.params.items()), **params}
+ prepared_url = prepared_url.copy_with(raw_path=prepared_url.raw_path.split(b"?", 1)[0])
if "_" in prepared_url.host:
# work around https://github.com/encode/httpx/discussions/2880
kwargs["extensions"] = {"sni_hostname": prepared_url.host.replace("_", "-")}
@@ -578,8 +583,10 @@ def _build_request(
kwargs["content"] = options.content
elif isinstance(json_data, bytes):
kwargs["content"] = json_data
- else:
- kwargs["json"] = json_data if is_given(json_data) else None
+ elif not files:
+ # Don't set content when JSON is sent as multipart/form-data,
+ # since httpx's content param overrides other body arguments
+ kwargs["content"] = openapi_dumps(json_data) if is_given(json_data) and json_data is not None else None
kwargs["files"] = files
else:
headers.pop("Content-Type", None)
diff --git a/src/cloudflare/_client.py b/src/cloudflare/_client.py
index edc473185de..898c9afa236 100644
--- a/src/cloudflare/_client.py
+++ b/src/cloudflare/_client.py
@@ -99,6 +99,7 @@
security_txt,
abuse_reports,
email_routing,
+ email_sending,
magic_transit,
organizations,
secrets_store,
@@ -117,17 +118,20 @@
content_scanning,
custom_hostnames,
resource_sharing,
+ resource_tagging,
token_validation,
browser_rendering,
mtls_certificates,
schema_validation,
url_normalization,
custom_nameservers,
+ google_tag_gateway,
managed_transforms,
client_certificates,
custom_certificates,
keyless_certificates,
network_interconnects,
+ vulnerability_scanner,
workers_for_platforms,
magic_cloud_networking,
origin_ca_certificates,
@@ -137,43 +141,35 @@
magic_network_monitoring,
origin_post_quantum_encryption,
)
- from .resources.ips import IPsResource, AsyncIPsResource
from .resources.ai.ai import AIResource, AsyncAIResource
from .resources.d1.d1 import D1Resource, AsyncD1Resource
- from .resources.fraud import FraudResource, AsyncFraudResource
from .resources.kv.kv import KVResource, AsyncKVResource
from .resources.r2.r2 import R2Resource, AsyncR2Resource
from .resources.acm.acm import ACMResource, AsyncACMResource
from .resources.dns.dns import DNSResource, AsyncDNSResource
- from .resources.filters import FiltersResource, AsyncFiltersResource
from .resources.iam.iam import IAMResource, AsyncIAMResource
+ from .resources.ips.ips import IPsResource, AsyncIPsResource
from .resources.rum.rum import RUMResource, AsyncRUMResource
from .resources.ssl.ssl import SSLResource, AsyncSSLResource
from .resources.argo.argo import ArgoResource, AsyncArgoResource
from .resources.logs.logs import LogsResource, AsyncLogsResource
from .resources.user.user import UserResource, AsyncUserResource
from .resources.web3.web3 import Web3Resource, AsyncWeb3Resource
- from .resources.audit_logs import AuditLogsResource, AsyncAuditLogsResource
- from .resources.page_rules import PageRulesResource, AsyncPageRulesResource
from .resources.cache.cache import CacheResource, AsyncCacheResource
from .resources.calls.calls import CallsResource, AsyncCallsResource
+ from .resources.fraud.fraud import FraudResource, AsyncFraudResource
from .resources.intel.intel import IntelResource, AsyncIntelResource
- from .resources.memberships import MembershipsResource, AsyncMembershipsResource
from .resources.pages.pages import PagesResource, AsyncPagesResource
from .resources.radar.radar import RadarResource, AsyncRadarResource
- from .resources.rate_limits import RateLimitsResource, AsyncRateLimitsResource
from .resources.rules.rules import RulesResource, AsyncRulesResource
from .resources.speed.speed import SpeedResource, AsyncSpeedResource
from .resources.zaraz.zaraz import ZarazResource, AsyncZarazResource
from .resources.zones.zones import ZonesResource, AsyncZonesResource
- from .resources.custom_pages import CustomPagesResource, AsyncCustomPagesResource
- from .resources.security_txt import SecurityTXTResource, AsyncSecurityTXTResource
from .resources.images.images import ImagesResource, AsyncImagesResource
from .resources.queues.queues import QueuesResource, AsyncQueuesResource
from .resources.stream.stream import StreamResource, AsyncStreamResource
- from .resources.bot_management import BotManagementResource, AsyncBotManagementResource
- from .resources.dcv_delegation import DCVDelegationResource, AsyncDCVDelegationResource
from .resources.billing.billing import BillingResource, AsyncBillingResource
+ from .resources.filters.filters import FiltersResource, AsyncFiltersResource
from .resources.logpush.logpush import LogpushResource, AsyncLogpushResource
from .resources.workers.workers import WorkersResource, AsyncWorkersResource
from .resources.accounts.accounts import AccountsResource, AsyncAccountsResource
@@ -183,44 +179,43 @@
from .resources.rulesets.rulesets import RulesetsResource, AsyncRulesetsResource
from .resources.snippets.snippets import SnippetsResource, AsyncSnippetsResource
from .resources.spectrum.spectrum import SpectrumResource, AsyncSpectrumResource
- from .resources.url_normalization import URLNormalizationResource, AsyncURLNormalizationResource
- from .resources.custom_nameservers import CustomNameserversResource, AsyncCustomNameserversResource
- from .resources.managed_transforms import ManagedTransformsResource, AsyncManagedTransformsResource
- from .resources.client_certificates import ClientCertificatesResource, AsyncClientCertificatesResource
from .resources.hostnames.hostnames import HostnamesResource, AsyncHostnamesResource
from .resources.pipelines.pipelines import PipelinesResource, AsyncPipelinesResource
from .resources.registrar.registrar import RegistrarResource, AsyncRegistrarResource
from .resources.turnstile.turnstile import TurnstileResource, AsyncTurnstileResource
from .resources.vectorize.vectorize import VectorizeResource, AsyncVectorizeResource
from .resources.workflows.workflows import WorkflowsResource, AsyncWorkflowsResource
- from .resources.keyless_certificates import KeylessCertificatesResource, AsyncKeylessCertificatesResource
from .resources.addressing.addressing import AddressingResource, AsyncAddressingResource
from .resources.ai_gateway.ai_gateway import AIGatewayResource, AsyncAIGatewayResource
+ from .resources.audit_logs.audit_logs import AuditLogsResource, AsyncAuditLogsResource
from .resources.hyperdrive.hyperdrive import HyperdriveResource, AsyncHyperdriveResource
+ from .resources.page_rules.page_rules import PageRulesResource, AsyncPageRulesResource
from .resources.zero_trust.zero_trust import ZeroTrustResource, AsyncZeroTrustResource
- from .resources.origin_ca_certificates import OriginCACertificatesResource, AsyncOriginCACertificatesResource
from .resources.api_gateway.api_gateway import APIGatewayResource, AsyncAPIGatewayResource
from .resources.botnet_feed.botnet_feed import BotnetFeedResource, AsyncBotnetFeedResource
from .resources.diagnostics.diagnostics import DiagnosticsResource, AsyncDiagnosticsResource
+ from .resources.memberships.memberships import MembershipsResource, AsyncMembershipsResource
from .resources.page_shield.page_shield import PageShieldResource, AsyncPageShieldResource
+ from .resources.rate_limits.rate_limits import RateLimitsResource, AsyncRateLimitsResource
from .resources.url_scanner.url_scanner import URLScannerResource, AsyncURLScannerResource
from .resources.connectivity.connectivity import ConnectivityResource, AsyncConnectivityResource
+ from .resources.custom_pages.custom_pages import CustomPagesResource, AsyncCustomPagesResource
from .resources.dns_firewall.dns_firewall import DNSFirewallResource, AsyncDNSFirewallResource
from .resources.healthchecks.healthchecks import HealthchecksResource, AsyncHealthchecksResource
from .resources.realtime_kit.realtime_kit import RealtimeKitResource, AsyncRealtimeKitResource
+ from .resources.security_txt.security_txt import SecurityTXTResource, AsyncSecurityTXTResource
from .resources.abuse_reports.abuse_reports import AbuseReportsResource, AsyncAbuseReportsResource
from .resources.email_routing.email_routing import EmailRoutingResource, AsyncEmailRoutingResource
+ from .resources.email_sending.email_sending import EmailSendingResource, AsyncEmailSendingResource
from .resources.magic_transit.magic_transit import MagicTransitResource, AsyncMagicTransitResource
from .resources.organizations.organizations import OrganizationsResource, AsyncOrganizationsResource
from .resources.secrets_store.secrets_store import SecretsStoreResource, AsyncSecretsStoreResource
from .resources.waiting_rooms.waiting_rooms import WaitingRoomsResource, AsyncWaitingRoomsResource
+ from .resources.bot_management.bot_management import BotManagementResource, AsyncBotManagementResource
from .resources.cloudforce_one.cloudforce_one import CloudforceOneResource, AsyncCloudforceOneResource
+ from .resources.dcv_delegation.dcv_delegation import DCVDelegationResource, AsyncDCVDelegationResource
from .resources.email_security.email_security import EmailSecurityResource, AsyncEmailSecurityResource
from .resources.load_balancers.load_balancers import LoadBalancersResource, AsyncLoadBalancersResource
- from .resources.origin_post_quantum_encryption import (
- OriginPostQuantumEncryptionResource,
- AsyncOriginPostQuantumEncryptionResource,
- )
from .resources.cloud_connector.cloud_connector import CloudConnectorResource, AsyncCloudConnectorResource
from .resources.durable_objects.durable_objects import DurableObjectsResource, AsyncDurableObjectsResource
from .resources.r2_data_catalog.r2_data_catalog import R2DataCatalogResource, AsyncR2DataCatalogResource
@@ -230,18 +225,41 @@
from .resources.content_scanning.content_scanning import ContentScanningResource, AsyncContentScanningResource
from .resources.custom_hostnames.custom_hostnames import CustomHostnamesResource, AsyncCustomHostnamesResource
from .resources.resource_sharing.resource_sharing import ResourceSharingResource, AsyncResourceSharingResource
+ from .resources.resource_tagging.resource_tagging import ResourceTaggingResource, AsyncResourceTaggingResource
from .resources.token_validation.token_validation import TokenValidationResource, AsyncTokenValidationResource
from .resources.browser_rendering.browser_rendering import BrowserRenderingResource, AsyncBrowserRenderingResource
from .resources.mtls_certificates.mtls_certificates import MTLSCertificatesResource, AsyncMTLSCertificatesResource
from .resources.schema_validation.schema_validation import SchemaValidationResource, AsyncSchemaValidationResource
+ from .resources.url_normalization.url_normalization import URLNormalizationResource, AsyncURLNormalizationResource
+ from .resources.custom_nameservers.custom_nameservers import (
+ CustomNameserversResource,
+ AsyncCustomNameserversResource,
+ )
+ from .resources.google_tag_gateway.google_tag_gateway import GoogleTagGatewayResource, AsyncGoogleTagGatewayResource
+ from .resources.managed_transforms.managed_transforms import (
+ ManagedTransformsResource,
+ AsyncManagedTransformsResource,
+ )
+ from .resources.client_certificates.client_certificates import (
+ ClientCertificatesResource,
+ AsyncClientCertificatesResource,
+ )
from .resources.custom_certificates.custom_certificates import (
CustomCertificatesResource,
AsyncCustomCertificatesResource,
)
+ from .resources.keyless_certificates.keyless_certificates import (
+ KeylessCertificatesResource,
+ AsyncKeylessCertificatesResource,
+ )
from .resources.network_interconnects.network_interconnects import (
NetworkInterconnectsResource,
AsyncNetworkInterconnectsResource,
)
+ from .resources.vulnerability_scanner.vulnerability_scanner import (
+ VulnerabilityScannerResource,
+ AsyncVulnerabilityScannerResource,
+ )
from .resources.workers_for_platforms.workers_for_platforms import (
WorkersForPlatformsResource,
AsyncWorkersForPlatformsResource,
@@ -250,6 +268,10 @@
MagicCloudNetworkingResource,
AsyncMagicCloudNetworkingResource,
)
+ from .resources.origin_ca_certificates.origin_ca_certificates import (
+ OriginCACertificatesResource,
+ AsyncOriginCACertificatesResource,
+ )
from .resources.origin_tls_client_auth.origin_tls_client_auth import (
OriginTLSClientAuthResource,
AsyncOriginTLSClientAuthResource,
@@ -266,6 +288,10 @@
MagicNetworkMonitoringResource,
AsyncMagicNetworkMonitoringResource,
)
+ from .resources.origin_post_quantum_encryption.origin_post_quantum_encryption import (
+ OriginPostQuantumEncryptionResource,
+ AsyncOriginPostQuantumEncryptionResource,
+ )
__all__ = [
"Timeout",
@@ -285,6 +311,8 @@ class Cloudflare(SyncAPIClient):
api_key: str | None
api_email: str | None
user_service_key: str | None
+ account_id: str | None
+ zone_id: str | None
def __init__(
self,
@@ -293,6 +321,8 @@ def __init__(
api_key: str | None = None,
api_email: str | None = None,
user_service_key: str | None = None,
+ account_id: str | None = None,
+ zone_id: str | None = None,
base_url: str | httpx.URL | None = None,
api_version: str | None = None,
timeout: float | Timeout | None | NotGiven = not_given,
@@ -320,6 +350,8 @@ def __init__(
- `api_key` from `CLOUDFLARE_API_KEY`
- `api_email` from `CLOUDFLARE_EMAIL`
- `user_service_key` from `CLOUDFLARE_API_USER_SERVICE_KEY`
+ - `account_id` from `CLOUDFLARE_ACCOUNT_ID`
+ - `zone_id` from `CLOUDFLARE_ZONE_ID`
"""
if api_token is None:
api_token = os.environ.get("CLOUDFLARE_API_TOKEN")
@@ -337,6 +369,14 @@ def __init__(
user_service_key = os.environ.get("CLOUDFLARE_API_USER_SERVICE_KEY")
self.user_service_key = user_service_key
+ if account_id is None:
+ account_id = os.environ.get("CLOUDFLARE_ACCOUNT_ID")
+ self.account_id = account_id
+
+ if zone_id is None:
+ zone_id = os.environ.get("CLOUDFLARE_ZONE_ID")
+ self.zone_id = zone_id
+
if base_url is None:
base_url = os.environ.get("CLOUDFLARE_BASE_URL")
if base_url is None:
@@ -483,6 +523,12 @@ def email_routing(self) -> EmailRoutingResource:
return EmailRoutingResource(self)
+ @cached_property
+ def email_sending(self) -> EmailSendingResource:
+ from .resources.email_sending import EmailSendingResource
+
+ return EmailSendingResource(self)
+
@cached_property
def filters(self) -> FiltersResource:
from .resources.filters import FiltersResource
@@ -783,6 +829,12 @@ def url_scanner(self) -> URLScannerResource:
return URLScannerResource(self)
+ @cached_property
+ def vulnerability_scanner(self) -> VulnerabilityScannerResource:
+ from .resources.vulnerability_scanner import VulnerabilityScannerResource
+
+ return VulnerabilityScannerResource(self)
+
@cached_property
def radar(self) -> RadarResource:
from .resources.radar import RadarResource
@@ -807,6 +859,12 @@ def origin_post_quantum_encryption(self) -> OriginPostQuantumEncryptionResource:
return OriginPostQuantumEncryptionResource(self)
+ @cached_property
+ def google_tag_gateway(self) -> GoogleTagGatewayResource:
+ from .resources.google_tag_gateway import GoogleTagGatewayResource
+
+ return GoogleTagGatewayResource(self)
+
@cached_property
def zaraz(self) -> ZarazResource:
from .resources.zaraz import ZarazResource
@@ -897,6 +955,12 @@ def resource_sharing(self) -> ResourceSharingResource:
return ResourceSharingResource(self)
+ @cached_property
+ def resource_tagging(self) -> ResourceTaggingResource:
+ from .resources.resource_tagging import ResourceTaggingResource
+
+ return ResourceTaggingResource(self)
+
@cached_property
def leaked_credential_checks(self) -> LeakedCredentialChecksResource:
from .resources.leaked_credential_checks import LeakedCredentialChecksResource
@@ -1059,6 +1123,8 @@ def copy(
api_key: str | None = None,
api_email: str | None = None,
user_service_key: str | None = None,
+ account_id: str | None = None,
+ zone_id: str | None = None,
base_url: str | httpx.URL | None = None,
api_version: str | None = None,
timeout: float | Timeout | None | NotGiven = not_given,
@@ -1097,6 +1163,8 @@ def copy(
api_key=api_key or self.api_key,
api_email=api_email or self.api_email,
user_service_key=user_service_key or self.user_service_key,
+ account_id=account_id or self.account_id,
+ zone_id=zone_id or self.zone_id,
base_url=base_url or self.base_url,
api_version=api_version or self.api_version,
timeout=self.timeout if isinstance(timeout, NotGiven) else timeout,
@@ -1111,6 +1179,24 @@ def copy(
# client.with_options(timeout=10).foo.create(...)
with_options = copy
+ def _get_account_id_path_param(self) -> str:
+ from_client = self.account_id
+ if from_client is not None:
+ return from_client
+
+ raise ValueError(
+ "Missing account_id argument; Please provide it at the client level, e.g. Cloudflare(account_id='abcd') or per method."
+ )
+
+ def _get_zone_id_path_param(self) -> str:
+ from_client = self.zone_id
+ if from_client is not None:
+ return from_client
+
+ raise ValueError(
+ "Missing zone_id argument; Please provide it at the client level, e.g. Cloudflare(zone_id='abcd') or per method."
+ )
+
@override
def _make_status_error(
self,
@@ -1151,6 +1237,8 @@ class AsyncCloudflare(AsyncAPIClient):
api_key: str | None
api_email: str | None
user_service_key: str | None
+ account_id: str | None
+ zone_id: str | None
def __init__(
self,
@@ -1159,6 +1247,8 @@ def __init__(
api_key: str | None = None,
api_email: str | None = None,
user_service_key: str | None = None,
+ account_id: str | None = None,
+ zone_id: str | None = None,
base_url: str | httpx.URL | None = None,
api_version: str | None = None,
timeout: float | Timeout | None | NotGiven = not_given,
@@ -1186,6 +1276,8 @@ def __init__(
- `api_key` from `CLOUDFLARE_API_KEY`
- `api_email` from `CLOUDFLARE_EMAIL`
- `user_service_key` from `CLOUDFLARE_API_USER_SERVICE_KEY`
+ - `account_id` from `CLOUDFLARE_ACCOUNT_ID`
+ - `zone_id` from `CLOUDFLARE_ZONE_ID`
"""
if api_token is None:
api_token = os.environ.get("CLOUDFLARE_API_TOKEN")
@@ -1203,6 +1295,14 @@ def __init__(
user_service_key = os.environ.get("CLOUDFLARE_API_USER_SERVICE_KEY")
self.user_service_key = user_service_key
+ if account_id is None:
+ account_id = os.environ.get("CLOUDFLARE_ACCOUNT_ID")
+ self.account_id = account_id
+
+ if zone_id is None:
+ zone_id = os.environ.get("CLOUDFLARE_ZONE_ID")
+ self.zone_id = zone_id
+
if base_url is None:
base_url = os.environ.get("CLOUDFLARE_BASE_URL")
if base_url is None:
@@ -1349,6 +1449,12 @@ def email_routing(self) -> AsyncEmailRoutingResource:
return AsyncEmailRoutingResource(self)
+ @cached_property
+ def email_sending(self) -> AsyncEmailSendingResource:
+ from .resources.email_sending import AsyncEmailSendingResource
+
+ return AsyncEmailSendingResource(self)
+
@cached_property
def filters(self) -> AsyncFiltersResource:
from .resources.filters import AsyncFiltersResource
@@ -1649,6 +1755,12 @@ def url_scanner(self) -> AsyncURLScannerResource:
return AsyncURLScannerResource(self)
+ @cached_property
+ def vulnerability_scanner(self) -> AsyncVulnerabilityScannerResource:
+ from .resources.vulnerability_scanner import AsyncVulnerabilityScannerResource
+
+ return AsyncVulnerabilityScannerResource(self)
+
@cached_property
def radar(self) -> AsyncRadarResource:
from .resources.radar import AsyncRadarResource
@@ -1673,6 +1785,12 @@ def origin_post_quantum_encryption(self) -> AsyncOriginPostQuantumEncryptionReso
return AsyncOriginPostQuantumEncryptionResource(self)
+ @cached_property
+ def google_tag_gateway(self) -> AsyncGoogleTagGatewayResource:
+ from .resources.google_tag_gateway import AsyncGoogleTagGatewayResource
+
+ return AsyncGoogleTagGatewayResource(self)
+
@cached_property
def zaraz(self) -> AsyncZarazResource:
from .resources.zaraz import AsyncZarazResource
@@ -1763,6 +1881,12 @@ def resource_sharing(self) -> AsyncResourceSharingResource:
return AsyncResourceSharingResource(self)
+ @cached_property
+ def resource_tagging(self) -> AsyncResourceTaggingResource:
+ from .resources.resource_tagging import AsyncResourceTaggingResource
+
+ return AsyncResourceTaggingResource(self)
+
@cached_property
def leaked_credential_checks(self) -> AsyncLeakedCredentialChecksResource:
from .resources.leaked_credential_checks import AsyncLeakedCredentialChecksResource
@@ -1925,6 +2049,8 @@ def copy(
api_key: str | None = None,
api_email: str | None = None,
user_service_key: str | None = None,
+ account_id: str | None = None,
+ zone_id: str | None = None,
base_url: str | httpx.URL | None = None,
api_version: str | None = None,
timeout: float | Timeout | None | NotGiven = not_given,
@@ -1963,6 +2089,8 @@ def copy(
api_key=api_key or self.api_key,
api_email=api_email or self.api_email,
user_service_key=user_service_key or self.user_service_key,
+ account_id=account_id or self.account_id,
+ zone_id=zone_id or self.zone_id,
base_url=base_url or self.base_url,
api_version=api_version or self.api_version,
timeout=self.timeout if isinstance(timeout, NotGiven) else timeout,
@@ -1977,6 +2105,24 @@ def copy(
# client.with_options(timeout=10).foo.create(...)
with_options = copy
+ def _get_account_id_path_param(self) -> str:
+ from_client = self.account_id
+ if from_client is not None:
+ return from_client
+
+ raise ValueError(
+ "Missing account_id argument; Please provide it at the client level, e.g. AsyncCloudflare(account_id='abcd') or per method."
+ )
+
+ def _get_zone_id_path_param(self) -> str:
+ from_client = self.zone_id
+ if from_client is not None:
+ return from_client
+
+ raise ValueError(
+ "Missing zone_id argument; Please provide it at the client level, e.g. AsyncCloudflare(zone_id='abcd') or per method."
+ )
+
@override
def _make_status_error(
self,
@@ -2143,6 +2289,12 @@ def email_routing(self) -> email_routing.EmailRoutingResourceWithRawResponse:
return EmailRoutingResourceWithRawResponse(self._client.email_routing)
+ @cached_property
+ def email_sending(self) -> email_sending.EmailSendingResourceWithRawResponse:
+ from .resources.email_sending import EmailSendingResourceWithRawResponse
+
+ return EmailSendingResourceWithRawResponse(self._client.email_sending)
+
@cached_property
def filters(self) -> filters.FiltersResourceWithRawResponse:
from .resources.filters import FiltersResourceWithRawResponse
@@ -2443,6 +2595,12 @@ def url_scanner(self) -> url_scanner.URLScannerResourceWithRawResponse:
return URLScannerResourceWithRawResponse(self._client.url_scanner)
+ @cached_property
+ def vulnerability_scanner(self) -> vulnerability_scanner.VulnerabilityScannerResourceWithRawResponse:
+ from .resources.vulnerability_scanner import VulnerabilityScannerResourceWithRawResponse
+
+ return VulnerabilityScannerResourceWithRawResponse(self._client.vulnerability_scanner)
+
@cached_property
def radar(self) -> radar.RadarResourceWithRawResponse:
from .resources.radar import RadarResourceWithRawResponse
@@ -2469,6 +2627,12 @@ def origin_post_quantum_encryption(
return OriginPostQuantumEncryptionResourceWithRawResponse(self._client.origin_post_quantum_encryption)
+ @cached_property
+ def google_tag_gateway(self) -> google_tag_gateway.GoogleTagGatewayResourceWithRawResponse:
+ from .resources.google_tag_gateway import GoogleTagGatewayResourceWithRawResponse
+
+ return GoogleTagGatewayResourceWithRawResponse(self._client.google_tag_gateway)
+
@cached_property
def zaraz(self) -> zaraz.ZarazResourceWithRawResponse:
from .resources.zaraz import ZarazResourceWithRawResponse
@@ -2559,6 +2723,12 @@ def resource_sharing(self) -> resource_sharing.ResourceSharingResourceWithRawRes
return ResourceSharingResourceWithRawResponse(self._client.resource_sharing)
+ @cached_property
+ def resource_tagging(self) -> resource_tagging.ResourceTaggingResourceWithRawResponse:
+ from .resources.resource_tagging import ResourceTaggingResourceWithRawResponse
+
+ return ResourceTaggingResourceWithRawResponse(self._client.resource_tagging)
+
@cached_property
def leaked_credential_checks(self) -> leaked_credential_checks.LeakedCredentialChecksResourceWithRawResponse:
from .resources.leaked_credential_checks import LeakedCredentialChecksResourceWithRawResponse
@@ -2764,6 +2934,12 @@ def email_routing(self) -> email_routing.AsyncEmailRoutingResourceWithRawRespons
return AsyncEmailRoutingResourceWithRawResponse(self._client.email_routing)
+ @cached_property
+ def email_sending(self) -> email_sending.AsyncEmailSendingResourceWithRawResponse:
+ from .resources.email_sending import AsyncEmailSendingResourceWithRawResponse
+
+ return AsyncEmailSendingResourceWithRawResponse(self._client.email_sending)
+
@cached_property
def filters(self) -> filters.AsyncFiltersResourceWithRawResponse:
from .resources.filters import AsyncFiltersResourceWithRawResponse
@@ -3064,6 +3240,12 @@ def url_scanner(self) -> url_scanner.AsyncURLScannerResourceWithRawResponse:
return AsyncURLScannerResourceWithRawResponse(self._client.url_scanner)
+ @cached_property
+ def vulnerability_scanner(self) -> vulnerability_scanner.AsyncVulnerabilityScannerResourceWithRawResponse:
+ from .resources.vulnerability_scanner import AsyncVulnerabilityScannerResourceWithRawResponse
+
+ return AsyncVulnerabilityScannerResourceWithRawResponse(self._client.vulnerability_scanner)
+
@cached_property
def radar(self) -> radar.AsyncRadarResourceWithRawResponse:
from .resources.radar import AsyncRadarResourceWithRawResponse
@@ -3090,6 +3272,12 @@ def origin_post_quantum_encryption(
return AsyncOriginPostQuantumEncryptionResourceWithRawResponse(self._client.origin_post_quantum_encryption)
+ @cached_property
+ def google_tag_gateway(self) -> google_tag_gateway.AsyncGoogleTagGatewayResourceWithRawResponse:
+ from .resources.google_tag_gateway import AsyncGoogleTagGatewayResourceWithRawResponse
+
+ return AsyncGoogleTagGatewayResourceWithRawResponse(self._client.google_tag_gateway)
+
@cached_property
def zaraz(self) -> zaraz.AsyncZarazResourceWithRawResponse:
from .resources.zaraz import AsyncZarazResourceWithRawResponse
@@ -3180,6 +3368,12 @@ def resource_sharing(self) -> resource_sharing.AsyncResourceSharingResourceWithR
return AsyncResourceSharingResourceWithRawResponse(self._client.resource_sharing)
+ @cached_property
+ def resource_tagging(self) -> resource_tagging.AsyncResourceTaggingResourceWithRawResponse:
+ from .resources.resource_tagging import AsyncResourceTaggingResourceWithRawResponse
+
+ return AsyncResourceTaggingResourceWithRawResponse(self._client.resource_tagging)
+
@cached_property
def leaked_credential_checks(self) -> leaked_credential_checks.AsyncLeakedCredentialChecksResourceWithRawResponse:
from .resources.leaked_credential_checks import AsyncLeakedCredentialChecksResourceWithRawResponse
@@ -3385,6 +3579,12 @@ def email_routing(self) -> email_routing.EmailRoutingResourceWithStreamingRespon
return EmailRoutingResourceWithStreamingResponse(self._client.email_routing)
+ @cached_property
+ def email_sending(self) -> email_sending.EmailSendingResourceWithStreamingResponse:
+ from .resources.email_sending import EmailSendingResourceWithStreamingResponse
+
+ return EmailSendingResourceWithStreamingResponse(self._client.email_sending)
+
@cached_property
def filters(self) -> filters.FiltersResourceWithStreamingResponse:
from .resources.filters import FiltersResourceWithStreamingResponse
@@ -3685,6 +3885,12 @@ def url_scanner(self) -> url_scanner.URLScannerResourceWithStreamingResponse:
return URLScannerResourceWithStreamingResponse(self._client.url_scanner)
+ @cached_property
+ def vulnerability_scanner(self) -> vulnerability_scanner.VulnerabilityScannerResourceWithStreamingResponse:
+ from .resources.vulnerability_scanner import VulnerabilityScannerResourceWithStreamingResponse
+
+ return VulnerabilityScannerResourceWithStreamingResponse(self._client.vulnerability_scanner)
+
@cached_property
def radar(self) -> radar.RadarResourceWithStreamingResponse:
from .resources.radar import RadarResourceWithStreamingResponse
@@ -3711,6 +3917,12 @@ def origin_post_quantum_encryption(
return OriginPostQuantumEncryptionResourceWithStreamingResponse(self._client.origin_post_quantum_encryption)
+ @cached_property
+ def google_tag_gateway(self) -> google_tag_gateway.GoogleTagGatewayResourceWithStreamingResponse:
+ from .resources.google_tag_gateway import GoogleTagGatewayResourceWithStreamingResponse
+
+ return GoogleTagGatewayResourceWithStreamingResponse(self._client.google_tag_gateway)
+
@cached_property
def zaraz(self) -> zaraz.ZarazResourceWithStreamingResponse:
from .resources.zaraz import ZarazResourceWithStreamingResponse
@@ -3801,6 +4013,12 @@ def resource_sharing(self) -> resource_sharing.ResourceSharingResourceWithStream
return ResourceSharingResourceWithStreamingResponse(self._client.resource_sharing)
+ @cached_property
+ def resource_tagging(self) -> resource_tagging.ResourceTaggingResourceWithStreamingResponse:
+ from .resources.resource_tagging import ResourceTaggingResourceWithStreamingResponse
+
+ return ResourceTaggingResourceWithStreamingResponse(self._client.resource_tagging)
+
@cached_property
def leaked_credential_checks(self) -> leaked_credential_checks.LeakedCredentialChecksResourceWithStreamingResponse:
from .resources.leaked_credential_checks import LeakedCredentialChecksResourceWithStreamingResponse
@@ -4008,6 +4226,12 @@ def email_routing(self) -> email_routing.AsyncEmailRoutingResourceWithStreamingR
return AsyncEmailRoutingResourceWithStreamingResponse(self._client.email_routing)
+ @cached_property
+ def email_sending(self) -> email_sending.AsyncEmailSendingResourceWithStreamingResponse:
+ from .resources.email_sending import AsyncEmailSendingResourceWithStreamingResponse
+
+ return AsyncEmailSendingResourceWithStreamingResponse(self._client.email_sending)
+
@cached_property
def filters(self) -> filters.AsyncFiltersResourceWithStreamingResponse:
from .resources.filters import AsyncFiltersResourceWithStreamingResponse
@@ -4310,6 +4534,12 @@ def url_scanner(self) -> url_scanner.AsyncURLScannerResourceWithStreamingRespons
return AsyncURLScannerResourceWithStreamingResponse(self._client.url_scanner)
+ @cached_property
+ def vulnerability_scanner(self) -> vulnerability_scanner.AsyncVulnerabilityScannerResourceWithStreamingResponse:
+ from .resources.vulnerability_scanner import AsyncVulnerabilityScannerResourceWithStreamingResponse
+
+ return AsyncVulnerabilityScannerResourceWithStreamingResponse(self._client.vulnerability_scanner)
+
@cached_property
def radar(self) -> radar.AsyncRadarResourceWithStreamingResponse:
from .resources.radar import AsyncRadarResourceWithStreamingResponse
@@ -4340,6 +4570,12 @@ def origin_post_quantum_encryption(
self._client.origin_post_quantum_encryption
)
+ @cached_property
+ def google_tag_gateway(self) -> google_tag_gateway.AsyncGoogleTagGatewayResourceWithStreamingResponse:
+ from .resources.google_tag_gateway import AsyncGoogleTagGatewayResourceWithStreamingResponse
+
+ return AsyncGoogleTagGatewayResourceWithStreamingResponse(self._client.google_tag_gateway)
+
@cached_property
def zaraz(self) -> zaraz.AsyncZarazResourceWithStreamingResponse:
from .resources.zaraz import AsyncZarazResourceWithStreamingResponse
@@ -4430,6 +4666,12 @@ def resource_sharing(self) -> resource_sharing.AsyncResourceSharingResourceWithS
return AsyncResourceSharingResourceWithStreamingResponse(self._client.resource_sharing)
+ @cached_property
+ def resource_tagging(self) -> resource_tagging.AsyncResourceTaggingResourceWithStreamingResponse:
+ from .resources.resource_tagging import AsyncResourceTaggingResourceWithStreamingResponse
+
+ return AsyncResourceTaggingResourceWithStreamingResponse(self._client.resource_tagging)
+
@cached_property
def leaked_credential_checks(
self,
diff --git a/src/cloudflare/_compat.py b/src/cloudflare/_compat.py
index be9bcfb2c1f..946de7d6921 100644
--- a/src/cloudflare/_compat.py
+++ b/src/cloudflare/_compat.py
@@ -2,7 +2,7 @@
from typing import TYPE_CHECKING, Any, Union, Generic, TypeVar, Callable, cast, overload
from datetime import date, datetime
-from typing_extensions import Self, Literal
+from typing_extensions import Self, Literal, TypedDict
import pydantic
from pydantic.fields import FieldInfo
@@ -132,6 +132,10 @@ def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str:
return model.model_dump_json(indent=indent)
+class _ModelDumpKwargs(TypedDict, total=False):
+ by_alias: bool
+
+
def model_dump(
model: pydantic.BaseModel,
*,
@@ -140,8 +144,12 @@ def model_dump(
exclude_defaults: bool = False,
warnings: bool = True,
mode: Literal["json", "python"] = "python",
+ by_alias: bool | None = None,
) -> dict[str, Any]:
if (not PYDANTIC_V1) or hasattr(model, "model_dump"):
+ kwargs: _ModelDumpKwargs = {}
+ if by_alias is not None:
+ kwargs["by_alias"] = by_alias
return model.model_dump(
mode=mode,
exclude=exclude,
@@ -149,13 +157,12 @@ def model_dump(
exclude_defaults=exclude_defaults,
# warnings are not supported in Pydantic v1
warnings=True if PYDANTIC_V1 else warnings,
+ **kwargs,
)
return cast(
"dict[str, Any]",
model.dict( # pyright: ignore[reportDeprecated, reportUnnecessaryCast]
- exclude=exclude,
- exclude_unset=exclude_unset,
- exclude_defaults=exclude_defaults,
+ exclude=exclude, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, by_alias=bool(by_alias)
),
)
diff --git a/src/cloudflare/_qs.py b/src/cloudflare/_qs.py
index ada6fd3f721..de8c99bc63a 100644
--- a/src/cloudflare/_qs.py
+++ b/src/cloudflare/_qs.py
@@ -101,7 +101,10 @@ def _stringify_item(
items.extend(self._stringify_item(key, item, opts))
return items
elif array_format == "indices":
- raise NotImplementedError("The array indices format is not supported yet")
+ items = []
+ for i, item in enumerate(value):
+ items.extend(self._stringify_item(f"{key}[{i}]", item, opts))
+ return items
elif array_format == "brackets":
items = []
key = key + "[]"
diff --git a/src/cloudflare/_response.py b/src/cloudflare/_response.py
index c23d0dd7811..2dceb9df741 100644
--- a/src/cloudflare/_response.py
+++ b/src/cloudflare/_response.py
@@ -152,6 +152,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T:
),
response=self.http_response,
client=cast(Any, self._client),
+ options=self._options,
),
)
@@ -162,6 +163,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T:
cast_to=extract_stream_chunk_type(self._stream_cls),
response=self.http_response,
client=cast(Any, self._client),
+ options=self._options,
),
)
@@ -175,6 +177,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T:
cast_to=cast_to,
response=self.http_response,
client=cast(Any, self._client),
+ options=self._options,
),
)
diff --git a/src/cloudflare/_streaming.py b/src/cloudflare/_streaming.py
index d26f2aaf70a..d995ba7bc49 100644
--- a/src/cloudflare/_streaming.py
+++ b/src/cloudflare/_streaming.py
@@ -4,7 +4,7 @@
import json
import inspect
from types import TracebackType
-from typing import TYPE_CHECKING, Any, Generic, TypeVar, Iterator, AsyncIterator, cast
+from typing import TYPE_CHECKING, Any, Generic, TypeVar, Iterator, Optional, AsyncIterator, cast
from typing_extensions import Self, Protocol, TypeGuard, override, get_origin, runtime_checkable
import httpx
@@ -13,6 +13,7 @@
if TYPE_CHECKING:
from ._client import Cloudflare, AsyncCloudflare
+ from ._models import FinalRequestOptions
_T = TypeVar("_T")
@@ -22,7 +23,7 @@ class Stream(Generic[_T]):
"""Provides the core interface to iterate over a synchronous stream response."""
response: httpx.Response
-
+ _options: Optional[FinalRequestOptions] = None
_decoder: SSEBytesDecoder
def __init__(
@@ -31,10 +32,12 @@ def __init__(
cast_to: type[_T],
response: httpx.Response,
client: Cloudflare,
+ options: Optional[FinalRequestOptions] = None,
) -> None:
self.response = response
self._cast_to = cast_to
self._client = client
+ self._options = options
self._decoder = client._make_sse_decoder()
self._iterator = self.__stream__()
@@ -85,7 +88,7 @@ class AsyncStream(Generic[_T]):
"""Provides the core interface to iterate over an asynchronous stream response."""
response: httpx.Response
-
+ _options: Optional[FinalRequestOptions] = None
_decoder: SSEDecoder | SSEBytesDecoder
def __init__(
@@ -94,10 +97,12 @@ def __init__(
cast_to: type[_T],
response: httpx.Response,
client: AsyncCloudflare,
+ options: Optional[FinalRequestOptions] = None,
) -> None:
self.response = response
self._cast_to = cast_to
self._client = client
+ self._options = options
self._decoder = client._make_sse_decoder()
self._iterator = self.__stream__()
diff --git a/src/cloudflare/_utils/__init__.py b/src/cloudflare/_utils/__init__.py
index dc64e29a1c0..10cb66d2d95 100644
--- a/src/cloudflare/_utils/__init__.py
+++ b/src/cloudflare/_utils/__init__.py
@@ -1,3 +1,4 @@
+from ._path import path_template as path_template
from ._sync import asyncify as asyncify
from ._proxy import LazyProxy as LazyProxy
from ._utils import (
diff --git a/src/cloudflare/_utils/_compat.py b/src/cloudflare/_utils/_compat.py
index dd703233c56..2c70b299ce4 100644
--- a/src/cloudflare/_utils/_compat.py
+++ b/src/cloudflare/_utils/_compat.py
@@ -26,7 +26,7 @@ def is_union(tp: Optional[Type[Any]]) -> bool:
else:
import types
- return tp is Union or tp is types.UnionType
+ return tp is Union or tp is types.UnionType # type: ignore[comparison-overlap]
def is_typeddict(tp: Type[Any]) -> bool:
diff --git a/src/cloudflare/_utils/_json.py b/src/cloudflare/_utils/_json.py
new file mode 100644
index 00000000000..60584214af7
--- /dev/null
+++ b/src/cloudflare/_utils/_json.py
@@ -0,0 +1,35 @@
+import json
+from typing import Any
+from datetime import datetime
+from typing_extensions import override
+
+import pydantic
+
+from .._compat import model_dump
+
+
+def openapi_dumps(obj: Any) -> bytes:
+ """
+ Serialize an object to UTF-8 encoded JSON bytes.
+
+ Extends the standard json.dumps with support for additional types
+ commonly used in the SDK, such as `datetime`, `pydantic.BaseModel`, etc.
+ """
+ return json.dumps(
+ obj,
+ cls=_CustomEncoder,
+ # Uses the same defaults as httpx's JSON serialization
+ ensure_ascii=False,
+ separators=(",", ":"),
+ allow_nan=False,
+ ).encode()
+
+
+class _CustomEncoder(json.JSONEncoder):
+ @override
+ def default(self, o: Any) -> Any:
+ if isinstance(o, datetime):
+ return o.isoformat()
+ if isinstance(o, pydantic.BaseModel):
+ return model_dump(o, exclude_unset=True, mode="json", by_alias=True)
+ return super().default(o)
diff --git a/src/cloudflare/_utils/_path.py b/src/cloudflare/_utils/_path.py
new file mode 100644
index 00000000000..4d6e1e4cbca
--- /dev/null
+++ b/src/cloudflare/_utils/_path.py
@@ -0,0 +1,127 @@
+from __future__ import annotations
+
+import re
+from typing import (
+ Any,
+ Mapping,
+ Callable,
+)
+from urllib.parse import quote
+
+# Matches '.' or '..' where each dot is either literal or percent-encoded (%2e / %2E).
+_DOT_SEGMENT_RE = re.compile(r"^(?:\.|%2[eE]){1,2}$")
+
+_PLACEHOLDER_RE = re.compile(r"\{(\w+)\}")
+
+
+def _quote_path_segment_part(value: str) -> str:
+ """Percent-encode `value` for use in a URI path segment.
+
+ Considers characters not in `pchar` set from RFC 3986 §3.3 to be unsafe.
+ https://datatracker.ietf.org/doc/html/rfc3986#section-3.3
+ """
+ # quote() already treats unreserved characters (letters, digits, and -._~)
+ # as safe, so we only need to add sub-delims, ':', and '@'.
+ # Notably, unlike the default `safe` for quote(), / is unsafe and must be quoted.
+ return quote(value, safe="!$&'()*+,;=:@")
+
+
+def _quote_query_part(value: str) -> str:
+ """Percent-encode `value` for use in a URI query string.
+
+ Considers &, = and characters not in `query` set from RFC 3986 §3.4 to be unsafe.
+ https://datatracker.ietf.org/doc/html/rfc3986#section-3.4
+ """
+ return quote(value, safe="!$'()*+,;:@/?")
+
+
+def _quote_fragment_part(value: str) -> str:
+ """Percent-encode `value` for use in a URI fragment.
+
+ Considers characters not in `fragment` set from RFC 3986 §3.5 to be unsafe.
+ https://datatracker.ietf.org/doc/html/rfc3986#section-3.5
+ """
+ return quote(value, safe="!$&'()*+,;=:@/?")
+
+
+def _interpolate(
+ template: str,
+ values: Mapping[str, Any],
+ quoter: Callable[[str], str],
+) -> str:
+ """Replace {name} placeholders in `template`, quoting each value with `quoter`.
+
+ Placeholder names are looked up in `values`.
+
+ Raises:
+ KeyError: If a placeholder is not found in `values`.
+ """
+ # re.split with a capturing group returns alternating
+ # [text, name, text, name, ..., text] elements.
+ parts = _PLACEHOLDER_RE.split(template)
+
+ for i in range(1, len(parts), 2):
+ name = parts[i]
+ if name not in values:
+ raise KeyError(f"a value for placeholder {{{name}}} was not provided")
+ val = values[name]
+ if val is None:
+ parts[i] = "null"
+ elif isinstance(val, bool):
+ parts[i] = "true" if val else "false"
+ else:
+ parts[i] = quoter(str(values[name]))
+
+ return "".join(parts)
+
+
+def path_template(template: str, /, **kwargs: Any) -> str:
+ """Interpolate {name} placeholders in `template` from keyword arguments.
+
+ Args:
+ template: The template string containing {name} placeholders.
+ **kwargs: Keyword arguments to interpolate into the template.
+
+ Returns:
+ The template with placeholders interpolated and percent-encoded.
+
+ Safe characters for percent-encoding are dependent on the URI component.
+ Placeholders in path and fragment portions are percent-encoded where the `segment`
+ and `fragment` sets from RFC 3986 respectively are considered safe.
+ Placeholders in the query portion are percent-encoded where the `query` set from
+ RFC 3986 §3.3 is considered safe except for = and & characters.
+
+ Raises:
+ KeyError: If a placeholder is not found in `kwargs`.
+ ValueError: If resulting path contains /./ or /../ segments (including percent-encoded dot-segments).
+ """
+ # Split the template into path, query, and fragment portions.
+ fragment_template: str | None = None
+ query_template: str | None = None
+
+ rest = template
+ if "#" in rest:
+ rest, fragment_template = rest.split("#", 1)
+ if "?" in rest:
+ rest, query_template = rest.split("?", 1)
+ path_template = rest
+
+ # Interpolate each portion with the appropriate quoting rules.
+ path_result = _interpolate(path_template, kwargs, _quote_path_segment_part)
+
+ # Reject dot-segments (. and ..) in the final assembled path. The check
+ # runs after interpolation so that adjacent placeholders or a mix of static
+ # text and placeholders that together form a dot-segment are caught.
+ # Also reject percent-encoded dot-segments to protect against incorrectly
+ # implemented normalization in servers/proxies.
+ for segment in path_result.split("/"):
+ if _DOT_SEGMENT_RE.match(segment):
+ raise ValueError(f"Constructed path {path_result!r} contains dot-segment {segment!r} which is not allowed")
+
+ result = path_result
+ if query_template is not None:
+ result += "?" + _interpolate(query_template, kwargs, _quote_query_part)
+ if fragment_template is not None:
+ result += "#" + _interpolate(fragment_template, kwargs, _quote_fragment_part)
+
+ return result
diff --git a/src/cloudflare/_utils/_utils.py b/src/cloudflare/_utils/_utils.py
index eec7f4a1f23..63b8cd602a6 100644
--- a/src/cloudflare/_utils/_utils.py
+++ b/src/cloudflare/_utils/_utils.py
@@ -86,8 +86,9 @@ def _extract_items(
index += 1
if is_dict(obj):
try:
- # We are at the last entry in the path so we must remove the field
- if (len(path)) == index:
+ # Remove the field if there are no more dict keys in the path,
+ # only "" traversal markers or end.
+ if all(p == "" for p in path[index:]):
item = obj.pop(key)
else:
item = obj[key]
diff --git a/src/cloudflare/_version.py b/src/cloudflare/_version.py
index d358440ad0c..f204e83c6ac 100644
--- a/src/cloudflare/_version.py
+++ b/src/cloudflare/_version.py
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
__title__ = "cloudflare"
-__version__ = "5.0.0-beta.1" # x-release-please-version
+__version__ = "5.0.0-beta.2" # x-release-please-version
diff --git a/src/cloudflare/resources/abuse_reports/abuse_reports.py b/src/cloudflare/resources/abuse_reports/abuse_reports.py
index 9cf0a64aa03..e1e4c79487a 100644
--- a/src/cloudflare/resources/abuse_reports/abuse_reports.py
+++ b/src/cloudflare/resources/abuse_reports/abuse_reports.py
@@ -8,7 +8,7 @@
import httpx
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ..._utils import required_args, maybe_transform, async_maybe_transform
+from ..._utils import path_template, required_args, maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -65,7 +65,7 @@ def create(
self,
report_param: str,
*,
- account_id: str,
+ account_id: str | None = None,
act: Literal["abuse_dmca"],
address1: str,
agent_name: str,
@@ -175,7 +175,7 @@ def create(
self,
report_param: str,
*,
- account_id: str,
+ account_id: str | None = None,
act: Literal["abuse_trademark"],
email: str,
email2: str,
@@ -266,14 +266,14 @@ def create(
self,
report_param: str,
*,
- account_id: str,
+ account_id: str | None = None,
act: Literal["abuse_general"],
email: str,
email2: str,
host_notification: Literal["send", "send-anon"],
justification: str,
name: str,
- owner_notification: Literal["send", "send-anon", "none"],
+ owner_notification: Literal["send", "send-anon"],
urls: str,
comments: str | Omit = omit,
company: str | Omit = omit,
@@ -364,7 +364,7 @@ def create(
self,
report_param: str,
*,
- account_id: str,
+ account_id: str | None = None,
act: Literal["abuse_phishing"],
email: str,
email2: str,
@@ -450,7 +450,7 @@ def create(
self,
report_param: str,
*,
- account_id: str,
+ account_id: str | None = None,
act: Literal["abuse_children"],
email: str,
email2: str,
@@ -540,7 +540,7 @@ def create(
self,
report_param: str,
*,
- account_id: str,
+ account_id: str | None = None,
act: Literal["abuse_threat"],
email: str,
email2: str,
@@ -622,7 +622,7 @@ def create(
self,
report_param: str,
*,
- account_id: str,
+ account_id: str | None = None,
act: Literal["abuse_registrar_whois"],
email: str,
email2: str,
@@ -631,6 +631,7 @@ def create(
urls: str,
comments: str | Omit = omit,
company: str | Omit = omit,
+ reg_who_request: abuse_report_create_params.AbuseReportsRegistrarWhoisReportRegWhoRequest | Omit = omit,
reported_country: str | Omit = omit,
reported_user_agent: str | Omit = omit,
tele: str | Omit = omit,
@@ -671,6 +672,8 @@ def create(
company: Text not exceeding 100 characters. This field may be released by Cloudflare to
third parties such as the Lumen Database (https://lumendatabase.org/).
+ reg_who_request: RDP-mandated fields for registrar WHOIS data disclosure requests.
+
reported_country: Text containing 2 characters
reported_user_agent: Text not exceeding 255 characters
@@ -695,7 +698,7 @@ def create(
self,
report_param: str,
*,
- account_id: str,
+ account_id: str | None = None,
act: Literal["abuse_ncsei"],
email: str,
email2: str,
@@ -776,7 +779,6 @@ def create(
@required_args(
[
- "account_id",
"act",
"address1",
"agent_name",
@@ -794,7 +796,6 @@ def create(
"urls",
],
[
- "account_id",
"act",
"email",
"email2",
@@ -807,19 +808,8 @@ def create(
"trademark_symbol",
"urls",
],
+ ["act", "email", "email2", "host_notification", "justification", "name", "owner_notification", "urls"],
[
- "account_id",
- "act",
- "email",
- "email2",
- "host_notification",
- "justification",
- "name",
- "owner_notification",
- "urls",
- ],
- [
- "account_id",
"act",
"email",
"email2",
@@ -830,9 +820,8 @@ def create(
"owner_notification",
"urls",
],
- ["account_id", "act", "email", "email2", "name", "owner_notification", "urls"],
+ ["act", "email", "email2", "name", "owner_notification", "urls"],
[
- "account_id",
"act",
"email",
"email2",
@@ -847,7 +836,7 @@ def create(
self,
report_param: str,
*,
- account_id: str,
+ account_id: str | None = None,
act: Literal["abuse_dmca"]
| Literal["abuse_trademark"]
| Literal["abuse_general"]
@@ -866,7 +855,7 @@ def create(
host_notification: Literal["send"] | Literal["send", "send-anon"] | Omit = omit,
name: str,
original_work: str | Omit = omit,
- owner_notification: Literal["send"] | Literal["send", "send-anon", "none"] | Literal["send", "send-anon"],
+ owner_notification: Literal["send"] | Literal["send", "send-anon"] | Literal["send", "send-anon", "none"],
signature: str | Omit = omit,
state: str | Omit = omit,
urls: str,
@@ -884,6 +873,7 @@ def create(
ports_protocols: str | Omit = omit,
source_ips: str | Omit = omit,
ncmec_notification: Literal["send", "send-anon"] | Omit = omit,
+ reg_who_request: abuse_report_create_params.AbuseReportsRegistrarWhoisReportRegWhoRequest | Omit = omit,
ncsei_subject_representation: bool | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -892,12 +882,16 @@ def create(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> str:
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not report_param:
raise ValueError(f"Expected a non-empty value for `report_param` but received {report_param!r}")
return self._post(
- f"/accounts/{account_id}/abuse-reports/{report_param}",
+ path_template(
+ "/accounts/{account_id}/abuse-reports/{report_param}", account_id=account_id, report_param=report_param
+ ),
body=maybe_transform(
{
"act": act,
@@ -929,6 +923,7 @@ def create(
"ports_protocols": ports_protocols,
"source_ips": source_ips,
"ncmec_notification": ncmec_notification,
+ "reg_who_request": reg_who_request,
"ncsei_subject_representation": ncsei_subject_representation,
},
abuse_report_create_params.AbuseReportCreateParams,
@@ -946,7 +941,7 @@ def create(
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
created_after: str | Omit = omit,
created_before: str | Omit = omit,
domain: str | Omit = omit,
@@ -993,10 +988,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/abuse-reports",
+ path_template("/accounts/{account_id}/abuse-reports", account_id=account_id),
page=SyncV4PagePagination[Optional[AbuseReportListResponse]],
options=make_request_options(
extra_headers=extra_headers,
@@ -1025,7 +1022,7 @@ def get(
self,
report_param: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -1045,12 +1042,16 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not report_param:
raise ValueError(f"Expected a non-empty value for `report_param` but received {report_param!r}")
return self._get(
- f"/accounts/{account_id}/abuse-reports/{report_param}",
+ path_template(
+ "/accounts/{account_id}/abuse-reports/{report_param}", account_id=account_id, report_param=report_param
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -1091,7 +1092,7 @@ async def create(
self,
report_param: str,
*,
- account_id: str,
+ account_id: str | None = None,
act: Literal["abuse_dmca"],
address1: str,
agent_name: str,
@@ -1201,7 +1202,7 @@ async def create(
self,
report_param: str,
*,
- account_id: str,
+ account_id: str | None = None,
act: Literal["abuse_trademark"],
email: str,
email2: str,
@@ -1292,14 +1293,14 @@ async def create(
self,
report_param: str,
*,
- account_id: str,
+ account_id: str | None = None,
act: Literal["abuse_general"],
email: str,
email2: str,
host_notification: Literal["send", "send-anon"],
justification: str,
name: str,
- owner_notification: Literal["send", "send-anon", "none"],
+ owner_notification: Literal["send", "send-anon"],
urls: str,
comments: str | Omit = omit,
company: str | Omit = omit,
@@ -1390,7 +1391,7 @@ async def create(
self,
report_param: str,
*,
- account_id: str,
+ account_id: str | None = None,
act: Literal["abuse_phishing"],
email: str,
email2: str,
@@ -1476,7 +1477,7 @@ async def create(
self,
report_param: str,
*,
- account_id: str,
+ account_id: str | None = None,
act: Literal["abuse_children"],
email: str,
email2: str,
@@ -1566,7 +1567,7 @@ async def create(
self,
report_param: str,
*,
- account_id: str,
+ account_id: str | None = None,
act: Literal["abuse_threat"],
email: str,
email2: str,
@@ -1648,7 +1649,7 @@ async def create(
self,
report_param: str,
*,
- account_id: str,
+ account_id: str | None = None,
act: Literal["abuse_registrar_whois"],
email: str,
email2: str,
@@ -1657,6 +1658,7 @@ async def create(
urls: str,
comments: str | Omit = omit,
company: str | Omit = omit,
+ reg_who_request: abuse_report_create_params.AbuseReportsRegistrarWhoisReportRegWhoRequest | Omit = omit,
reported_country: str | Omit = omit,
reported_user_agent: str | Omit = omit,
tele: str | Omit = omit,
@@ -1697,6 +1699,8 @@ async def create(
company: Text not exceeding 100 characters. This field may be released by Cloudflare to
third parties such as the Lumen Database (https://lumendatabase.org/).
+ reg_who_request: RDP-mandated fields for registrar WHOIS data disclosure requests.
+
reported_country: Text containing 2 characters
reported_user_agent: Text not exceeding 255 characters
@@ -1721,7 +1725,7 @@ async def create(
self,
report_param: str,
*,
- account_id: str,
+ account_id: str | None = None,
act: Literal["abuse_ncsei"],
email: str,
email2: str,
@@ -1802,7 +1806,6 @@ async def create(
@required_args(
[
- "account_id",
"act",
"address1",
"agent_name",
@@ -1820,7 +1823,6 @@ async def create(
"urls",
],
[
- "account_id",
"act",
"email",
"email2",
@@ -1833,19 +1835,8 @@ async def create(
"trademark_symbol",
"urls",
],
+ ["act", "email", "email2", "host_notification", "justification", "name", "owner_notification", "urls"],
[
- "account_id",
- "act",
- "email",
- "email2",
- "host_notification",
- "justification",
- "name",
- "owner_notification",
- "urls",
- ],
- [
- "account_id",
"act",
"email",
"email2",
@@ -1856,9 +1847,8 @@ async def create(
"owner_notification",
"urls",
],
- ["account_id", "act", "email", "email2", "name", "owner_notification", "urls"],
+ ["act", "email", "email2", "name", "owner_notification", "urls"],
[
- "account_id",
"act",
"email",
"email2",
@@ -1873,7 +1863,7 @@ async def create(
self,
report_param: str,
*,
- account_id: str,
+ account_id: str | None = None,
act: Literal["abuse_dmca"]
| Literal["abuse_trademark"]
| Literal["abuse_general"]
@@ -1892,7 +1882,7 @@ async def create(
host_notification: Literal["send"] | Literal["send", "send-anon"] | Omit = omit,
name: str,
original_work: str | Omit = omit,
- owner_notification: Literal["send"] | Literal["send", "send-anon", "none"] | Literal["send", "send-anon"],
+ owner_notification: Literal["send"] | Literal["send", "send-anon"] | Literal["send", "send-anon", "none"],
signature: str | Omit = omit,
state: str | Omit = omit,
urls: str,
@@ -1910,6 +1900,7 @@ async def create(
ports_protocols: str | Omit = omit,
source_ips: str | Omit = omit,
ncmec_notification: Literal["send", "send-anon"] | Omit = omit,
+ reg_who_request: abuse_report_create_params.AbuseReportsRegistrarWhoisReportRegWhoRequest | Omit = omit,
ncsei_subject_representation: bool | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -1918,12 +1909,16 @@ async def create(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> str:
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not report_param:
raise ValueError(f"Expected a non-empty value for `report_param` but received {report_param!r}")
return await self._post(
- f"/accounts/{account_id}/abuse-reports/{report_param}",
+ path_template(
+ "/accounts/{account_id}/abuse-reports/{report_param}", account_id=account_id, report_param=report_param
+ ),
body=await async_maybe_transform(
{
"act": act,
@@ -1955,6 +1950,7 @@ async def create(
"ports_protocols": ports_protocols,
"source_ips": source_ips,
"ncmec_notification": ncmec_notification,
+ "reg_who_request": reg_who_request,
"ncsei_subject_representation": ncsei_subject_representation,
},
abuse_report_create_params.AbuseReportCreateParams,
@@ -1972,7 +1968,7 @@ async def create(
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
created_after: str | Omit = omit,
created_before: str | Omit = omit,
domain: str | Omit = omit,
@@ -2019,10 +2015,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/abuse-reports",
+ path_template("/accounts/{account_id}/abuse-reports", account_id=account_id),
page=AsyncV4PagePagination[Optional[AbuseReportListResponse]],
options=make_request_options(
extra_headers=extra_headers,
@@ -2051,7 +2049,7 @@ async def get(
self,
report_param: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -2071,12 +2069,16 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not report_param:
raise ValueError(f"Expected a non-empty value for `report_param` but received {report_param!r}")
return await self._get(
- f"/accounts/{account_id}/abuse-reports/{report_param}",
+ path_template(
+ "/accounts/{account_id}/abuse-reports/{report_param}", account_id=account_id, report_param=report_param
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/abuse_reports/api.md b/src/cloudflare/resources/abuse_reports/api.md
new file mode 100644
index 00000000000..30ecdfde687
--- /dev/null
+++ b/src/cloudflare/resources/abuse_reports/api.md
@@ -0,0 +1,30 @@
+# AbuseReports
+
+Types:
+
+```python
+from cloudflare.types.abuse_reports import (
+ AbuseReportCreateResponse,
+ AbuseReportListResponse,
+ AbuseReportGetResponse,
+)
+```
+
+Methods:
+
+- client.abuse_reports.create(report_param, \*, account_id, \*\*params) -> str
+- client.abuse_reports.list(\*, account_id, \*\*params) -> SyncV4PagePagination[Optional[AbuseReportListResponse]]
+- client.abuse_reports.get(report_param, \*, account_id) -> AbuseReportGetResponse
+
+## Mitigations
+
+Types:
+
+```python
+from cloudflare.types.abuse_reports import MitigationListResponse, MitigationReviewResponse
+```
+
+Methods:
+
+- client.abuse_reports.mitigations.list(report_id, \*, account_id, \*\*params) -> SyncV4PagePagination[Optional[MitigationListResponse]]
+- client.abuse_reports.mitigations.review(report_id, \*, account_id, \*\*params) -> SyncSinglePage[MitigationReviewResponse]
diff --git a/src/cloudflare/resources/abuse_reports/mitigations.py b/src/cloudflare/resources/abuse_reports/mitigations.py
index 298b58d4143..f0714b399b2 100644
--- a/src/cloudflare/resources/abuse_reports/mitigations.py
+++ b/src/cloudflare/resources/abuse_reports/mitigations.py
@@ -8,7 +8,7 @@
import httpx
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ..._utils import maybe_transform
+from ..._utils import path_template, maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -50,7 +50,7 @@ def list(
self,
report_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
effective_after: str | Omit = omit,
effective_before: str | Omit = omit,
entity_type: Literal["url_pattern", "account", "zone"] | Omit = omit,
@@ -70,6 +70,7 @@ def list(
status: Literal["pending", "active", "in_review", "cancelled", "removed"] | Omit = omit,
type: Literal[
"legal_block",
+ "misleading_interstitial",
"phishing_interstitial",
"network_block",
"rate_limit_cache",
@@ -114,12 +115,18 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not report_id:
raise ValueError(f"Expected a non-empty value for `report_id` but received {report_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/abuse-reports/{report_id}/mitigations",
+ path_template(
+ "/accounts/{account_id}/abuse-reports/{report_id}/mitigations",
+ account_id=account_id,
+ report_id=report_id,
+ ),
page=SyncV4PagePagination[Optional[MitigationListResponse]],
options=make_request_options(
extra_headers=extra_headers,
@@ -147,7 +154,7 @@ def review(
self,
report_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
appeals: Iterable[mitigation_review_params.Appeal],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -170,12 +177,18 @@ def review(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not report_id:
raise ValueError(f"Expected a non-empty value for `report_id` but received {report_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/abuse-reports/{report_id}/mitigations/appeal",
+ path_template(
+ "/accounts/{account_id}/abuse-reports/{report_id}/mitigations/appeal",
+ account_id=account_id,
+ report_id=report_id,
+ ),
page=SyncSinglePage[MitigationReviewResponse],
body=maybe_transform({"appeals": appeals}, mitigation_review_params.MitigationReviewParams),
options=make_request_options(
@@ -210,7 +223,7 @@ def list(
self,
report_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
effective_after: str | Omit = omit,
effective_before: str | Omit = omit,
entity_type: Literal["url_pattern", "account", "zone"] | Omit = omit,
@@ -230,6 +243,7 @@ def list(
status: Literal["pending", "active", "in_review", "cancelled", "removed"] | Omit = omit,
type: Literal[
"legal_block",
+ "misleading_interstitial",
"phishing_interstitial",
"network_block",
"rate_limit_cache",
@@ -274,12 +288,18 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not report_id:
raise ValueError(f"Expected a non-empty value for `report_id` but received {report_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/abuse-reports/{report_id}/mitigations",
+ path_template(
+ "/accounts/{account_id}/abuse-reports/{report_id}/mitigations",
+ account_id=account_id,
+ report_id=report_id,
+ ),
page=AsyncV4PagePagination[Optional[MitigationListResponse]],
options=make_request_options(
extra_headers=extra_headers,
@@ -307,7 +327,7 @@ def review(
self,
report_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
appeals: Iterable[mitigation_review_params.Appeal],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -330,12 +350,18 @@ def review(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not report_id:
raise ValueError(f"Expected a non-empty value for `report_id` but received {report_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/abuse-reports/{report_id}/mitigations/appeal",
+ path_template(
+ "/accounts/{account_id}/abuse-reports/{report_id}/mitigations/appeal",
+ account_id=account_id,
+ report_id=report_id,
+ ),
page=AsyncSinglePage[MitigationReviewResponse],
body=maybe_transform({"appeals": appeals}, mitigation_review_params.MitigationReviewParams),
options=make_request_options(
diff --git a/src/cloudflare/resources/accounts/accounts.py b/src/cloudflare/resources/accounts/accounts.py
index aedb92f84e7..301d01381e7 100644
--- a/src/cloudflare/resources/accounts/accounts.py
+++ b/src/cloudflare/resources/accounts/accounts.py
@@ -24,7 +24,7 @@
AsyncMembersResourceWithStreamingResponse,
)
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ..._utils import maybe_transform, async_maybe_transform
+from ..._utils import path_template, maybe_transform, async_maybe_transform
from ..._compat import cached_property
from .logs.logs import (
LogsResource,
@@ -161,7 +161,7 @@ def create(
def update(
self,
*,
- account_id: str,
+ account_id: str | None = None,
id: str,
name: str,
type: Literal["standard", "enterprise"],
@@ -196,10 +196,12 @@ def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._put(
- f"/accounts/{account_id}",
+ path_template("/accounts/{account_id}", account_id=account_id),
body=maybe_transform(
{
"id": id,
@@ -278,7 +280,7 @@ def list(
def delete(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -303,10 +305,12 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._delete(
- f"/accounts/{account_id}",
+ path_template("/accounts/{account_id}", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -320,7 +324,7 @@ def delete(
def get(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -342,10 +346,12 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get(
- f"/accounts/{account_id}",
+ path_template("/accounts/{account_id}", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -451,7 +457,7 @@ async def create(
async def update(
self,
*,
- account_id: str,
+ account_id: str | None = None,
id: str,
name: str,
type: Literal["standard", "enterprise"],
@@ -486,10 +492,12 @@ async def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._put(
- f"/accounts/{account_id}",
+ path_template("/accounts/{account_id}", account_id=account_id),
body=await async_maybe_transform(
{
"id": id,
@@ -568,7 +576,7 @@ def list(
async def delete(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -593,10 +601,12 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._delete(
- f"/accounts/{account_id}",
+ path_template("/accounts/{account_id}", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -610,7 +620,7 @@ async def delete(
async def get(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -632,10 +642,12 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._get(
- f"/accounts/{account_id}",
+ path_template("/accounts/{account_id}", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/accounts/api.md b/src/cloudflare/resources/accounts/api.md
new file mode 100644
index 00000000000..47d53810d58
--- /dev/null
+++ b/src/cloudflare/resources/accounts/api.md
@@ -0,0 +1,103 @@
+# Accounts
+
+Types:
+
+```python
+from cloudflare.types.accounts import Account, AccountDeleteResponse
+```
+
+Methods:
+
+- client.accounts.create(\*\*params) -> Optional[Account]
+- client.accounts.update(\*, account_id, \*\*params) -> Optional[Account]
+- client.accounts.list(\*\*params) -> SyncV4PagePaginationArray[Account]
+- client.accounts.delete(\*, account_id) -> Optional[AccountDeleteResponse]
+- client.accounts.get(\*, account_id) -> Optional[Account]
+
+## Members
+
+Types:
+
+```python
+from cloudflare.types.accounts import Status, MemberDeleteResponse
+```
+
+Methods:
+
+- client.accounts.members.create(\*, account_id, \*\*params) -> Optional[Member]
+- client.accounts.members.update(member_id, \*, account_id, \*\*params) -> Optional[Member]
+- client.accounts.members.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[Member]
+- client.accounts.members.delete(member_id, \*, account_id) -> Optional[MemberDeleteResponse]
+- client.accounts.members.get(member_id, \*, account_id) -> Optional[Member]
+
+## Roles
+
+Methods:
+
+- client.accounts.roles.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[Role]
+- client.accounts.roles.get(role_id, \*, account_id) -> Optional[Role]
+
+## Subscriptions
+
+Types:
+
+```python
+from cloudflare.types.accounts import SubscriptionDeleteResponse
+```
+
+Methods:
+
+- client.accounts.subscriptions.create(\*, account_id, \*\*params) -> Subscription
+- client.accounts.subscriptions.update(subscription_identifier, \*, account_id, \*\*params) -> Subscription
+- client.accounts.subscriptions.delete(subscription_identifier, \*, account_id) -> SubscriptionDeleteResponse
+- client.accounts.subscriptions.get(\*, account_id) -> SyncSinglePage[Subscription]
+
+## Tokens
+
+Types:
+
+```python
+from cloudflare.types.accounts import TokenCreateResponse, TokenDeleteResponse, TokenVerifyResponse
+```
+
+Methods:
+
+- client.accounts.tokens.create(\*, account_id, \*\*params) -> Optional[TokenCreateResponse]
+- client.accounts.tokens.update(token_id, \*, account_id, \*\*params) -> Optional[Token]
+- client.accounts.tokens.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[Token]
+- client.accounts.tokens.delete(token_id, \*, account_id) -> Optional[TokenDeleteResponse]
+- client.accounts.tokens.get(token_id, \*, account_id) -> Optional[Token]
+- client.accounts.tokens.verify(\*, account_id) -> Optional[TokenVerifyResponse]
+
+### PermissionGroups
+
+Types:
+
+```python
+from cloudflare.types.accounts.tokens import PermissionGroupListResponse, PermissionGroupGetResponse
+```
+
+Methods:
+
+- client.accounts.tokens.permission_groups.list(\*, account_id, \*\*params) -> SyncSinglePage[PermissionGroupListResponse]
+- client.accounts.tokens.permission_groups.get(\*, account_id, \*\*params) -> Optional[PermissionGroupGetResponse]
+
+### Value
+
+Methods:
+
+- client.accounts.tokens.value.update(token_id, \*, account_id, \*\*params) -> str
+
+## Logs
+
+### Audit
+
+Types:
+
+```python
+from cloudflare.types.accounts.logs import AuditListResponse
+```
+
+Methods:
+
+- client.accounts.logs.audit.list(\*, account_id, \*\*params) -> SyncCursorPaginationAfter[AuditListResponse]
diff --git a/src/cloudflare/resources/accounts/logs/audit.py b/src/cloudflare/resources/accounts/logs/audit.py
index fd663c7cc68..f059652a65e 100644
--- a/src/cloudflare/resources/accounts/logs/audit.py
+++ b/src/cloudflare/resources/accounts/logs/audit.py
@@ -9,7 +9,7 @@
import httpx
from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ...._utils import maybe_transform
+from ...._utils import path_template, maybe_transform
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -49,7 +49,7 @@ def with_streaming_response(self) -> AuditResourceWithStreamingResponse:
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
before: Union[str, date],
since: Union[str, date],
id: audit_list_params.ID | Omit = omit,
@@ -84,13 +84,8 @@ def list(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncCursorPaginationAfter[AuditListResponse]:
- """Gets a list of audit logs for an account.
-
-
This is the beta release
- of Audit Logs Version 2. Since this is a beta version, there may be gaps or
- missing entries in the available audit logs. Be aware of the following
- limitations.
- Audit logs are available only for the past 30 days.
-
- Error handling is not yet implemented.
+ """
+ Gets a list of audit logs for an account.
Args:
account_id: The unique id that identifies the account.
@@ -121,10 +116,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/logs/audit",
+ path_template("/accounts/{account_id}/logs/audit", account_id=account_id),
page=SyncCursorPaginationAfter[AuditListResponse],
options=make_request_options(
extra_headers=extra_headers,
@@ -191,7 +188,7 @@ def with_streaming_response(self) -> AsyncAuditResourceWithStreamingResponse:
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
before: Union[str, date],
since: Union[str, date],
id: audit_list_params.ID | Omit = omit,
@@ -226,13 +223,8 @@ def list(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[AuditListResponse, AsyncCursorPaginationAfter[AuditListResponse]]:
- """Gets a list of audit logs for an account.
-
-
This is the beta release
- of Audit Logs Version 2. Since this is a beta version, there may be gaps or
- missing entries in the available audit logs. Be aware of the following
- limitations.
- Audit logs are available only for the past 30 days.
-
- Error handling is not yet implemented.
+ """
+ Gets a list of audit logs for an account.
Args:
account_id: The unique id that identifies the account.
@@ -263,10 +255,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/logs/audit",
+ path_template("/accounts/{account_id}/logs/audit", account_id=account_id),
page=AsyncCursorPaginationAfter[AuditListResponse],
options=make_request_options(
extra_headers=extra_headers,
diff --git a/src/cloudflare/resources/accounts/members.py b/src/cloudflare/resources/accounts/members.py
index 61eb3ff9fc2..f69d6eb0ef4 100644
--- a/src/cloudflare/resources/accounts/members.py
+++ b/src/cloudflare/resources/accounts/members.py
@@ -8,7 +8,7 @@
import httpx
from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
-from ..._utils import required_args, maybe_transform, async_maybe_transform
+from ..._utils import path_template, required_args, maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -52,7 +52,7 @@ def with_streaming_response(self) -> MembersResourceWithStreamingResponse:
def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
email: str,
roles: SequenceNotStr[str],
status: Literal["accepted", "pending"] | Omit = omit,
@@ -73,6 +73,10 @@ def create(
roles: Array of roles associated with this member.
+ status: Status of the member invitation. If not provided during creation, defaults to
+ 'pending'. Changing from 'accepted' back to 'pending' will trigger a replacement
+ of the member resource in Terraform.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -87,7 +91,7 @@ def create(
def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
email: str,
policies: Iterable[member_create_params.IAMCreateMemberWithPoliciesPolicy],
status: Literal["accepted", "pending"] | Omit = omit,
@@ -108,6 +112,10 @@ def create(
policies: Array of policies associated with this member.
+ status: Status of the member invitation. If not provided during creation, defaults to
+ 'pending'. Changing from 'accepted' back to 'pending' will trigger a replacement
+ of the member resource in Terraform.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -118,11 +126,11 @@ def create(
"""
...
- @required_args(["account_id", "email", "roles"], ["account_id", "email", "policies"])
+ @required_args(["email", "roles"], ["email", "policies"])
def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
email: str,
roles: SequenceNotStr[str] | Omit = omit,
status: Literal["accepted", "pending"] | Omit = omit,
@@ -134,10 +142,12 @@ def create(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> Optional[Member]:
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._post(
- f"/accounts/{account_id}/members",
+ path_template("/accounts/{account_id}/members", account_id=account_id),
body=maybe_transform(
{
"email": email,
@@ -162,7 +172,7 @@ def update(
self,
member_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
roles: Iterable[Role] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -196,7 +206,7 @@ def update(
self,
member_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
policies: Iterable[member_update_params.IAMUpdateMemberWithPoliciesPolicy],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -225,12 +235,11 @@ def update(
"""
...
- @required_args(["account_id"], ["account_id", "policies"])
def update(
self,
member_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
roles: Iterable[Role] | Omit = omit,
policies: Iterable[member_update_params.IAMUpdateMemberWithPoliciesPolicy] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -240,12 +249,14 @@ def update(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> Optional[Member]:
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not member_id:
raise ValueError(f"Expected a non-empty value for `member_id` but received {member_id!r}")
return self._put(
- f"/accounts/{account_id}/members/{member_id}",
+ path_template("/accounts/{account_id}/members/{member_id}", account_id=account_id, member_id=member_id),
body=maybe_transform(
{
"roles": roles,
@@ -266,7 +277,7 @@ def update(
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
direction: Literal["asc", "desc"] | Omit = omit,
order: Literal["user.first_name", "user.last_name", "user.email", "status"] | Omit = omit,
page: float | Omit = omit,
@@ -303,10 +314,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/members",
+ path_template("/accounts/{account_id}/members", account_id=account_id),
page=SyncV4PagePaginationArray[Member],
options=make_request_options(
extra_headers=extra_headers,
@@ -331,7 +344,7 @@ def delete(
self,
member_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -355,12 +368,14 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not member_id:
raise ValueError(f"Expected a non-empty value for `member_id` but received {member_id!r}")
return self._delete(
- f"/accounts/{account_id}/members/{member_id}",
+ path_template("/accounts/{account_id}/members/{member_id}", account_id=account_id, member_id=member_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -375,7 +390,7 @@ def get(
self,
member_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -399,12 +414,14 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not member_id:
raise ValueError(f"Expected a non-empty value for `member_id` but received {member_id!r}")
return self._get(
- f"/accounts/{account_id}/members/{member_id}",
+ path_template("/accounts/{account_id}/members/{member_id}", account_id=account_id, member_id=member_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -440,7 +457,7 @@ def with_streaming_response(self) -> AsyncMembersResourceWithStreamingResponse:
async def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
email: str,
roles: SequenceNotStr[str],
status: Literal["accepted", "pending"] | Omit = omit,
@@ -461,6 +478,10 @@ async def create(
roles: Array of roles associated with this member.
+ status: Status of the member invitation. If not provided during creation, defaults to
+ 'pending'. Changing from 'accepted' back to 'pending' will trigger a replacement
+ of the member resource in Terraform.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -475,7 +496,7 @@ async def create(
async def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
email: str,
policies: Iterable[member_create_params.IAMCreateMemberWithPoliciesPolicy],
status: Literal["accepted", "pending"] | Omit = omit,
@@ -496,6 +517,10 @@ async def create(
policies: Array of policies associated with this member.
+ status: Status of the member invitation. If not provided during creation, defaults to
+ 'pending'. Changing from 'accepted' back to 'pending' will trigger a replacement
+ of the member resource in Terraform.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -506,11 +531,11 @@ async def create(
"""
...
- @required_args(["account_id", "email", "roles"], ["account_id", "email", "policies"])
+ @required_args(["email", "roles"], ["email", "policies"])
async def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
email: str,
roles: SequenceNotStr[str] | Omit = omit,
status: Literal["accepted", "pending"] | Omit = omit,
@@ -522,10 +547,12 @@ async def create(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> Optional[Member]:
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._post(
- f"/accounts/{account_id}/members",
+ path_template("/accounts/{account_id}/members", account_id=account_id),
body=await async_maybe_transform(
{
"email": email,
@@ -550,7 +577,7 @@ async def update(
self,
member_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
roles: Iterable[Role] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -584,7 +611,7 @@ async def update(
self,
member_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
policies: Iterable[member_update_params.IAMUpdateMemberWithPoliciesPolicy],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -613,12 +640,11 @@ async def update(
"""
...
- @required_args(["account_id"], ["account_id", "policies"])
async def update(
self,
member_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
roles: Iterable[Role] | Omit = omit,
policies: Iterable[member_update_params.IAMUpdateMemberWithPoliciesPolicy] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -628,12 +654,14 @@ async def update(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> Optional[Member]:
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not member_id:
raise ValueError(f"Expected a non-empty value for `member_id` but received {member_id!r}")
return await self._put(
- f"/accounts/{account_id}/members/{member_id}",
+ path_template("/accounts/{account_id}/members/{member_id}", account_id=account_id, member_id=member_id),
body=await async_maybe_transform(
{
"roles": roles,
@@ -654,7 +682,7 @@ async def update(
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
direction: Literal["asc", "desc"] | Omit = omit,
order: Literal["user.first_name", "user.last_name", "user.email", "status"] | Omit = omit,
page: float | Omit = omit,
@@ -691,10 +719,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/members",
+ path_template("/accounts/{account_id}/members", account_id=account_id),
page=AsyncV4PagePaginationArray[Member],
options=make_request_options(
extra_headers=extra_headers,
@@ -719,7 +749,7 @@ async def delete(
self,
member_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -743,12 +773,14 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not member_id:
raise ValueError(f"Expected a non-empty value for `member_id` but received {member_id!r}")
return await self._delete(
- f"/accounts/{account_id}/members/{member_id}",
+ path_template("/accounts/{account_id}/members/{member_id}", account_id=account_id, member_id=member_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -763,7 +795,7 @@ async def get(
self,
member_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -787,12 +819,14 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not member_id:
raise ValueError(f"Expected a non-empty value for `member_id` but received {member_id!r}")
return await self._get(
- f"/accounts/{account_id}/members/{member_id}",
+ path_template("/accounts/{account_id}/members/{member_id}", account_id=account_id, member_id=member_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/accounts/roles.py b/src/cloudflare/resources/accounts/roles.py
index 399ad9f9449..fd478bef16d 100644
--- a/src/cloudflare/resources/accounts/roles.py
+++ b/src/cloudflare/resources/accounts/roles.py
@@ -7,7 +7,7 @@
import httpx
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ..._utils import maybe_transform
+from ..._utils import path_template, maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -48,7 +48,7 @@ def with_streaming_response(self) -> RolesResourceWithStreamingResponse:
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
page: float | Omit = omit,
per_page: float | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -76,10 +76,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/roles",
+ path_template("/accounts/{account_id}/roles", account_id=account_id),
page=SyncV4PagePaginationArray[Role],
options=make_request_options(
extra_headers=extra_headers,
@@ -101,7 +103,7 @@ def get(
self,
role_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -125,12 +127,14 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not role_id:
raise ValueError(f"Expected a non-empty value for `role_id` but received {role_id!r}")
return self._get(
- f"/accounts/{account_id}/roles/{role_id}",
+ path_template("/accounts/{account_id}/roles/{role_id}", account_id=account_id, role_id=role_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -165,7 +169,7 @@ def with_streaming_response(self) -> AsyncRolesResourceWithStreamingResponse:
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
page: float | Omit = omit,
per_page: float | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -193,10 +197,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/roles",
+ path_template("/accounts/{account_id}/roles", account_id=account_id),
page=AsyncV4PagePaginationArray[Role],
options=make_request_options(
extra_headers=extra_headers,
@@ -218,7 +224,7 @@ async def get(
self,
role_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -242,12 +248,14 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not role_id:
raise ValueError(f"Expected a non-empty value for `role_id` but received {role_id!r}")
return await self._get(
- f"/accounts/{account_id}/roles/{role_id}",
+ path_template("/accounts/{account_id}/roles/{role_id}", account_id=account_id, role_id=role_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/accounts/subscriptions.py b/src/cloudflare/resources/accounts/subscriptions.py
index 7209c025dfa..18c404d7ddd 100644
--- a/src/cloudflare/resources/accounts/subscriptions.py
+++ b/src/cloudflare/resources/accounts/subscriptions.py
@@ -8,7 +8,7 @@
import httpx
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ..._utils import maybe_transform, async_maybe_transform
+from ..._utils import path_template, maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -51,7 +51,7 @@ def with_streaming_response(self) -> SubscriptionsResourceWithStreamingResponse:
def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | Omit = omit,
rate_plan: RatePlan | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -79,10 +79,12 @@ def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._post(
- f"/accounts/{account_id}/subscriptions",
+ path_template("/accounts/{account_id}/subscriptions", account_id=account_id),
body=maybe_transform(
{
"frequency": frequency,
@@ -104,7 +106,7 @@ def update(
self,
subscription_identifier: str,
*,
- account_id: str,
+ account_id: str | None = None,
frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | Omit = omit,
rate_plan: RatePlan | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -134,6 +136,8 @@ def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not subscription_identifier:
@@ -141,7 +145,11 @@ def update(
f"Expected a non-empty value for `subscription_identifier` but received {subscription_identifier!r}"
)
return self._put(
- f"/accounts/{account_id}/subscriptions/{subscription_identifier}",
+ path_template(
+ "/accounts/{account_id}/subscriptions/{subscription_identifier}",
+ account_id=account_id,
+ subscription_identifier=subscription_identifier,
+ ),
body=maybe_transform(
{
"frequency": frequency,
@@ -163,7 +171,7 @@ def delete(
self,
subscription_identifier: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -187,6 +195,8 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not subscription_identifier:
@@ -194,7 +204,11 @@ def delete(
f"Expected a non-empty value for `subscription_identifier` but received {subscription_identifier!r}"
)
return self._delete(
- f"/accounts/{account_id}/subscriptions/{subscription_identifier}",
+ path_template(
+ "/accounts/{account_id}/subscriptions/{subscription_identifier}",
+ account_id=account_id,
+ subscription_identifier=subscription_identifier,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -208,7 +222,7 @@ def delete(
def get(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -230,10 +244,12 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/subscriptions",
+ path_template("/accounts/{account_id}/subscriptions", account_id=account_id),
page=SyncSinglePage[Subscription],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -265,7 +281,7 @@ def with_streaming_response(self) -> AsyncSubscriptionsResourceWithStreamingResp
async def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | Omit = omit,
rate_plan: RatePlan | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -293,10 +309,12 @@ async def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._post(
- f"/accounts/{account_id}/subscriptions",
+ path_template("/accounts/{account_id}/subscriptions", account_id=account_id),
body=await async_maybe_transform(
{
"frequency": frequency,
@@ -318,7 +336,7 @@ async def update(
self,
subscription_identifier: str,
*,
- account_id: str,
+ account_id: str | None = None,
frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | Omit = omit,
rate_plan: RatePlan | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -348,6 +366,8 @@ async def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not subscription_identifier:
@@ -355,7 +375,11 @@ async def update(
f"Expected a non-empty value for `subscription_identifier` but received {subscription_identifier!r}"
)
return await self._put(
- f"/accounts/{account_id}/subscriptions/{subscription_identifier}",
+ path_template(
+ "/accounts/{account_id}/subscriptions/{subscription_identifier}",
+ account_id=account_id,
+ subscription_identifier=subscription_identifier,
+ ),
body=await async_maybe_transform(
{
"frequency": frequency,
@@ -377,7 +401,7 @@ async def delete(
self,
subscription_identifier: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -401,6 +425,8 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not subscription_identifier:
@@ -408,7 +434,11 @@ async def delete(
f"Expected a non-empty value for `subscription_identifier` but received {subscription_identifier!r}"
)
return await self._delete(
- f"/accounts/{account_id}/subscriptions/{subscription_identifier}",
+ path_template(
+ "/accounts/{account_id}/subscriptions/{subscription_identifier}",
+ account_id=account_id,
+ subscription_identifier=subscription_identifier,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -422,7 +452,7 @@ async def delete(
def get(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -444,10 +474,12 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/subscriptions",
+ path_template("/accounts/{account_id}/subscriptions", account_id=account_id),
page=AsyncSinglePage[Subscription],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
diff --git a/src/cloudflare/resources/accounts/tokens/permission_groups.py b/src/cloudflare/resources/accounts/tokens/permission_groups.py
index 2efe092f8ec..459dc683be4 100644
--- a/src/cloudflare/resources/accounts/tokens/permission_groups.py
+++ b/src/cloudflare/resources/accounts/tokens/permission_groups.py
@@ -7,7 +7,7 @@
import httpx
from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ...._utils import maybe_transform, async_maybe_transform
+from ...._utils import path_template, maybe_transform, async_maybe_transform
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -49,7 +49,7 @@ def with_streaming_response(self) -> PermissionGroupsResourceWithStreamingRespon
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
name: str | Omit = omit,
scope: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -77,10 +77,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/tokens/permission_groups",
+ path_template("/accounts/{account_id}/tokens/permission_groups", account_id=account_id),
page=SyncSinglePage[PermissionGroupListResponse],
options=make_request_options(
extra_headers=extra_headers,
@@ -101,7 +103,7 @@ def list(
def get(
self,
*,
- account_id: str,
+ account_id: str | None = None,
name: str | Omit = omit,
scope: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -129,10 +131,12 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get(
- f"/accounts/{account_id}/tokens/permission_groups",
+ path_template("/accounts/{account_id}/tokens/permission_groups", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -174,7 +178,7 @@ def with_streaming_response(self) -> AsyncPermissionGroupsResourceWithStreamingR
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
name: str | Omit = omit,
scope: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -202,10 +206,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/tokens/permission_groups",
+ path_template("/accounts/{account_id}/tokens/permission_groups", account_id=account_id),
page=AsyncSinglePage[PermissionGroupListResponse],
options=make_request_options(
extra_headers=extra_headers,
@@ -226,7 +232,7 @@ def list(
async def get(
self,
*,
- account_id: str,
+ account_id: str | None = None,
name: str | Omit = omit,
scope: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -254,10 +260,12 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._get(
- f"/accounts/{account_id}/tokens/permission_groups",
+ path_template("/accounts/{account_id}/tokens/permission_groups", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/accounts/tokens/tokens.py b/src/cloudflare/resources/accounts/tokens/tokens.py
index eb6d7826528..5f65511d4c0 100644
--- a/src/cloudflare/resources/accounts/tokens/tokens.py
+++ b/src/cloudflare/resources/accounts/tokens/tokens.py
@@ -17,7 +17,7 @@
AsyncValueResourceWithStreamingResponse,
)
from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ...._utils import maybe_transform, async_maybe_transform
+from ...._utils import path_template, maybe_transform, async_maybe_transform
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -78,7 +78,7 @@ def with_streaming_response(self) -> TokensResourceWithStreamingResponse:
def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
name: str,
policies: Iterable[TokenPolicy],
condition: token_create_params.Condition | Omit = omit,
@@ -114,10 +114,12 @@ def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._post(
- f"/accounts/{account_id}/tokens",
+ path_template("/accounts/{account_id}/tokens", account_id=account_id),
body=maybe_transform(
{
"name": name,
@@ -142,7 +144,7 @@ def update(
self,
token_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
name: str,
policies: Iterable[TokenPolicy],
condition: token_update_params.Condition | Omit = omit,
@@ -183,12 +185,14 @@ def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not token_id:
raise ValueError(f"Expected a non-empty value for `token_id` but received {token_id!r}")
return self._put(
- f"/accounts/{account_id}/tokens/{token_id}",
+ path_template("/accounts/{account_id}/tokens/{token_id}", account_id=account_id, token_id=token_id),
body=maybe_transform(
{
"name": name,
@@ -213,7 +217,7 @@ def update(
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
direction: Literal["asc", "desc"] | Omit = omit,
page: float | Omit = omit,
per_page: float | Omit = omit,
@@ -244,10 +248,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/tokens",
+ path_template("/accounts/{account_id}/tokens", account_id=account_id),
page=SyncV4PagePaginationArray[Token],
options=make_request_options(
extra_headers=extra_headers,
@@ -270,7 +276,7 @@ def delete(
self,
token_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -294,12 +300,14 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not token_id:
raise ValueError(f"Expected a non-empty value for `token_id` but received {token_id!r}")
return self._delete(
- f"/accounts/{account_id}/tokens/{token_id}",
+ path_template("/accounts/{account_id}/tokens/{token_id}", account_id=account_id, token_id=token_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -314,7 +322,7 @@ def get(
self,
token_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -338,12 +346,14 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not token_id:
raise ValueError(f"Expected a non-empty value for `token_id` but received {token_id!r}")
return self._get(
- f"/accounts/{account_id}/tokens/{token_id}",
+ path_template("/accounts/{account_id}/tokens/{token_id}", account_id=account_id, token_id=token_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -357,7 +367,7 @@ def get(
def verify(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -379,10 +389,12 @@ def verify(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get(
- f"/accounts/{account_id}/tokens/verify",
+ path_template("/accounts/{account_id}/tokens/verify", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -425,7 +437,7 @@ def with_streaming_response(self) -> AsyncTokensResourceWithStreamingResponse:
async def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
name: str,
policies: Iterable[TokenPolicy],
condition: token_create_params.Condition | Omit = omit,
@@ -461,10 +473,12 @@ async def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._post(
- f"/accounts/{account_id}/tokens",
+ path_template("/accounts/{account_id}/tokens", account_id=account_id),
body=await async_maybe_transform(
{
"name": name,
@@ -489,7 +503,7 @@ async def update(
self,
token_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
name: str,
policies: Iterable[TokenPolicy],
condition: token_update_params.Condition | Omit = omit,
@@ -530,12 +544,14 @@ async def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not token_id:
raise ValueError(f"Expected a non-empty value for `token_id` but received {token_id!r}")
return await self._put(
- f"/accounts/{account_id}/tokens/{token_id}",
+ path_template("/accounts/{account_id}/tokens/{token_id}", account_id=account_id, token_id=token_id),
body=await async_maybe_transform(
{
"name": name,
@@ -560,7 +576,7 @@ async def update(
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
direction: Literal["asc", "desc"] | Omit = omit,
page: float | Omit = omit,
per_page: float | Omit = omit,
@@ -591,10 +607,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/tokens",
+ path_template("/accounts/{account_id}/tokens", account_id=account_id),
page=AsyncV4PagePaginationArray[Token],
options=make_request_options(
extra_headers=extra_headers,
@@ -617,7 +635,7 @@ async def delete(
self,
token_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -641,12 +659,14 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not token_id:
raise ValueError(f"Expected a non-empty value for `token_id` but received {token_id!r}")
return await self._delete(
- f"/accounts/{account_id}/tokens/{token_id}",
+ path_template("/accounts/{account_id}/tokens/{token_id}", account_id=account_id, token_id=token_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -661,7 +681,7 @@ async def get(
self,
token_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -685,12 +705,14 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not token_id:
raise ValueError(f"Expected a non-empty value for `token_id` but received {token_id!r}")
return await self._get(
- f"/accounts/{account_id}/tokens/{token_id}",
+ path_template("/accounts/{account_id}/tokens/{token_id}", account_id=account_id, token_id=token_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -704,7 +726,7 @@ async def get(
async def verify(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -726,10 +748,12 @@ async def verify(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._get(
- f"/accounts/{account_id}/tokens/verify",
+ path_template("/accounts/{account_id}/tokens/verify", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/accounts/tokens/value.py b/src/cloudflare/resources/accounts/tokens/value.py
index 5e76bc54948..62cc5c437af 100644
--- a/src/cloudflare/resources/accounts/tokens/value.py
+++ b/src/cloudflare/resources/accounts/tokens/value.py
@@ -7,7 +7,7 @@
import httpx
from ...._types import Body, Query, Headers, NotGiven, not_given
-from ...._utils import maybe_transform, async_maybe_transform
+from ...._utils import path_template, maybe_transform, async_maybe_transform
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -48,7 +48,7 @@ def update(
self,
token_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
body: object,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -73,12 +73,14 @@ def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not token_id:
raise ValueError(f"Expected a non-empty value for `token_id` but received {token_id!r}")
return self._put(
- f"/accounts/{account_id}/tokens/{token_id}/value",
+ path_template("/accounts/{account_id}/tokens/{token_id}/value", account_id=account_id, token_id=token_id),
body=maybe_transform(body, value_update_params.ValueUpdateParams),
options=make_request_options(
extra_headers=extra_headers,
@@ -115,7 +117,7 @@ async def update(
self,
token_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
body: object,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -140,12 +142,14 @@ async def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not token_id:
raise ValueError(f"Expected a non-empty value for `token_id` but received {token_id!r}")
return await self._put(
- f"/accounts/{account_id}/tokens/{token_id}/value",
+ path_template("/accounts/{account_id}/tokens/{token_id}/value", account_id=account_id, token_id=token_id),
body=await async_maybe_transform(body, value_update_params.ValueUpdateParams),
options=make_request_options(
extra_headers=extra_headers,
diff --git a/src/cloudflare/resources/acm/__init__.py b/src/cloudflare/resources/acm/__init__.py
index ed969a286c5..c4b907c8226 100644
--- a/src/cloudflare/resources/acm/__init__.py
+++ b/src/cloudflare/resources/acm/__init__.py
@@ -16,6 +16,14 @@
TotalTLSResourceWithStreamingResponse,
AsyncTotalTLSResourceWithStreamingResponse,
)
+from .custom_trust_store import (
+ CustomTrustStoreResource,
+ AsyncCustomTrustStoreResource,
+ CustomTrustStoreResourceWithRawResponse,
+ AsyncCustomTrustStoreResourceWithRawResponse,
+ CustomTrustStoreResourceWithStreamingResponse,
+ AsyncCustomTrustStoreResourceWithStreamingResponse,
+)
__all__ = [
"TotalTLSResource",
@@ -24,6 +32,12 @@
"AsyncTotalTLSResourceWithRawResponse",
"TotalTLSResourceWithStreamingResponse",
"AsyncTotalTLSResourceWithStreamingResponse",
+ "CustomTrustStoreResource",
+ "AsyncCustomTrustStoreResource",
+ "CustomTrustStoreResourceWithRawResponse",
+ "AsyncCustomTrustStoreResourceWithRawResponse",
+ "CustomTrustStoreResourceWithStreamingResponse",
+ "AsyncCustomTrustStoreResourceWithStreamingResponse",
"ACMResource",
"AsyncACMResource",
"ACMResourceWithRawResponse",
diff --git a/src/cloudflare/resources/acm/acm.py b/src/cloudflare/resources/acm/acm.py
index 4d576c8fa13..ec37c76a47b 100644
--- a/src/cloudflare/resources/acm/acm.py
+++ b/src/cloudflare/resources/acm/acm.py
@@ -12,6 +12,14 @@
AsyncTotalTLSResourceWithStreamingResponse,
)
from ..._resource import SyncAPIResource, AsyncAPIResource
+from .custom_trust_store import (
+ CustomTrustStoreResource,
+ AsyncCustomTrustStoreResource,
+ CustomTrustStoreResourceWithRawResponse,
+ AsyncCustomTrustStoreResourceWithRawResponse,
+ CustomTrustStoreResourceWithStreamingResponse,
+ AsyncCustomTrustStoreResourceWithStreamingResponse,
+)
__all__ = ["ACMResource", "AsyncACMResource"]
@@ -21,6 +29,10 @@ class ACMResource(SyncAPIResource):
def total_tls(self) -> TotalTLSResource:
return TotalTLSResource(self._client)
+ @cached_property
+ def custom_trust_store(self) -> CustomTrustStoreResource:
+ return CustomTrustStoreResource(self._client)
+
@cached_property
def with_raw_response(self) -> ACMResourceWithRawResponse:
"""
@@ -46,6 +58,10 @@ class AsyncACMResource(AsyncAPIResource):
def total_tls(self) -> AsyncTotalTLSResource:
return AsyncTotalTLSResource(self._client)
+ @cached_property
+ def custom_trust_store(self) -> AsyncCustomTrustStoreResource:
+ return AsyncCustomTrustStoreResource(self._client)
+
@cached_property
def with_raw_response(self) -> AsyncACMResourceWithRawResponse:
"""
@@ -74,6 +90,10 @@ def __init__(self, acm: ACMResource) -> None:
def total_tls(self) -> TotalTLSResourceWithRawResponse:
return TotalTLSResourceWithRawResponse(self._acm.total_tls)
+ @cached_property
+ def custom_trust_store(self) -> CustomTrustStoreResourceWithRawResponse:
+ return CustomTrustStoreResourceWithRawResponse(self._acm.custom_trust_store)
+
class AsyncACMResourceWithRawResponse:
def __init__(self, acm: AsyncACMResource) -> None:
@@ -83,6 +103,10 @@ def __init__(self, acm: AsyncACMResource) -> None:
def total_tls(self) -> AsyncTotalTLSResourceWithRawResponse:
return AsyncTotalTLSResourceWithRawResponse(self._acm.total_tls)
+ @cached_property
+ def custom_trust_store(self) -> AsyncCustomTrustStoreResourceWithRawResponse:
+ return AsyncCustomTrustStoreResourceWithRawResponse(self._acm.custom_trust_store)
+
class ACMResourceWithStreamingResponse:
def __init__(self, acm: ACMResource) -> None:
@@ -92,6 +116,10 @@ def __init__(self, acm: ACMResource) -> None:
def total_tls(self) -> TotalTLSResourceWithStreamingResponse:
return TotalTLSResourceWithStreamingResponse(self._acm.total_tls)
+ @cached_property
+ def custom_trust_store(self) -> CustomTrustStoreResourceWithStreamingResponse:
+ return CustomTrustStoreResourceWithStreamingResponse(self._acm.custom_trust_store)
+
class AsyncACMResourceWithStreamingResponse:
def __init__(self, acm: AsyncACMResource) -> None:
@@ -100,3 +128,7 @@ def __init__(self, acm: AsyncACMResource) -> None:
@cached_property
def total_tls(self) -> AsyncTotalTLSResourceWithStreamingResponse:
return AsyncTotalTLSResourceWithStreamingResponse(self._acm.total_tls)
+
+ @cached_property
+ def custom_trust_store(self) -> AsyncCustomTrustStoreResourceWithStreamingResponse:
+ return AsyncCustomTrustStoreResourceWithStreamingResponse(self._acm.custom_trust_store)
diff --git a/src/cloudflare/resources/acm/api.md b/src/cloudflare/resources/acm/api.md
new file mode 100644
index 00000000000..7dbc1c5dca9
--- /dev/null
+++ b/src/cloudflare/resources/acm/api.md
@@ -0,0 +1,35 @@
+# ACM
+
+## TotalTLS
+
+Types:
+
+```python
+from cloudflare.types.acm import (
+ CertificateAuthority,
+ TotalTLSUpdateResponse,
+ TotalTLSEditResponse,
+ TotalTLSGetResponse,
+)
+```
+
+Methods:
+
+- client.acm.total_tls.update(\*, zone_id, \*\*params) -> Optional[TotalTLSUpdateResponse]
+- client.acm.total_tls.edit(\*, zone_id, \*\*params) -> Optional[TotalTLSEditResponse]
+- client.acm.total_tls.get(\*, zone_id) -> Optional[TotalTLSGetResponse]
+
+## CustomTrustStore
+
+Types:
+
+```python
+from cloudflare.types.acm import CustomTrustStore, CustomTrustStoreDeleteResponse
+```
+
+Methods:
+
+- client.acm.custom_trust_store.create(\*, zone_id, \*\*params) -> Optional[CustomTrustStore]
+- client.acm.custom_trust_store.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[CustomTrustStore]
+- client.acm.custom_trust_store.delete(custom_origin_trust_store_id, \*, zone_id) -> Optional[CustomTrustStoreDeleteResponse]
+- client.acm.custom_trust_store.get(custom_origin_trust_store_id, \*, zone_id) -> Optional[CustomTrustStore]
diff --git a/src/cloudflare/resources/acm/custom_trust_store.py b/src/cloudflare/resources/acm/custom_trust_store.py
new file mode 100644
index 00000000000..7f12f52a217
--- /dev/null
+++ b/src/cloudflare/resources/acm/custom_trust_store.py
@@ -0,0 +1,572 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Type, Optional, cast
+
+import httpx
+
+from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
+from ..._utils import path_template, maybe_transform, async_maybe_transform
+from ..._compat import cached_property
+from ..._resource import SyncAPIResource, AsyncAPIResource
+from ..._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from ..._wrappers import ResultWrapper
+from ...types.acm import custom_trust_store_list_params, custom_trust_store_create_params
+from ...pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray
+from ..._base_client import AsyncPaginator, make_request_options
+from ...types.acm.custom_trust_store import CustomTrustStore
+from ...types.acm.custom_trust_store_delete_response import CustomTrustStoreDeleteResponse
+
+__all__ = ["CustomTrustStoreResource", "AsyncCustomTrustStoreResource"]
+
+
+class CustomTrustStoreResource(SyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> CustomTrustStoreResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return CustomTrustStoreResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> CustomTrustStoreResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return CustomTrustStoreResourceWithStreamingResponse(self)
+
+ def create(
+ self,
+ *,
+ zone_id: str | None = None,
+ certificate: str,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> Optional[CustomTrustStore]:
+ """
+ Add Custom Origin Trust Store for a Zone.
+
+ Args:
+ zone_id: Identifier.
+
+ certificate: The zone's SSL certificate or certificate and the intermediate(s).
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ return self._post(
+ path_template("/zones/{zone_id}/acm/custom_trust_store", zone_id=zone_id),
+ body=maybe_transform(
+ {"certificate": certificate}, custom_trust_store_create_params.CustomTrustStoreCreateParams
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[Optional[CustomTrustStore]]._unwrapper,
+ ),
+ cast_to=cast(Type[Optional[CustomTrustStore]], ResultWrapper[CustomTrustStore]),
+ )
+
+ def list(
+ self,
+ *,
+ zone_id: str | None = None,
+ limit: int | Omit = omit,
+ offset: int | Omit = omit,
+ page: float | Omit = omit,
+ per_page: float | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> SyncV4PagePaginationArray[CustomTrustStore]:
+ """
+ Get Custom Origin Trust Store for a Zone.
+
+ Args:
+ zone_id: Identifier.
+
+ limit: Limit to the number of records returned.
+
+ offset: Offset the results
+
+ page: Page number of paginated results.
+
+ per_page: Number of records per page.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ return self._get_api_list(
+ path_template("/zones/{zone_id}/acm/custom_trust_store", zone_id=zone_id),
+ page=SyncV4PagePaginationArray[CustomTrustStore],
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "limit": limit,
+ "offset": offset,
+ "page": page,
+ "per_page": per_page,
+ },
+ custom_trust_store_list_params.CustomTrustStoreListParams,
+ ),
+ ),
+ model=CustomTrustStore,
+ )
+
+ def delete(
+ self,
+ custom_origin_trust_store_id: str,
+ *,
+ zone_id: str | None = None,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> Optional[CustomTrustStoreDeleteResponse]:
+ """Removes a CA certificate from the custom origin trust store.
+
+ Origins using
+ certificates signed by this CA will no longer be trusted.
+
+ Args:
+ zone_id: Identifier.
+
+ custom_origin_trust_store_id: Identifier.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not custom_origin_trust_store_id:
+ raise ValueError(
+ f"Expected a non-empty value for `custom_origin_trust_store_id` but received {custom_origin_trust_store_id!r}"
+ )
+ return self._delete(
+ path_template(
+ "/zones/{zone_id}/acm/custom_trust_store/{custom_origin_trust_store_id}",
+ zone_id=zone_id,
+ custom_origin_trust_store_id=custom_origin_trust_store_id,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[Optional[CustomTrustStoreDeleteResponse]]._unwrapper,
+ ),
+ cast_to=cast(Type[Optional[CustomTrustStoreDeleteResponse]], ResultWrapper[CustomTrustStoreDeleteResponse]),
+ )
+
+ def get(
+ self,
+ custom_origin_trust_store_id: str,
+ *,
+ zone_id: str | None = None,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> Optional[CustomTrustStore]:
+ """
+ Retrieves details about a specific certificate in the custom origin trust store,
+ including expiration and subject information.
+
+ Args:
+ zone_id: Identifier.
+
+ custom_origin_trust_store_id: Identifier.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not custom_origin_trust_store_id:
+ raise ValueError(
+ f"Expected a non-empty value for `custom_origin_trust_store_id` but received {custom_origin_trust_store_id!r}"
+ )
+ return self._get(
+ path_template(
+ "/zones/{zone_id}/acm/custom_trust_store/{custom_origin_trust_store_id}",
+ zone_id=zone_id,
+ custom_origin_trust_store_id=custom_origin_trust_store_id,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[Optional[CustomTrustStore]]._unwrapper,
+ ),
+ cast_to=cast(Type[Optional[CustomTrustStore]], ResultWrapper[CustomTrustStore]),
+ )
+
+
+class AsyncCustomTrustStoreResource(AsyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> AsyncCustomTrustStoreResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncCustomTrustStoreResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncCustomTrustStoreResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return AsyncCustomTrustStoreResourceWithStreamingResponse(self)
+
+ async def create(
+ self,
+ *,
+ zone_id: str | None = None,
+ certificate: str,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> Optional[CustomTrustStore]:
+ """
+ Add Custom Origin Trust Store for a Zone.
+
+ Args:
+ zone_id: Identifier.
+
+ certificate: The zone's SSL certificate or certificate and the intermediate(s).
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ return await self._post(
+ path_template("/zones/{zone_id}/acm/custom_trust_store", zone_id=zone_id),
+ body=await async_maybe_transform(
+ {"certificate": certificate}, custom_trust_store_create_params.CustomTrustStoreCreateParams
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[Optional[CustomTrustStore]]._unwrapper,
+ ),
+ cast_to=cast(Type[Optional[CustomTrustStore]], ResultWrapper[CustomTrustStore]),
+ )
+
+ def list(
+ self,
+ *,
+ zone_id: str | None = None,
+ limit: int | Omit = omit,
+ offset: int | Omit = omit,
+ page: float | Omit = omit,
+ per_page: float | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> AsyncPaginator[CustomTrustStore, AsyncV4PagePaginationArray[CustomTrustStore]]:
+ """
+ Get Custom Origin Trust Store for a Zone.
+
+ Args:
+ zone_id: Identifier.
+
+ limit: Limit to the number of records returned.
+
+ offset: Offset the results
+
+ page: Page number of paginated results.
+
+ per_page: Number of records per page.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ return self._get_api_list(
+ path_template("/zones/{zone_id}/acm/custom_trust_store", zone_id=zone_id),
+ page=AsyncV4PagePaginationArray[CustomTrustStore],
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "limit": limit,
+ "offset": offset,
+ "page": page,
+ "per_page": per_page,
+ },
+ custom_trust_store_list_params.CustomTrustStoreListParams,
+ ),
+ ),
+ model=CustomTrustStore,
+ )
+
+ async def delete(
+ self,
+ custom_origin_trust_store_id: str,
+ *,
+ zone_id: str | None = None,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> Optional[CustomTrustStoreDeleteResponse]:
+ """Removes a CA certificate from the custom origin trust store.
+
+ Origins using
+ certificates signed by this CA will no longer be trusted.
+
+ Args:
+ zone_id: Identifier.
+
+ custom_origin_trust_store_id: Identifier.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not custom_origin_trust_store_id:
+ raise ValueError(
+ f"Expected a non-empty value for `custom_origin_trust_store_id` but received {custom_origin_trust_store_id!r}"
+ )
+ return await self._delete(
+ path_template(
+ "/zones/{zone_id}/acm/custom_trust_store/{custom_origin_trust_store_id}",
+ zone_id=zone_id,
+ custom_origin_trust_store_id=custom_origin_trust_store_id,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[Optional[CustomTrustStoreDeleteResponse]]._unwrapper,
+ ),
+ cast_to=cast(Type[Optional[CustomTrustStoreDeleteResponse]], ResultWrapper[CustomTrustStoreDeleteResponse]),
+ )
+
+ async def get(
+ self,
+ custom_origin_trust_store_id: str,
+ *,
+ zone_id: str | None = None,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> Optional[CustomTrustStore]:
+ """
+ Retrieves details about a specific certificate in the custom origin trust store,
+ including expiration and subject information.
+
+ Args:
+ zone_id: Identifier.
+
+ custom_origin_trust_store_id: Identifier.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not custom_origin_trust_store_id:
+ raise ValueError(
+ f"Expected a non-empty value for `custom_origin_trust_store_id` but received {custom_origin_trust_store_id!r}"
+ )
+ return await self._get(
+ path_template(
+ "/zones/{zone_id}/acm/custom_trust_store/{custom_origin_trust_store_id}",
+ zone_id=zone_id,
+ custom_origin_trust_store_id=custom_origin_trust_store_id,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[Optional[CustomTrustStore]]._unwrapper,
+ ),
+ cast_to=cast(Type[Optional[CustomTrustStore]], ResultWrapper[CustomTrustStore]),
+ )
+
+
+class CustomTrustStoreResourceWithRawResponse:
+ def __init__(self, custom_trust_store: CustomTrustStoreResource) -> None:
+ self._custom_trust_store = custom_trust_store
+
+ self.create = to_raw_response_wrapper(
+ custom_trust_store.create,
+ )
+ self.list = to_raw_response_wrapper(
+ custom_trust_store.list,
+ )
+ self.delete = to_raw_response_wrapper(
+ custom_trust_store.delete,
+ )
+ self.get = to_raw_response_wrapper(
+ custom_trust_store.get,
+ )
+
+
+class AsyncCustomTrustStoreResourceWithRawResponse:
+ def __init__(self, custom_trust_store: AsyncCustomTrustStoreResource) -> None:
+ self._custom_trust_store = custom_trust_store
+
+ self.create = async_to_raw_response_wrapper(
+ custom_trust_store.create,
+ )
+ self.list = async_to_raw_response_wrapper(
+ custom_trust_store.list,
+ )
+ self.delete = async_to_raw_response_wrapper(
+ custom_trust_store.delete,
+ )
+ self.get = async_to_raw_response_wrapper(
+ custom_trust_store.get,
+ )
+
+
+class CustomTrustStoreResourceWithStreamingResponse:
+ def __init__(self, custom_trust_store: CustomTrustStoreResource) -> None:
+ self._custom_trust_store = custom_trust_store
+
+ self.create = to_streamed_response_wrapper(
+ custom_trust_store.create,
+ )
+ self.list = to_streamed_response_wrapper(
+ custom_trust_store.list,
+ )
+ self.delete = to_streamed_response_wrapper(
+ custom_trust_store.delete,
+ )
+ self.get = to_streamed_response_wrapper(
+ custom_trust_store.get,
+ )
+
+
+class AsyncCustomTrustStoreResourceWithStreamingResponse:
+ def __init__(self, custom_trust_store: AsyncCustomTrustStoreResource) -> None:
+ self._custom_trust_store = custom_trust_store
+
+ self.create = async_to_streamed_response_wrapper(
+ custom_trust_store.create,
+ )
+ self.list = async_to_streamed_response_wrapper(
+ custom_trust_store.list,
+ )
+ self.delete = async_to_streamed_response_wrapper(
+ custom_trust_store.delete,
+ )
+ self.get = async_to_streamed_response_wrapper(
+ custom_trust_store.get,
+ )
diff --git a/src/cloudflare/resources/acm/total_tls.py b/src/cloudflare/resources/acm/total_tls.py
index ed1c54d9f7e..9fbe1565d77 100644
--- a/src/cloudflare/resources/acm/total_tls.py
+++ b/src/cloudflare/resources/acm/total_tls.py
@@ -7,7 +7,7 @@
import httpx
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ..._utils import maybe_transform, async_maybe_transform
+from ..._utils import path_template, maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -50,7 +50,7 @@ def with_streaming_response(self) -> TotalTLSResourceWithStreamingResponse:
def update(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
enabled: bool,
certificate_authority: CertificateAuthority | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -79,10 +79,12 @@ def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return self._post(
- f"/zones/{zone_id}/acm/total_tls",
+ path_template("/zones/{zone_id}/acm/total_tls", zone_id=zone_id),
body=maybe_transform(
{
"enabled": enabled,
@@ -103,7 +105,7 @@ def update(
def edit(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
enabled: bool,
certificate_authority: CertificateAuthority | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -132,10 +134,12 @@ def edit(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return self._post(
- f"/zones/{zone_id}/acm/total_tls",
+ path_template("/zones/{zone_id}/acm/total_tls", zone_id=zone_id),
body=maybe_transform(
{
"enabled": enabled,
@@ -156,7 +160,7 @@ def edit(
def get(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -178,10 +182,12 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return self._get(
- f"/zones/{zone_id}/acm/total_tls",
+ path_template("/zones/{zone_id}/acm/total_tls", zone_id=zone_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -216,7 +222,7 @@ def with_streaming_response(self) -> AsyncTotalTLSResourceWithStreamingResponse:
async def update(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
enabled: bool,
certificate_authority: CertificateAuthority | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -245,10 +251,12 @@ async def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return await self._post(
- f"/zones/{zone_id}/acm/total_tls",
+ path_template("/zones/{zone_id}/acm/total_tls", zone_id=zone_id),
body=await async_maybe_transform(
{
"enabled": enabled,
@@ -269,7 +277,7 @@ async def update(
async def edit(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
enabled: bool,
certificate_authority: CertificateAuthority | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -298,10 +306,12 @@ async def edit(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return await self._post(
- f"/zones/{zone_id}/acm/total_tls",
+ path_template("/zones/{zone_id}/acm/total_tls", zone_id=zone_id),
body=await async_maybe_transform(
{
"enabled": enabled,
@@ -322,7 +332,7 @@ async def edit(
async def get(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -344,10 +354,12 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return await self._get(
- f"/zones/{zone_id}/acm/total_tls",
+ path_template("/zones/{zone_id}/acm/total_tls", zone_id=zone_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/addressing/address_maps/accounts.py b/src/cloudflare/resources/addressing/address_maps/accounts.py
index 9d839d4a42d..001086dc20d 100644
--- a/src/cloudflare/resources/addressing/address_maps/accounts.py
+++ b/src/cloudflare/resources/addressing/address_maps/accounts.py
@@ -5,7 +5,7 @@
import httpx
from ...._types import Body, Query, Headers, NotGiven, not_given
-from ...._utils import maybe_transform, async_maybe_transform
+from ...._utils import path_template, maybe_transform, async_maybe_transform
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -46,7 +46,7 @@ def update(
self,
address_map_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
body: object,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -71,12 +71,18 @@ def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not address_map_id:
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
return self._put(
- f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/accounts/{account_id}",
+ path_template(
+ "/accounts/{account_id}/addressing/address_maps/{address_map_id}/accounts/{account_id}",
+ account_id=account_id,
+ address_map_id=address_map_id,
+ ),
body=maybe_transform(body, account_update_params.AccountUpdateParams),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -88,7 +94,7 @@ def delete(
self,
address_map_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -112,12 +118,18 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not address_map_id:
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
return self._delete(
- f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/accounts/{account_id}",
+ path_template(
+ "/accounts/{account_id}/addressing/address_maps/{address_map_id}/accounts/{account_id}",
+ account_id=account_id,
+ address_map_id=address_map_id,
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -149,7 +161,7 @@ async def update(
self,
address_map_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
body: object,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -174,12 +186,18 @@ async def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not address_map_id:
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
return await self._put(
- f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/accounts/{account_id}",
+ path_template(
+ "/accounts/{account_id}/addressing/address_maps/{address_map_id}/accounts/{account_id}",
+ account_id=account_id,
+ address_map_id=address_map_id,
+ ),
body=await async_maybe_transform(body, account_update_params.AccountUpdateParams),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -191,7 +209,7 @@ async def delete(
self,
address_map_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -215,12 +233,18 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not address_map_id:
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
return await self._delete(
- f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/accounts/{account_id}",
+ path_template(
+ "/accounts/{account_id}/addressing/address_maps/{address_map_id}/accounts/{account_id}",
+ account_id=account_id,
+ address_map_id=address_map_id,
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
diff --git a/src/cloudflare/resources/addressing/address_maps/address_maps.py b/src/cloudflare/resources/addressing/address_maps/address_maps.py
index af03cd6994b..49378248039 100644
--- a/src/cloudflare/resources/addressing/address_maps/address_maps.py
+++ b/src/cloudflare/resources/addressing/address_maps/address_maps.py
@@ -31,7 +31,7 @@
AsyncAccountsResourceWithStreamingResponse,
)
from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
-from ...._utils import maybe_transform, async_maybe_transform
+from ...._utils import path_template, maybe_transform, async_maybe_transform
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -87,7 +87,7 @@ def with_streaming_response(self) -> AddressMapsResourceWithStreamingResponse:
def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
description: Optional[str] | Omit = omit,
enabled: Optional[bool] | Omit = omit,
ips: SequenceNotStr[str] | Omit = omit,
@@ -122,10 +122,12 @@ def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._post(
- f"/accounts/{account_id}/addressing/address_maps",
+ path_template("/accounts/{account_id}/addressing/address_maps", account_id=account_id),
body=maybe_transform(
{
"description": description,
@@ -148,7 +150,7 @@ def create(
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -170,10 +172,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/addressing/address_maps",
+ path_template("/accounts/{account_id}/addressing/address_maps", account_id=account_id),
page=SyncSinglePage[AddressMap],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -185,7 +189,7 @@ def delete(
self,
address_map_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -211,12 +215,18 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not address_map_id:
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
return self._delete(
- f"/accounts/{account_id}/addressing/address_maps/{address_map_id}",
+ path_template(
+ "/accounts/{account_id}/addressing/address_maps/{address_map_id}",
+ account_id=account_id,
+ address_map_id=address_map_id,
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -227,7 +237,7 @@ def edit(
self,
address_map_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
default_sni: Optional[str] | Omit = omit,
description: Optional[str] | Omit = omit,
enabled: Optional[bool] | Omit = omit,
@@ -266,12 +276,18 @@ def edit(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not address_map_id:
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
return self._patch(
- f"/accounts/{account_id}/addressing/address_maps/{address_map_id}",
+ path_template(
+ "/accounts/{account_id}/addressing/address_maps/{address_map_id}",
+ account_id=account_id,
+ address_map_id=address_map_id,
+ ),
body=maybe_transform(
{
"default_sni": default_sni,
@@ -294,7 +310,7 @@ def get(
self,
address_map_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -318,12 +334,18 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not address_map_id:
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
return self._get(
- f"/accounts/{account_id}/addressing/address_maps/{address_map_id}",
+ path_template(
+ "/accounts/{account_id}/addressing/address_maps/{address_map_id}",
+ account_id=account_id,
+ address_map_id=address_map_id,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -370,7 +392,7 @@ def with_streaming_response(self) -> AsyncAddressMapsResourceWithStreamingRespon
async def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
description: Optional[str] | Omit = omit,
enabled: Optional[bool] | Omit = omit,
ips: SequenceNotStr[str] | Omit = omit,
@@ -405,10 +427,12 @@ async def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._post(
- f"/accounts/{account_id}/addressing/address_maps",
+ path_template("/accounts/{account_id}/addressing/address_maps", account_id=account_id),
body=await async_maybe_transform(
{
"description": description,
@@ -431,7 +455,7 @@ async def create(
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -453,10 +477,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/addressing/address_maps",
+ path_template("/accounts/{account_id}/addressing/address_maps", account_id=account_id),
page=AsyncSinglePage[AddressMap],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -468,7 +494,7 @@ async def delete(
self,
address_map_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -494,12 +520,18 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not address_map_id:
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
return await self._delete(
- f"/accounts/{account_id}/addressing/address_maps/{address_map_id}",
+ path_template(
+ "/accounts/{account_id}/addressing/address_maps/{address_map_id}",
+ account_id=account_id,
+ address_map_id=address_map_id,
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -510,7 +542,7 @@ async def edit(
self,
address_map_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
default_sni: Optional[str] | Omit = omit,
description: Optional[str] | Omit = omit,
enabled: Optional[bool] | Omit = omit,
@@ -549,12 +581,18 @@ async def edit(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not address_map_id:
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
return await self._patch(
- f"/accounts/{account_id}/addressing/address_maps/{address_map_id}",
+ path_template(
+ "/accounts/{account_id}/addressing/address_maps/{address_map_id}",
+ account_id=account_id,
+ address_map_id=address_map_id,
+ ),
body=await async_maybe_transform(
{
"default_sni": default_sni,
@@ -577,7 +615,7 @@ async def get(
self,
address_map_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -601,12 +639,18 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not address_map_id:
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
return await self._get(
- f"/accounts/{account_id}/addressing/address_maps/{address_map_id}",
+ path_template(
+ "/accounts/{account_id}/addressing/address_maps/{address_map_id}",
+ account_id=account_id,
+ address_map_id=address_map_id,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/addressing/address_maps/ips.py b/src/cloudflare/resources/addressing/address_maps/ips.py
index 78313356374..dfa69fd5403 100644
--- a/src/cloudflare/resources/addressing/address_maps/ips.py
+++ b/src/cloudflare/resources/addressing/address_maps/ips.py
@@ -5,7 +5,7 @@
import httpx
from ...._types import Body, Query, Headers, NotGiven, not_given
-from ...._utils import maybe_transform, async_maybe_transform
+from ...._utils import path_template, maybe_transform, async_maybe_transform
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -46,7 +46,7 @@ def update(
self,
ip_address: str,
*,
- account_id: str,
+ account_id: str | None = None,
address_map_id: str,
body: object,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -74,6 +74,8 @@ def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not address_map_id:
@@ -81,7 +83,12 @@ def update(
if not ip_address:
raise ValueError(f"Expected a non-empty value for `ip_address` but received {ip_address!r}")
return self._put(
- f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/ips/{ip_address}",
+ path_template(
+ "/accounts/{account_id}/addressing/address_maps/{address_map_id}/ips/{ip_address}",
+ account_id=account_id,
+ address_map_id=address_map_id,
+ ip_address=ip_address,
+ ),
body=maybe_transform(body, ip_update_params.IPUpdateParams),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -93,7 +100,7 @@ def delete(
self,
ip_address: str,
*,
- account_id: str,
+ account_id: str | None = None,
address_map_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -120,6 +127,8 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not address_map_id:
@@ -127,7 +136,12 @@ def delete(
if not ip_address:
raise ValueError(f"Expected a non-empty value for `ip_address` but received {ip_address!r}")
return self._delete(
- f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/ips/{ip_address}",
+ path_template(
+ "/accounts/{account_id}/addressing/address_maps/{address_map_id}/ips/{ip_address}",
+ account_id=account_id,
+ address_map_id=address_map_id,
+ ip_address=ip_address,
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -159,7 +173,7 @@ async def update(
self,
ip_address: str,
*,
- account_id: str,
+ account_id: str | None = None,
address_map_id: str,
body: object,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -187,6 +201,8 @@ async def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not address_map_id:
@@ -194,7 +210,12 @@ async def update(
if not ip_address:
raise ValueError(f"Expected a non-empty value for `ip_address` but received {ip_address!r}")
return await self._put(
- f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/ips/{ip_address}",
+ path_template(
+ "/accounts/{account_id}/addressing/address_maps/{address_map_id}/ips/{ip_address}",
+ account_id=account_id,
+ address_map_id=address_map_id,
+ ip_address=ip_address,
+ ),
body=await async_maybe_transform(body, ip_update_params.IPUpdateParams),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -206,7 +227,7 @@ async def delete(
self,
ip_address: str,
*,
- account_id: str,
+ account_id: str | None = None,
address_map_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -233,6 +254,8 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not address_map_id:
@@ -240,7 +263,12 @@ async def delete(
if not ip_address:
raise ValueError(f"Expected a non-empty value for `ip_address` but received {ip_address!r}")
return await self._delete(
- f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/ips/{ip_address}",
+ path_template(
+ "/accounts/{account_id}/addressing/address_maps/{address_map_id}/ips/{ip_address}",
+ account_id=account_id,
+ address_map_id=address_map_id,
+ ip_address=ip_address,
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
diff --git a/src/cloudflare/resources/addressing/address_maps/zones.py b/src/cloudflare/resources/addressing/address_maps/zones.py
index e6ac1d4e043..a1d6df21295 100644
--- a/src/cloudflare/resources/addressing/address_maps/zones.py
+++ b/src/cloudflare/resources/addressing/address_maps/zones.py
@@ -5,7 +5,7 @@
import httpx
from ...._types import Body, Query, Headers, NotGiven, not_given
-from ...._utils import maybe_transform, async_maybe_transform
+from ...._utils import path_template, maybe_transform, async_maybe_transform
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -46,8 +46,8 @@ def update(
self,
address_map_id: str,
*,
- zone_id: str,
- account_id: str,
+ zone_id: str | None = None,
+ account_id: str | None = None,
body: object,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -74,14 +74,23 @@ def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not address_map_id:
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
return self._put(
- f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/zones/{zone_id}",
+ path_template(
+ "/accounts/{account_id}/addressing/address_maps/{address_map_id}/zones/{zone_id}",
+ zone_id=zone_id,
+ account_id=account_id,
+ address_map_id=address_map_id,
+ ),
body=maybe_transform(body, zone_update_params.ZoneUpdateParams),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -93,8 +102,8 @@ def delete(
self,
address_map_id: str,
*,
- zone_id: str,
- account_id: str,
+ zone_id: str | None = None,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -120,14 +129,23 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not address_map_id:
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
return self._delete(
- f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/zones/{zone_id}",
+ path_template(
+ "/accounts/{account_id}/addressing/address_maps/{address_map_id}/zones/{zone_id}",
+ zone_id=zone_id,
+ account_id=account_id,
+ address_map_id=address_map_id,
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -159,8 +177,8 @@ async def update(
self,
address_map_id: str,
*,
- zone_id: str,
- account_id: str,
+ zone_id: str | None = None,
+ account_id: str | None = None,
body: object,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -187,14 +205,23 @@ async def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not address_map_id:
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
return await self._put(
- f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/zones/{zone_id}",
+ path_template(
+ "/accounts/{account_id}/addressing/address_maps/{address_map_id}/zones/{zone_id}",
+ zone_id=zone_id,
+ account_id=account_id,
+ address_map_id=address_map_id,
+ ),
body=await async_maybe_transform(body, zone_update_params.ZoneUpdateParams),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -206,8 +233,8 @@ async def delete(
self,
address_map_id: str,
*,
- zone_id: str,
- account_id: str,
+ zone_id: str | None = None,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -233,14 +260,23 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not address_map_id:
raise ValueError(f"Expected a non-empty value for `address_map_id` but received {address_map_id!r}")
return await self._delete(
- f"/accounts/{account_id}/addressing/address_maps/{address_map_id}/zones/{zone_id}",
+ path_template(
+ "/accounts/{account_id}/addressing/address_maps/{address_map_id}/zones/{zone_id}",
+ zone_id=zone_id,
+ account_id=account_id,
+ address_map_id=address_map_id,
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
diff --git a/src/cloudflare/resources/addressing/api.md b/src/cloudflare/resources/addressing/api.md
new file mode 100644
index 00000000000..0e7c10008bd
--- /dev/null
+++ b/src/cloudflare/resources/addressing/api.md
@@ -0,0 +1,197 @@
+# Addressing
+
+## RegionalHostnames
+
+Types:
+
+```python
+from cloudflare.types.addressing import (
+ RegionalHostnameCreateResponse,
+ RegionalHostnameListResponse,
+ RegionalHostnameDeleteResponse,
+ RegionalHostnameEditResponse,
+ RegionalHostnameGetResponse,
+)
+```
+
+Methods:
+
+- client.addressing.regional_hostnames.create(\*, zone_id, \*\*params) -> Optional[RegionalHostnameCreateResponse]
+- client.addressing.regional_hostnames.list(\*, zone_id) -> SyncSinglePage[RegionalHostnameListResponse]
+- client.addressing.regional_hostnames.delete(hostname, \*, zone_id) -> RegionalHostnameDeleteResponse
+- client.addressing.regional_hostnames.edit(hostname, \*, zone_id, \*\*params) -> Optional[RegionalHostnameEditResponse]
+- client.addressing.regional_hostnames.get(hostname, \*, zone_id) -> Optional[RegionalHostnameGetResponse]
+
+### Regions
+
+Types:
+
+```python
+from cloudflare.types.addressing.regional_hostnames import RegionListResponse
+```
+
+Methods:
+
+- client.addressing.regional_hostnames.regions.list(\*, account_id) -> SyncSinglePage[RegionListResponse]
+
+## Services
+
+Types:
+
+```python
+from cloudflare.types.addressing import ServiceListResponse
+```
+
+Methods:
+
+- client.addressing.services.list(\*, account_id) -> SyncSinglePage[ServiceListResponse]
+
+## AddressMaps
+
+Types:
+
+```python
+from cloudflare.types.addressing import (
+ AddressMap,
+ Kind,
+ AddressMapCreateResponse,
+ AddressMapDeleteResponse,
+ AddressMapGetResponse,
+)
+```
+
+Methods:
+
+- client.addressing.address_maps.create(\*, account_id, \*\*params) -> Optional[AddressMapCreateResponse]
+- client.addressing.address_maps.list(\*, account_id) -> SyncSinglePage[AddressMap]
+- client.addressing.address_maps.delete(address_map_id, \*, account_id) -> AddressMapDeleteResponse
+- client.addressing.address_maps.edit(address_map_id, \*, account_id, \*\*params) -> Optional[AddressMap]
+- client.addressing.address_maps.get(address_map_id, \*, account_id) -> Optional[AddressMapGetResponse]
+
+### Accounts
+
+Types:
+
+```python
+from cloudflare.types.addressing.address_maps import AccountUpdateResponse, AccountDeleteResponse
+```
+
+Methods:
+
+- client.addressing.address_maps.accounts.update(address_map_id, \*, account_id, \*\*params) -> AccountUpdateResponse
+- client.addressing.address_maps.accounts.delete(address_map_id, \*, account_id) -> AccountDeleteResponse
+
+### IPs
+
+Types:
+
+```python
+from cloudflare.types.addressing.address_maps import IPUpdateResponse, IPDeleteResponse
+```
+
+Methods:
+
+- client.addressing.address_maps.ips.update(ip_address, \*, account_id, address_map_id, \*\*params) -> IPUpdateResponse
+- client.addressing.address_maps.ips.delete(ip_address, \*, account_id, address_map_id) -> IPDeleteResponse
+
+### Zones
+
+Types:
+
+```python
+from cloudflare.types.addressing.address_maps import ZoneUpdateResponse, ZoneDeleteResponse
+```
+
+Methods:
+
+- client.addressing.address_maps.zones.update(address_map_id, \*, zone_id, account_id, \*\*params) -> ZoneUpdateResponse
+- client.addressing.address_maps.zones.delete(address_map_id, \*, zone_id, account_id) -> ZoneDeleteResponse
+
+## LOADocuments
+
+Types:
+
+```python
+from cloudflare.types.addressing import LOADocumentCreateResponse
+```
+
+Methods:
+
+- client.addressing.loa_documents.create(\*, account_id, \*\*params) -> Optional[LOADocumentCreateResponse]
+- client.addressing.loa_documents.get(loa_document_id, \*, account_id) -> BinaryAPIResponse
+
+## Prefixes
+
+Types:
+
+```python
+from cloudflare.types.addressing import Prefix, PrefixDeleteResponse
+```
+
+Methods:
+
+- client.addressing.prefixes.create(\*, account_id, \*\*params) -> Optional[Prefix]
+- client.addressing.prefixes.list(\*, account_id) -> SyncSinglePage[Prefix]
+- client.addressing.prefixes.delete(prefix_id, \*, account_id) -> PrefixDeleteResponse
+- client.addressing.prefixes.edit(prefix_id, \*, account_id, \*\*params) -> Optional[Prefix]
+- client.addressing.prefixes.get(prefix_id, \*, account_id) -> Optional[Prefix]
+
+### ServiceBindings
+
+Types:
+
+```python
+from cloudflare.types.addressing.prefixes import ServiceBinding, ServiceBindingDeleteResponse
+```
+
+Methods:
+
+- client.addressing.prefixes.service_bindings.create(prefix_id, \*, account_id, \*\*params) -> Optional[ServiceBinding]
+- client.addressing.prefixes.service_bindings.list(prefix_id, \*, account_id) -> SyncSinglePage[ServiceBinding]
+- client.addressing.prefixes.service_bindings.delete(binding_id, \*, account_id, prefix_id) -> ServiceBindingDeleteResponse
+- client.addressing.prefixes.service_bindings.get(binding_id, \*, account_id, prefix_id) -> Optional[ServiceBinding]
+
+### BGPPrefixes
+
+Types:
+
+```python
+from cloudflare.types.addressing.prefixes import BGPPrefix
+```
+
+Methods:
+
+- client.addressing.prefixes.bgp_prefixes.create(prefix_id, \*, account_id, \*\*params) -> Optional[BGPPrefix]
+- client.addressing.prefixes.bgp_prefixes.list(prefix_id, \*, account_id) -> SyncSinglePage[BGPPrefix]
+- client.addressing.prefixes.bgp_prefixes.edit(bgp_prefix_id, \*, account_id, prefix_id, \*\*params) -> Optional[BGPPrefix]
+- client.addressing.prefixes.bgp_prefixes.get(bgp_prefix_id, \*, account_id, prefix_id) -> Optional[BGPPrefix]
+
+### AdvertisementStatus
+
+Types:
+
+```python
+from cloudflare.types.addressing.prefixes import (
+ AdvertisementStatusEditResponse,
+ AdvertisementStatusGetResponse,
+)
+```
+
+Methods:
+
+- client.addressing.prefixes.advertisement_status.edit(prefix_id, \*, account_id, \*\*params) -> Optional[AdvertisementStatusEditResponse]
+- client.addressing.prefixes.advertisement_status.get(prefix_id, \*, account_id) -> Optional[AdvertisementStatusGetResponse]
+
+### Delegations
+
+Types:
+
+```python
+from cloudflare.types.addressing.prefixes import Delegations, DelegationDeleteResponse
+```
+
+Methods:
+
+- client.addressing.prefixes.delegations.create(prefix_id, \*, account_id, \*\*params) -> Optional[Delegations]
+- client.addressing.prefixes.delegations.list(prefix_id, \*, account_id) -> SyncSinglePage[Delegations]
+- client.addressing.prefixes.delegations.delete(delegation_id, \*, account_id, prefix_id) -> Optional[DelegationDeleteResponse]
diff --git a/src/cloudflare/resources/addressing/loa_documents.py b/src/cloudflare/resources/addressing/loa_documents.py
index a1765c32f97..f2d4bfb9db9 100644
--- a/src/cloudflare/resources/addressing/loa_documents.py
+++ b/src/cloudflare/resources/addressing/loa_documents.py
@@ -7,7 +7,7 @@
import httpx
from ..._types import Body, Query, Headers, NotGiven, not_given
-from ..._utils import maybe_transform, async_maybe_transform
+from ..._utils import path_template, maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -55,7 +55,7 @@ def with_streaming_response(self) -> LOADocumentsResourceWithStreamingResponse:
def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
loa_document: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -80,6 +80,8 @@ def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
# It should be noted that the actual Content-Type header that will be
@@ -87,7 +89,7 @@ def create(
# multipart/form-data; boundary=---abc--
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
return self._post(
- f"/accounts/{account_id}/addressing/loa_documents",
+ path_template("/accounts/{account_id}/addressing/loa_documents", account_id=account_id),
body=maybe_transform({"loa_document": loa_document}, loa_document_create_params.LOADocumentCreateParams),
options=make_request_options(
extra_headers=extra_headers,
@@ -101,9 +103,9 @@ def create(
def get(
self,
- loa_document_id: Optional[str],
+ loa_document_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -127,13 +129,19 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not loa_document_id:
raise ValueError(f"Expected a non-empty value for `loa_document_id` but received {loa_document_id!r}")
extra_headers = {"Accept": "application/pdf", **(extra_headers or {})}
return self._get(
- f"/accounts/{account_id}/addressing/loa_documents/{loa_document_id}/download",
+ path_template(
+ "/accounts/{account_id}/addressing/loa_documents/{loa_document_id}/download",
+ account_id=account_id,
+ loa_document_id=loa_document_id,
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -164,7 +172,7 @@ def with_streaming_response(self) -> AsyncLOADocumentsResourceWithStreamingRespo
async def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
loa_document: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -189,6 +197,8 @@ async def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
# It should be noted that the actual Content-Type header that will be
@@ -196,7 +206,7 @@ async def create(
# multipart/form-data; boundary=---abc--
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
return await self._post(
- f"/accounts/{account_id}/addressing/loa_documents",
+ path_template("/accounts/{account_id}/addressing/loa_documents", account_id=account_id),
body=await async_maybe_transform(
{"loa_document": loa_document}, loa_document_create_params.LOADocumentCreateParams
),
@@ -212,9 +222,9 @@ async def create(
async def get(
self,
- loa_document_id: Optional[str],
+ loa_document_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -238,13 +248,19 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not loa_document_id:
raise ValueError(f"Expected a non-empty value for `loa_document_id` but received {loa_document_id!r}")
extra_headers = {"Accept": "application/pdf", **(extra_headers or {})}
return await self._get(
- f"/accounts/{account_id}/addressing/loa_documents/{loa_document_id}/download",
+ path_template(
+ "/accounts/{account_id}/addressing/loa_documents/{loa_document_id}/download",
+ account_id=account_id,
+ loa_document_id=loa_document_id,
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
diff --git a/src/cloudflare/resources/addressing/prefixes/advertisement_status.py b/src/cloudflare/resources/addressing/prefixes/advertisement_status.py
index 7b71630f5b2..4f5b488c4f7 100644
--- a/src/cloudflare/resources/addressing/prefixes/advertisement_status.py
+++ b/src/cloudflare/resources/addressing/prefixes/advertisement_status.py
@@ -8,7 +8,7 @@
import httpx
from ...._types import Body, Query, Headers, NotGiven, not_given
-from ...._utils import maybe_transform, async_maybe_transform
+from ...._utils import path_template, maybe_transform, async_maybe_transform
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -51,7 +51,7 @@ def edit(
self,
prefix_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
advertised: bool,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -82,12 +82,18 @@ def edit(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not prefix_id:
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
return self._patch(
- f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/status",
+ path_template(
+ "/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/status",
+ account_id=account_id,
+ prefix_id=prefix_id,
+ ),
body=maybe_transform(
{"advertised": advertised}, advertisement_status_edit_params.AdvertisementStatusEditParams
),
@@ -108,7 +114,7 @@ def get(
self,
prefix_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -135,12 +141,18 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not prefix_id:
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
return self._get(
- f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/status",
+ path_template(
+ "/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/status",
+ account_id=account_id,
+ prefix_id=prefix_id,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -177,7 +189,7 @@ async def edit(
self,
prefix_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
advertised: bool,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -208,12 +220,18 @@ async def edit(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not prefix_id:
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
return await self._patch(
- f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/status",
+ path_template(
+ "/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/status",
+ account_id=account_id,
+ prefix_id=prefix_id,
+ ),
body=await async_maybe_transform(
{"advertised": advertised}, advertisement_status_edit_params.AdvertisementStatusEditParams
),
@@ -234,7 +252,7 @@ async def get(
self,
prefix_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -261,12 +279,18 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not prefix_id:
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
return await self._get(
- f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/status",
+ path_template(
+ "/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/status",
+ account_id=account_id,
+ prefix_id=prefix_id,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/addressing/prefixes/bgp_prefixes.py b/src/cloudflare/resources/addressing/prefixes/bgp_prefixes.py
index 2f997e3a34f..388ac2ec2de 100644
--- a/src/cloudflare/resources/addressing/prefixes/bgp_prefixes.py
+++ b/src/cloudflare/resources/addressing/prefixes/bgp_prefixes.py
@@ -7,7 +7,7 @@
import httpx
from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ...._utils import maybe_transform, async_maybe_transform
+from ...._utils import path_template, maybe_transform, async_maybe_transform
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -49,7 +49,7 @@ def create(
self,
prefix_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
cidr: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -78,12 +78,18 @@ def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not prefix_id:
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
return self._post(
- f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes",
+ path_template(
+ "/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes",
+ account_id=account_id,
+ prefix_id=prefix_id,
+ ),
body=maybe_transform({"cidr": cidr}, bgp_prefix_create_params.BGPPrefixCreateParams),
options=make_request_options(
extra_headers=extra_headers,
@@ -99,7 +105,7 @@ def list(
self,
prefix_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -127,12 +133,18 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not prefix_id:
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes",
+ path_template(
+ "/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes",
+ account_id=account_id,
+ prefix_id=prefix_id,
+ ),
page=SyncSinglePage[BGPPrefix],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -144,7 +156,7 @@ def edit(
self,
bgp_prefix_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
prefix_id: str,
asn_prepend_count: int | Omit = omit,
auto_advertise_withdraw: bool | Omit = omit,
@@ -182,6 +194,8 @@ def edit(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not prefix_id:
@@ -189,7 +203,12 @@ def edit(
if not bgp_prefix_id:
raise ValueError(f"Expected a non-empty value for `bgp_prefix_id` but received {bgp_prefix_id!r}")
return self._patch(
- f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes/{bgp_prefix_id}",
+ path_template(
+ "/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes/{bgp_prefix_id}",
+ account_id=account_id,
+ prefix_id=prefix_id,
+ bgp_prefix_id=bgp_prefix_id,
+ ),
body=maybe_transform(
{
"asn_prepend_count": asn_prepend_count,
@@ -212,7 +231,7 @@ def get(
self,
bgp_prefix_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
prefix_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -239,6 +258,8 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not prefix_id:
@@ -246,7 +267,12 @@ def get(
if not bgp_prefix_id:
raise ValueError(f"Expected a non-empty value for `bgp_prefix_id` but received {bgp_prefix_id!r}")
return self._get(
- f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes/{bgp_prefix_id}",
+ path_template(
+ "/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes/{bgp_prefix_id}",
+ account_id=account_id,
+ prefix_id=prefix_id,
+ bgp_prefix_id=bgp_prefix_id,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -282,7 +308,7 @@ async def create(
self,
prefix_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
cidr: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -311,12 +337,18 @@ async def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not prefix_id:
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
return await self._post(
- f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes",
+ path_template(
+ "/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes",
+ account_id=account_id,
+ prefix_id=prefix_id,
+ ),
body=await async_maybe_transform({"cidr": cidr}, bgp_prefix_create_params.BGPPrefixCreateParams),
options=make_request_options(
extra_headers=extra_headers,
@@ -332,7 +364,7 @@ def list(
self,
prefix_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -360,12 +392,18 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not prefix_id:
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes",
+ path_template(
+ "/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes",
+ account_id=account_id,
+ prefix_id=prefix_id,
+ ),
page=AsyncSinglePage[BGPPrefix],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -377,7 +415,7 @@ async def edit(
self,
bgp_prefix_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
prefix_id: str,
asn_prepend_count: int | Omit = omit,
auto_advertise_withdraw: bool | Omit = omit,
@@ -415,6 +453,8 @@ async def edit(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not prefix_id:
@@ -422,7 +462,12 @@ async def edit(
if not bgp_prefix_id:
raise ValueError(f"Expected a non-empty value for `bgp_prefix_id` but received {bgp_prefix_id!r}")
return await self._patch(
- f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes/{bgp_prefix_id}",
+ path_template(
+ "/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes/{bgp_prefix_id}",
+ account_id=account_id,
+ prefix_id=prefix_id,
+ bgp_prefix_id=bgp_prefix_id,
+ ),
body=await async_maybe_transform(
{
"asn_prepend_count": asn_prepend_count,
@@ -445,7 +490,7 @@ async def get(
self,
bgp_prefix_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
prefix_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -472,6 +517,8 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not prefix_id:
@@ -479,7 +526,12 @@ async def get(
if not bgp_prefix_id:
raise ValueError(f"Expected a non-empty value for `bgp_prefix_id` but received {bgp_prefix_id!r}")
return await self._get(
- f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes/{bgp_prefix_id}",
+ path_template(
+ "/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes/{bgp_prefix_id}",
+ account_id=account_id,
+ prefix_id=prefix_id,
+ bgp_prefix_id=bgp_prefix_id,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/addressing/prefixes/delegations.py b/src/cloudflare/resources/addressing/prefixes/delegations.py
index cdc8824f1d3..bbaec487686 100644
--- a/src/cloudflare/resources/addressing/prefixes/delegations.py
+++ b/src/cloudflare/resources/addressing/prefixes/delegations.py
@@ -7,7 +7,7 @@
import httpx
from ...._types import Body, Query, Headers, NotGiven, not_given
-from ...._utils import maybe_transform, async_maybe_transform
+from ...._utils import path_template, maybe_transform, async_maybe_transform
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -50,7 +50,7 @@ def create(
self,
prefix_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
cidr: str,
delegated_account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -80,12 +80,18 @@ def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not prefix_id:
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
return self._post(
- f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/delegations",
+ path_template(
+ "/accounts/{account_id}/addressing/prefixes/{prefix_id}/delegations",
+ account_id=account_id,
+ prefix_id=prefix_id,
+ ),
body=maybe_transform(
{
"cidr": cidr,
@@ -107,7 +113,7 @@ def list(
self,
prefix_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -131,12 +137,18 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not prefix_id:
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/delegations",
+ path_template(
+ "/accounts/{account_id}/addressing/prefixes/{prefix_id}/delegations",
+ account_id=account_id,
+ prefix_id=prefix_id,
+ ),
page=SyncSinglePage[Delegations],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -148,7 +160,7 @@ def delete(
self,
delegation_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
prefix_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -175,6 +187,8 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not prefix_id:
@@ -182,7 +196,12 @@ def delete(
if not delegation_id:
raise ValueError(f"Expected a non-empty value for `delegation_id` but received {delegation_id!r}")
return self._delete(
- f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/delegations/{delegation_id}",
+ path_template(
+ "/accounts/{account_id}/addressing/prefixes/{prefix_id}/delegations/{delegation_id}",
+ account_id=account_id,
+ prefix_id=prefix_id,
+ delegation_id=delegation_id,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -218,7 +237,7 @@ async def create(
self,
prefix_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
cidr: str,
delegated_account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -248,12 +267,18 @@ async def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not prefix_id:
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
return await self._post(
- f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/delegations",
+ path_template(
+ "/accounts/{account_id}/addressing/prefixes/{prefix_id}/delegations",
+ account_id=account_id,
+ prefix_id=prefix_id,
+ ),
body=await async_maybe_transform(
{
"cidr": cidr,
@@ -275,7 +300,7 @@ def list(
self,
prefix_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -299,12 +324,18 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not prefix_id:
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/delegations",
+ path_template(
+ "/accounts/{account_id}/addressing/prefixes/{prefix_id}/delegations",
+ account_id=account_id,
+ prefix_id=prefix_id,
+ ),
page=AsyncSinglePage[Delegations],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -316,7 +347,7 @@ async def delete(
self,
delegation_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
prefix_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -343,6 +374,8 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not prefix_id:
@@ -350,7 +383,12 @@ async def delete(
if not delegation_id:
raise ValueError(f"Expected a non-empty value for `delegation_id` but received {delegation_id!r}")
return await self._delete(
- f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/delegations/{delegation_id}",
+ path_template(
+ "/accounts/{account_id}/addressing/prefixes/{prefix_id}/delegations/{delegation_id}",
+ account_id=account_id,
+ prefix_id=prefix_id,
+ delegation_id=delegation_id,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/addressing/prefixes/prefixes.py b/src/cloudflare/resources/addressing/prefixes/prefixes.py
index 6c9785fa6cf..60cf4c0a008 100644
--- a/src/cloudflare/resources/addressing/prefixes/prefixes.py
+++ b/src/cloudflare/resources/addressing/prefixes/prefixes.py
@@ -7,7 +7,7 @@
import httpx
from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ...._utils import maybe_transform, async_maybe_transform
+from ...._utils import path_template, maybe_transform, async_maybe_transform
from ...._compat import cached_property
from .delegations import (
DelegationsResource,
@@ -97,7 +97,7 @@ def with_streaming_response(self) -> PrefixesResourceWithStreamingResponse:
def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
asn: int,
cidr: str,
delegate_loa_creation: bool | Omit = omit,
@@ -135,10 +135,12 @@ def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._post(
- f"/accounts/{account_id}/addressing/prefixes",
+ path_template("/accounts/{account_id}/addressing/prefixes", account_id=account_id),
body=maybe_transform(
{
"asn": asn,
@@ -162,7 +164,7 @@ def create(
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -184,10 +186,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/addressing/prefixes",
+ path_template("/accounts/{account_id}/addressing/prefixes", account_id=account_id),
page=SyncSinglePage[Prefix],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -199,7 +203,7 @@ def delete(
self,
prefix_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -223,12 +227,16 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not prefix_id:
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
return self._delete(
- f"/accounts/{account_id}/addressing/prefixes/{prefix_id}",
+ path_template(
+ "/accounts/{account_id}/addressing/prefixes/{prefix_id}", account_id=account_id, prefix_id=prefix_id
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -239,7 +247,7 @@ def edit(
self,
prefix_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
description: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -266,12 +274,16 @@ def edit(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not prefix_id:
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
return self._patch(
- f"/accounts/{account_id}/addressing/prefixes/{prefix_id}",
+ path_template(
+ "/accounts/{account_id}/addressing/prefixes/{prefix_id}", account_id=account_id, prefix_id=prefix_id
+ ),
body=maybe_transform({"description": description}, prefix_edit_params.PrefixEditParams),
options=make_request_options(
extra_headers=extra_headers,
@@ -287,7 +299,7 @@ def get(
self,
prefix_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -311,12 +323,16 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not prefix_id:
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
return self._get(
- f"/accounts/{account_id}/addressing/prefixes/{prefix_id}",
+ path_template(
+ "/accounts/{account_id}/addressing/prefixes/{prefix_id}", account_id=account_id, prefix_id=prefix_id
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -367,7 +383,7 @@ def with_streaming_response(self) -> AsyncPrefixesResourceWithStreamingResponse:
async def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
asn: int,
cidr: str,
delegate_loa_creation: bool | Omit = omit,
@@ -405,10 +421,12 @@ async def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._post(
- f"/accounts/{account_id}/addressing/prefixes",
+ path_template("/accounts/{account_id}/addressing/prefixes", account_id=account_id),
body=await async_maybe_transform(
{
"asn": asn,
@@ -432,7 +450,7 @@ async def create(
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -454,10 +472,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/addressing/prefixes",
+ path_template("/accounts/{account_id}/addressing/prefixes", account_id=account_id),
page=AsyncSinglePage[Prefix],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -469,7 +489,7 @@ async def delete(
self,
prefix_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -493,12 +513,16 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not prefix_id:
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
return await self._delete(
- f"/accounts/{account_id}/addressing/prefixes/{prefix_id}",
+ path_template(
+ "/accounts/{account_id}/addressing/prefixes/{prefix_id}", account_id=account_id, prefix_id=prefix_id
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -509,7 +533,7 @@ async def edit(
self,
prefix_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
description: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -536,12 +560,16 @@ async def edit(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not prefix_id:
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
return await self._patch(
- f"/accounts/{account_id}/addressing/prefixes/{prefix_id}",
+ path_template(
+ "/accounts/{account_id}/addressing/prefixes/{prefix_id}", account_id=account_id, prefix_id=prefix_id
+ ),
body=await async_maybe_transform({"description": description}, prefix_edit_params.PrefixEditParams),
options=make_request_options(
extra_headers=extra_headers,
@@ -557,7 +585,7 @@ async def get(
self,
prefix_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -581,12 +609,16 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not prefix_id:
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
return await self._get(
- f"/accounts/{account_id}/addressing/prefixes/{prefix_id}",
+ path_template(
+ "/accounts/{account_id}/addressing/prefixes/{prefix_id}", account_id=account_id, prefix_id=prefix_id
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/addressing/prefixes/service_bindings.py b/src/cloudflare/resources/addressing/prefixes/service_bindings.py
index 163f77b5a40..d8e617cc87e 100644
--- a/src/cloudflare/resources/addressing/prefixes/service_bindings.py
+++ b/src/cloudflare/resources/addressing/prefixes/service_bindings.py
@@ -7,7 +7,7 @@
import httpx
from ...._types import Body, Query, Headers, NotGiven, not_given
-from ...._utils import maybe_transform, async_maybe_transform
+from ...._utils import path_template, maybe_transform, async_maybe_transform
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -50,7 +50,7 @@ def create(
self,
prefix_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
cidr: str,
service_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -86,12 +86,18 @@ def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not prefix_id:
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
return self._post(
- f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings",
+ path_template(
+ "/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings",
+ account_id=account_id,
+ prefix_id=prefix_id,
+ ),
body=maybe_transform(
{
"cidr": cidr,
@@ -113,7 +119,7 @@ def list(
self,
prefix_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -143,12 +149,18 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not prefix_id:
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings",
+ path_template(
+ "/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings",
+ account_id=account_id,
+ prefix_id=prefix_id,
+ ),
page=SyncSinglePage[ServiceBinding],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -160,7 +172,7 @@ def delete(
self,
binding_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
prefix_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -187,6 +199,8 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not prefix_id:
@@ -194,7 +208,12 @@ def delete(
if not binding_id:
raise ValueError(f"Expected a non-empty value for `binding_id` but received {binding_id!r}")
return self._delete(
- f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings/{binding_id}",
+ path_template(
+ "/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings/{binding_id}",
+ account_id=account_id,
+ prefix_id=prefix_id,
+ binding_id=binding_id,
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -205,7 +224,7 @@ def get(
self,
binding_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
prefix_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -232,6 +251,8 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not prefix_id:
@@ -239,7 +260,12 @@ def get(
if not binding_id:
raise ValueError(f"Expected a non-empty value for `binding_id` but received {binding_id!r}")
return self._get(
- f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings/{binding_id}",
+ path_template(
+ "/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings/{binding_id}",
+ account_id=account_id,
+ prefix_id=prefix_id,
+ binding_id=binding_id,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -275,7 +301,7 @@ async def create(
self,
prefix_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
cidr: str,
service_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -311,12 +337,18 @@ async def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not prefix_id:
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
return await self._post(
- f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings",
+ path_template(
+ "/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings",
+ account_id=account_id,
+ prefix_id=prefix_id,
+ ),
body=await async_maybe_transform(
{
"cidr": cidr,
@@ -338,7 +370,7 @@ def list(
self,
prefix_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -368,12 +400,18 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not prefix_id:
raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings",
+ path_template(
+ "/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings",
+ account_id=account_id,
+ prefix_id=prefix_id,
+ ),
page=AsyncSinglePage[ServiceBinding],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -385,7 +423,7 @@ async def delete(
self,
binding_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
prefix_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -412,6 +450,8 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not prefix_id:
@@ -419,7 +459,12 @@ async def delete(
if not binding_id:
raise ValueError(f"Expected a non-empty value for `binding_id` but received {binding_id!r}")
return await self._delete(
- f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings/{binding_id}",
+ path_template(
+ "/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings/{binding_id}",
+ account_id=account_id,
+ prefix_id=prefix_id,
+ binding_id=binding_id,
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -430,7 +475,7 @@ async def get(
self,
binding_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
prefix_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -457,6 +502,8 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not prefix_id:
@@ -464,7 +511,12 @@ async def get(
if not binding_id:
raise ValueError(f"Expected a non-empty value for `binding_id` but received {binding_id!r}")
return await self._get(
- f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings/{binding_id}",
+ path_template(
+ "/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings/{binding_id}",
+ account_id=account_id,
+ prefix_id=prefix_id,
+ binding_id=binding_id,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/addressing/regional_hostnames/regional_hostnames.py b/src/cloudflare/resources/addressing/regional_hostnames/regional_hostnames.py
index e404f48a4d1..5bee3bcf4f7 100644
--- a/src/cloudflare/resources/addressing/regional_hostnames/regional_hostnames.py
+++ b/src/cloudflare/resources/addressing/regional_hostnames/regional_hostnames.py
@@ -15,7 +15,7 @@
AsyncRegionsResourceWithStreamingResponse,
)
from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ...._utils import maybe_transform, async_maybe_transform
+from ...._utils import path_template, maybe_transform, async_maybe_transform
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -64,7 +64,7 @@ def with_streaming_response(self) -> RegionalHostnamesResourceWithStreamingRespo
def create(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
hostname: str,
region_key: str,
routing: str | Omit = omit,
@@ -100,10 +100,12 @@ def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return self._post(
- f"/zones/{zone_id}/addressing/regional_hostnames",
+ path_template("/zones/{zone_id}/addressing/regional_hostnames", zone_id=zone_id),
body=maybe_transform(
{
"hostname": hostname,
@@ -125,7 +127,7 @@ def create(
def list(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -147,10 +149,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return self._get_api_list(
- f"/zones/{zone_id}/addressing/regional_hostnames",
+ path_template("/zones/{zone_id}/addressing/regional_hostnames", zone_id=zone_id),
page=SyncSinglePage[RegionalHostnameListResponse],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -162,7 +166,7 @@ def delete(
self,
hostname: str,
*,
- zone_id: str,
+ zone_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -187,12 +191,16 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not hostname:
raise ValueError(f"Expected a non-empty value for `hostname` but received {hostname!r}")
return self._delete(
- f"/zones/{zone_id}/addressing/regional_hostnames/{hostname}",
+ path_template(
+ "/zones/{zone_id}/addressing/regional_hostnames/{hostname}", zone_id=zone_id, hostname=hostname
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -203,7 +211,7 @@ def edit(
self,
hostname: str,
*,
- zone_id: str,
+ zone_id: str | None = None,
region_key: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -233,12 +241,16 @@ def edit(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not hostname:
raise ValueError(f"Expected a non-empty value for `hostname` but received {hostname!r}")
return self._patch(
- f"/zones/{zone_id}/addressing/regional_hostnames/{hostname}",
+ path_template(
+ "/zones/{zone_id}/addressing/regional_hostnames/{hostname}", zone_id=zone_id, hostname=hostname
+ ),
body=maybe_transform({"region_key": region_key}, regional_hostname_edit_params.RegionalHostnameEditParams),
options=make_request_options(
extra_headers=extra_headers,
@@ -254,7 +266,7 @@ def get(
self,
hostname: str,
*,
- zone_id: str,
+ zone_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -279,12 +291,16 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not hostname:
raise ValueError(f"Expected a non-empty value for `hostname` but received {hostname!r}")
return self._get(
- f"/zones/{zone_id}/addressing/regional_hostnames/{hostname}",
+ path_template(
+ "/zones/{zone_id}/addressing/regional_hostnames/{hostname}", zone_id=zone_id, hostname=hostname
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -323,7 +339,7 @@ def with_streaming_response(self) -> AsyncRegionalHostnamesResourceWithStreaming
async def create(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
hostname: str,
region_key: str,
routing: str | Omit = omit,
@@ -359,10 +375,12 @@ async def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return await self._post(
- f"/zones/{zone_id}/addressing/regional_hostnames",
+ path_template("/zones/{zone_id}/addressing/regional_hostnames", zone_id=zone_id),
body=await async_maybe_transform(
{
"hostname": hostname,
@@ -384,7 +402,7 @@ async def create(
def list(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -406,10 +424,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return self._get_api_list(
- f"/zones/{zone_id}/addressing/regional_hostnames",
+ path_template("/zones/{zone_id}/addressing/regional_hostnames", zone_id=zone_id),
page=AsyncSinglePage[RegionalHostnameListResponse],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -421,7 +441,7 @@ async def delete(
self,
hostname: str,
*,
- zone_id: str,
+ zone_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -446,12 +466,16 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not hostname:
raise ValueError(f"Expected a non-empty value for `hostname` but received {hostname!r}")
return await self._delete(
- f"/zones/{zone_id}/addressing/regional_hostnames/{hostname}",
+ path_template(
+ "/zones/{zone_id}/addressing/regional_hostnames/{hostname}", zone_id=zone_id, hostname=hostname
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -462,7 +486,7 @@ async def edit(
self,
hostname: str,
*,
- zone_id: str,
+ zone_id: str | None = None,
region_key: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -492,12 +516,16 @@ async def edit(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not hostname:
raise ValueError(f"Expected a non-empty value for `hostname` but received {hostname!r}")
return await self._patch(
- f"/zones/{zone_id}/addressing/regional_hostnames/{hostname}",
+ path_template(
+ "/zones/{zone_id}/addressing/regional_hostnames/{hostname}", zone_id=zone_id, hostname=hostname
+ ),
body=await async_maybe_transform(
{"region_key": region_key}, regional_hostname_edit_params.RegionalHostnameEditParams
),
@@ -515,7 +543,7 @@ async def get(
self,
hostname: str,
*,
- zone_id: str,
+ zone_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -540,12 +568,16 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not hostname:
raise ValueError(f"Expected a non-empty value for `hostname` but received {hostname!r}")
return await self._get(
- f"/zones/{zone_id}/addressing/regional_hostnames/{hostname}",
+ path_template(
+ "/zones/{zone_id}/addressing/regional_hostnames/{hostname}", zone_id=zone_id, hostname=hostname
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/addressing/regional_hostnames/regions.py b/src/cloudflare/resources/addressing/regional_hostnames/regions.py
index e94af76ff04..a9d0344c3ed 100644
--- a/src/cloudflare/resources/addressing/regional_hostnames/regions.py
+++ b/src/cloudflare/resources/addressing/regional_hostnames/regions.py
@@ -5,6 +5,7 @@
import httpx
from ...._types import Body, Query, Headers, NotGiven, not_given
+from ...._utils import path_template
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -43,7 +44,7 @@ def with_streaming_response(self) -> RegionsResourceWithStreamingResponse:
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -65,10 +66,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/addressing/regional_hostnames/regions",
+ path_template("/accounts/{account_id}/addressing/regional_hostnames/regions", account_id=account_id),
page=SyncSinglePage[RegionListResponse],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -100,7 +103,7 @@ def with_streaming_response(self) -> AsyncRegionsResourceWithStreamingResponse:
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -122,10 +125,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/addressing/regional_hostnames/regions",
+ path_template("/accounts/{account_id}/addressing/regional_hostnames/regions", account_id=account_id),
page=AsyncSinglePage[RegionListResponse],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
diff --git a/src/cloudflare/resources/addressing/services.py b/src/cloudflare/resources/addressing/services.py
index 959ced7ff44..9dff6ddfedf 100644
--- a/src/cloudflare/resources/addressing/services.py
+++ b/src/cloudflare/resources/addressing/services.py
@@ -5,6 +5,7 @@
import httpx
from ..._types import Body, Query, Headers, NotGiven, not_given
+from ..._utils import path_template
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -43,7 +44,7 @@ def with_streaming_response(self) -> ServicesResourceWithStreamingResponse:
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -68,10 +69,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/addressing/services",
+ path_template("/accounts/{account_id}/addressing/services", account_id=account_id),
page=SyncSinglePage[ServiceListResponse],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -103,7 +106,7 @@ def with_streaming_response(self) -> AsyncServicesResourceWithStreamingResponse:
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -128,10 +131,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/addressing/services",
+ path_template("/accounts/{account_id}/addressing/services", account_id=account_id),
page=AsyncSinglePage[ServiceListResponse],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
diff --git a/src/cloudflare/resources/ai/ai.py b/src/cloudflare/resources/ai/ai.py
index 9a53d1b3df5..96306c52c9a 100644
--- a/src/cloudflare/resources/ai/ai.py
+++ b/src/cloudflare/resources/ai/ai.py
@@ -24,7 +24,7 @@
AsyncAuthorsResourceWithStreamingResponse,
)
from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
-from ..._utils import required_args, maybe_transform, async_maybe_transform
+from ..._utils import path_template, maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ...types.ai import ai_run_params
from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -110,7 +110,7 @@ def run(
self,
model_name: str,
*,
- account_id: str,
+ account_id: str | None = None,
text: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -148,7 +148,7 @@ def run(
self,
model_name: str,
*,
- account_id: str,
+ account_id: str | None = None,
prompt: str,
guidance: float | Omit = omit,
height: int | Omit = omit,
@@ -220,7 +220,7 @@ def run(
self,
model_name: str,
*,
- account_id: str,
+ account_id: str | None = None,
prompt: str,
lang: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -262,7 +262,7 @@ def run(
self,
model_name: str,
*,
- account_id: str,
+ account_id: str | None = None,
text: Union[str, SequenceNotStr[str]],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -300,7 +300,7 @@ def run(
self,
model_name: str,
*,
- account_id: str,
+ account_id: str | None = None,
audio: Iterable[float],
source_lang: str | Omit = omit,
target_lang: str | Omit = omit,
@@ -346,7 +346,7 @@ def run(
self,
model_name: str,
*,
- account_id: str,
+ account_id: str | None = None,
image: Iterable[float],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -385,7 +385,7 @@ def run(
self,
model_name: str,
*,
- account_id: str,
+ account_id: str | None = None,
image: Iterable[float] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -424,7 +424,7 @@ def run(
self,
model_name: str,
*,
- account_id: str,
+ account_id: str | None = None,
prompt: str,
frequency_penalty: float | Omit = omit,
lora: str | Omit = omit,
@@ -503,7 +503,7 @@ def run(
self,
model_name: str,
*,
- account_id: str,
+ account_id: str | None = None,
messages: Iterable[ai_run_params.MessagesMessage],
frequency_penalty: float | Omit = omit,
functions: Iterable[ai_run_params.MessagesFunction] | Omit = omit,
@@ -583,7 +583,7 @@ def run(
self,
model_name: str,
*,
- account_id: str,
+ account_id: str | None = None,
target_lang: str,
text: str,
source_lang: str | Omit = omit,
@@ -628,7 +628,7 @@ def run(
self,
model_name: str,
*,
- account_id: str,
+ account_id: str | None = None,
input_text: str,
max_length: int | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -669,7 +669,7 @@ def run(
self,
model_name: str,
*,
- account_id: str,
+ account_id: str | None = None,
image: Iterable[float],
frequency_penalty: float | Omit = omit,
max_tokens: int | Omit = omit,
@@ -744,7 +744,7 @@ def run(
self,
model_name: str,
*,
- account_id: str,
+ account_id: str | None = None,
image: str,
prompt: str,
frequency_penalty: float | Omit = omit,
@@ -818,7 +818,7 @@ def run(
self,
model_name: str,
*,
- account_id: str,
+ account_id: str | None = None,
image: str,
messages: Iterable[ai_run_params.Variant13Message],
frequency_penalty: float | Omit = omit,
@@ -892,7 +892,7 @@ def run(
self,
model_name: str,
*,
- account_id: str,
+ account_id: str | None = None,
image: str | Omit = omit,
text: SequenceNotStr[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -926,23 +926,11 @@ def run(
"""
...
- @required_args(
- ["account_id", "text"],
- ["account_id", "prompt"],
- ["account_id", "audio"],
- ["account_id", "image"],
- ["account_id"],
- ["account_id", "messages"],
- ["account_id", "target_lang", "text"],
- ["account_id", "input_text"],
- ["account_id", "image", "prompt"],
- ["account_id", "image", "messages"],
- )
def run(
self,
model_name: str,
*,
- account_id: str,
+ account_id: str | None = None,
text: str | Union[str, SequenceNotStr[str]] | SequenceNotStr[str] | Omit = omit,
prompt: str | Omit = omit,
guidance: float | Omit = omit,
@@ -983,6 +971,8 @@ def run(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> Optional[AIRunResponse]:
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not model_name:
@@ -990,7 +980,9 @@ def run(
return cast(
Optional[AIRunResponse],
self._post(
- f"/accounts/{account_id}/ai/run/{model_name}",
+ path_template(
+ "/accounts/{account_id}/ai/run/{model_name}", account_id=account_id, model_name=model_name
+ ),
body=maybe_transform(
{
"text": text,
@@ -1088,7 +1080,7 @@ async def run(
self,
model_name: str,
*,
- account_id: str,
+ account_id: str | None = None,
text: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -1126,7 +1118,7 @@ async def run(
self,
model_name: str,
*,
- account_id: str,
+ account_id: str | None = None,
prompt: str,
guidance: float | Omit = omit,
height: int | Omit = omit,
@@ -1198,7 +1190,7 @@ async def run(
self,
model_name: str,
*,
- account_id: str,
+ account_id: str | None = None,
prompt: str,
lang: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -1240,7 +1232,7 @@ async def run(
self,
model_name: str,
*,
- account_id: str,
+ account_id: str | None = None,
text: Union[str, SequenceNotStr[str]],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -1278,7 +1270,7 @@ async def run(
self,
model_name: str,
*,
- account_id: str,
+ account_id: str | None = None,
audio: Iterable[float],
source_lang: str | Omit = omit,
target_lang: str | Omit = omit,
@@ -1324,7 +1316,7 @@ async def run(
self,
model_name: str,
*,
- account_id: str,
+ account_id: str | None = None,
image: Iterable[float],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -1363,7 +1355,7 @@ async def run(
self,
model_name: str,
*,
- account_id: str,
+ account_id: str | None = None,
image: Iterable[float] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -1402,7 +1394,7 @@ async def run(
self,
model_name: str,
*,
- account_id: str,
+ account_id: str | None = None,
prompt: str,
frequency_penalty: float | Omit = omit,
lora: str | Omit = omit,
@@ -1481,7 +1473,7 @@ async def run(
self,
model_name: str,
*,
- account_id: str,
+ account_id: str | None = None,
messages: Iterable[ai_run_params.MessagesMessage],
frequency_penalty: float | Omit = omit,
functions: Iterable[ai_run_params.MessagesFunction] | Omit = omit,
@@ -1561,7 +1553,7 @@ async def run(
self,
model_name: str,
*,
- account_id: str,
+ account_id: str | None = None,
target_lang: str,
text: str,
source_lang: str | Omit = omit,
@@ -1606,7 +1598,7 @@ async def run(
self,
model_name: str,
*,
- account_id: str,
+ account_id: str | None = None,
input_text: str,
max_length: int | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -1647,7 +1639,7 @@ async def run(
self,
model_name: str,
*,
- account_id: str,
+ account_id: str | None = None,
image: Iterable[float],
frequency_penalty: float | Omit = omit,
max_tokens: int | Omit = omit,
@@ -1722,7 +1714,7 @@ async def run(
self,
model_name: str,
*,
- account_id: str,
+ account_id: str | None = None,
image: str,
prompt: str,
frequency_penalty: float | Omit = omit,
@@ -1796,7 +1788,7 @@ async def run(
self,
model_name: str,
*,
- account_id: str,
+ account_id: str | None = None,
image: str,
messages: Iterable[ai_run_params.Variant13Message],
frequency_penalty: float | Omit = omit,
@@ -1870,7 +1862,7 @@ async def run(
self,
model_name: str,
*,
- account_id: str,
+ account_id: str | None = None,
image: str | Omit = omit,
text: SequenceNotStr[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -1904,23 +1896,11 @@ async def run(
"""
...
- @required_args(
- ["account_id", "text"],
- ["account_id", "prompt"],
- ["account_id", "audio"],
- ["account_id", "image"],
- ["account_id"],
- ["account_id", "messages"],
- ["account_id", "target_lang", "text"],
- ["account_id", "input_text"],
- ["account_id", "image", "prompt"],
- ["account_id", "image", "messages"],
- )
async def run(
self,
model_name: str,
*,
- account_id: str,
+ account_id: str | None = None,
text: str | Union[str, SequenceNotStr[str]] | SequenceNotStr[str] | Omit = omit,
prompt: str | Omit = omit,
guidance: float | Omit = omit,
@@ -1961,6 +1941,8 @@ async def run(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> Optional[AIRunResponse]:
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not model_name:
@@ -1968,7 +1950,9 @@ async def run(
return cast(
Optional[AIRunResponse],
await self._post(
- f"/accounts/{account_id}/ai/run/{model_name}",
+ path_template(
+ "/accounts/{account_id}/ai/run/{model_name}", account_id=account_id, model_name=model_name
+ ),
body=await async_maybe_transform(
{
"text": text,
diff --git a/src/cloudflare/resources/ai/api.md b/src/cloudflare/resources/ai/api.md
new file mode 100644
index 00000000000..88e791ba4ae
--- /dev/null
+++ b/src/cloudflare/resources/ai/api.md
@@ -0,0 +1,91 @@
+# AI
+
+Types:
+
+```python
+from cloudflare.types.ai import AIRunResponse
+```
+
+Methods:
+
+- client.ai.run(model_name, \*, account_id, \*\*params) -> Optional[AIRunResponse]
+
+## Finetunes
+
+Types:
+
+```python
+from cloudflare.types.ai import FinetuneCreateResponse, FinetuneListResponse
+```
+
+Methods:
+
+- client.ai.finetunes.create(\*, account_id, \*\*params) -> FinetuneCreateResponse
+- client.ai.finetunes.list(\*, account_id) -> FinetuneListResponse
+
+### Assets
+
+Types:
+
+```python
+from cloudflare.types.ai.finetunes import AssetCreateResponse
+```
+
+Methods:
+
+- client.ai.finetunes.assets.create(finetune_id, \*, account_id, \*\*params) -> AssetCreateResponse
+
+### Public
+
+Types:
+
+```python
+from cloudflare.types.ai.finetunes import PublicListResponse
+```
+
+Methods:
+
+- client.ai.finetunes.public.list(\*, account_id, \*\*params) -> SyncSinglePage[PublicListResponse]
+
+## Authors
+
+Methods:
+
+- client.ai.authors.list(\*, account_id) -> SyncSinglePage[object]
+
+## Tasks
+
+Methods:
+
+- client.ai.tasks.list(\*, account_id) -> SyncSinglePage[object]
+
+## Models
+
+Methods:
+
+- client.ai.models.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[object]
+
+### Schema
+
+Types:
+
+```python
+from cloudflare.types.ai.models import SchemaGetResponse
+```
+
+Methods:
+
+- client.ai.models.schema.get(\*, account_id, \*\*params) -> SchemaGetResponse
+
+## ToMarkdown
+
+Types:
+
+```python
+from cloudflare.types.ai import ToMarkdownSupportedResponse, ToMarkdownTransformResponse
+```
+
+Methods:
+
+- client.ai.to_markdown.supported(\*, account_id) -> SyncSinglePage[ToMarkdownSupportedResponse]
+- client.ai.to_markdown.transform(\*, account_id, \*\*params) -> SyncSinglePage[ToMarkdownTransformResponse]
diff --git a/src/cloudflare/resources/ai/authors.py b/src/cloudflare/resources/ai/authors.py
index 8f3ceeb8486..cb44ddc0d5e 100644
--- a/src/cloudflare/resources/ai/authors.py
+++ b/src/cloudflare/resources/ai/authors.py
@@ -5,6 +5,7 @@
import httpx
from ..._types import Body, Query, Headers, NotGiven, not_given
+from ..._utils import path_template
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -42,7 +43,7 @@ def with_streaming_response(self) -> AuthorsResourceWithStreamingResponse:
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -51,7 +52,7 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncSinglePage[object]:
"""
- Author Search
+ Searches Workers AI models by author or organization name.
Args:
extra_headers: Send extra headers
@@ -62,10 +63,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/ai/authors/search",
+ path_template("/accounts/{account_id}/ai/authors/search", account_id=account_id),
page=SyncSinglePage[object],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -97,7 +100,7 @@ def with_streaming_response(self) -> AsyncAuthorsResourceWithStreamingResponse:
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -106,7 +109,7 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[object, AsyncSinglePage[object]]:
"""
- Author Search
+ Searches Workers AI models by author or organization name.
Args:
extra_headers: Send extra headers
@@ -117,10 +120,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/ai/authors/search",
+ path_template("/accounts/{account_id}/ai/authors/search", account_id=account_id),
page=AsyncSinglePage[object],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
diff --git a/src/cloudflare/resources/ai/finetunes/assets.py b/src/cloudflare/resources/ai/finetunes/assets.py
index 50ce6bb6cae..00306dbe6c1 100644
--- a/src/cloudflare/resources/ai/finetunes/assets.py
+++ b/src/cloudflare/resources/ai/finetunes/assets.py
@@ -7,7 +7,7 @@
import httpx
from ...._types import Body, Omit, Query, Headers, NotGiven, FileTypes, omit, not_given
-from ...._utils import extract_files, maybe_transform, deepcopy_minimal, async_maybe_transform
+from ...._utils import extract_files, path_template, maybe_transform, deepcopy_minimal, async_maybe_transform
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -47,7 +47,7 @@ def create(
self,
finetune_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
file: FileTypes | Omit = omit,
file_name: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -58,7 +58,7 @@ def create(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AssetCreateResponse:
"""
- Upload a Finetune Asset
+ Uploads training data assets for a Workers AI fine-tuning job.
Args:
extra_headers: Send extra headers
@@ -69,6 +69,8 @@ def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not finetune_id:
@@ -85,7 +87,11 @@ def create(
# multipart/form-data; boundary=---abc--
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
return self._post(
- f"/accounts/{account_id}/ai/finetunes/{finetune_id}/finetune-assets",
+ path_template(
+ "/accounts/{account_id}/ai/finetunes/{finetune_id}/finetune-assets",
+ account_id=account_id,
+ finetune_id=finetune_id,
+ ),
body=maybe_transform(body, asset_create_params.AssetCreateParams),
files=files,
options=make_request_options(
@@ -119,7 +125,7 @@ async def create(
self,
finetune_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
file: FileTypes | Omit = omit,
file_name: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -130,7 +136,7 @@ async def create(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AssetCreateResponse:
"""
- Upload a Finetune Asset
+ Uploads training data assets for a Workers AI fine-tuning job.
Args:
extra_headers: Send extra headers
@@ -141,6 +147,8 @@ async def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not finetune_id:
@@ -157,7 +165,11 @@ async def create(
# multipart/form-data; boundary=---abc--
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
return await self._post(
- f"/accounts/{account_id}/ai/finetunes/{finetune_id}/finetune-assets",
+ path_template(
+ "/accounts/{account_id}/ai/finetunes/{finetune_id}/finetune-assets",
+ account_id=account_id,
+ finetune_id=finetune_id,
+ ),
body=await async_maybe_transform(body, asset_create_params.AssetCreateParams),
files=files,
options=make_request_options(
diff --git a/src/cloudflare/resources/ai/finetunes/finetunes.py b/src/cloudflare/resources/ai/finetunes/finetunes.py
index e998763b6f2..a0d28ad0bcb 100644
--- a/src/cloudflare/resources/ai/finetunes/finetunes.py
+++ b/src/cloudflare/resources/ai/finetunes/finetunes.py
@@ -23,7 +23,7 @@
AsyncPublicResourceWithStreamingResponse,
)
from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ...._utils import maybe_transform, async_maybe_transform
+from ...._utils import path_template, maybe_transform, async_maybe_transform
from ...._compat import cached_property
from ....types.ai import finetune_create_params
from ...._resource import SyncAPIResource, AsyncAPIResource
@@ -72,7 +72,7 @@ def with_streaming_response(self) -> FinetunesResourceWithStreamingResponse:
def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
model: str,
name: str,
description: str | Omit = omit,
@@ -85,7 +85,7 @@ def create(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> FinetuneCreateResponse:
"""
- Create a new Finetune
+ Creates a new fine-tuning job for a Workers AI model using custom training data.
Args:
extra_headers: Send extra headers
@@ -96,10 +96,12 @@ def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._post(
- f"/accounts/{account_id}/ai/finetunes",
+ path_template("/accounts/{account_id}/ai/finetunes", account_id=account_id),
body=maybe_transform(
{
"model": model,
@@ -122,7 +124,7 @@ def create(
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -131,7 +133,7 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> FinetuneListResponse:
"""
- List Finetunes
+ Lists all fine-tuning jobs created by the account, including status and metrics.
Args:
extra_headers: Send extra headers
@@ -142,10 +144,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get(
- f"/accounts/{account_id}/ai/finetunes",
+ path_template("/accounts/{account_id}/ai/finetunes", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -188,7 +192,7 @@ def with_streaming_response(self) -> AsyncFinetunesResourceWithStreamingResponse
async def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
model: str,
name: str,
description: str | Omit = omit,
@@ -201,7 +205,7 @@ async def create(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> FinetuneCreateResponse:
"""
- Create a new Finetune
+ Creates a new fine-tuning job for a Workers AI model using custom training data.
Args:
extra_headers: Send extra headers
@@ -212,10 +216,12 @@ async def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._post(
- f"/accounts/{account_id}/ai/finetunes",
+ path_template("/accounts/{account_id}/ai/finetunes", account_id=account_id),
body=await async_maybe_transform(
{
"model": model,
@@ -238,7 +244,7 @@ async def create(
async def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -247,7 +253,7 @@ async def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> FinetuneListResponse:
"""
- List Finetunes
+ Lists all fine-tuning jobs created by the account, including status and metrics.
Args:
extra_headers: Send extra headers
@@ -258,10 +264,12 @@ async def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._get(
- f"/accounts/{account_id}/ai/finetunes",
+ path_template("/accounts/{account_id}/ai/finetunes", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/ai/finetunes/public.py b/src/cloudflare/resources/ai/finetunes/public.py
index 0e8f9e74988..711f22f3af7 100644
--- a/src/cloudflare/resources/ai/finetunes/public.py
+++ b/src/cloudflare/resources/ai/finetunes/public.py
@@ -5,7 +5,7 @@
import httpx
from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ...._utils import maybe_transform
+from ...._utils import path_template, maybe_transform
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -45,7 +45,7 @@ def with_streaming_response(self) -> PublicResourceWithStreamingResponse:
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
limit: float | Omit = omit,
offset: float | Omit = omit,
order_by: str | Omit = omit,
@@ -57,7 +57,7 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncSinglePage[PublicListResponse]:
"""
- List Public Finetunes
+ Lists publicly available fine-tuned models that can be used with Workers AI.
Args:
limit: Pagination Limit
@@ -74,10 +74,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/ai/finetunes/public",
+ path_template("/accounts/{account_id}/ai/finetunes/public", account_id=account_id),
page=SyncSinglePage[PublicListResponse],
options=make_request_options(
extra_headers=extra_headers,
@@ -120,7 +122,7 @@ def with_streaming_response(self) -> AsyncPublicResourceWithStreamingResponse:
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
limit: float | Omit = omit,
offset: float | Omit = omit,
order_by: str | Omit = omit,
@@ -132,7 +134,7 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[PublicListResponse, AsyncSinglePage[PublicListResponse]]:
"""
- List Public Finetunes
+ Lists publicly available fine-tuned models that can be used with Workers AI.
Args:
limit: Pagination Limit
@@ -149,10 +151,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/ai/finetunes/public",
+ path_template("/accounts/{account_id}/ai/finetunes/public", account_id=account_id),
page=AsyncSinglePage[PublicListResponse],
options=make_request_options(
extra_headers=extra_headers,
diff --git a/src/cloudflare/resources/ai/models/models.py b/src/cloudflare/resources/ai/models/models.py
index 9d6d4f9c83d..4b5845d98cb 100644
--- a/src/cloudflare/resources/ai/models/models.py
+++ b/src/cloudflare/resources/ai/models/models.py
@@ -13,7 +13,7 @@
AsyncSchemaResourceWithStreamingResponse,
)
from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ...._utils import maybe_transform
+from ...._utils import path_template, maybe_transform
from ...._compat import cached_property
from ....types.ai import model_list_params
from ...._resource import SyncAPIResource, AsyncAPIResource
@@ -56,7 +56,7 @@ def with_streaming_response(self) -> ModelsResourceWithStreamingResponse:
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
author: str | Omit = omit,
hide_experimental: bool | Omit = omit,
page: int | Omit = omit,
@@ -72,7 +72,7 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncV4PagePaginationArray[object]:
"""
- Model Search
+ Searches Workers AI models by name or description.
Args:
author: Filter by Author
@@ -93,10 +93,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/ai/models/search",
+ path_template("/accounts/{account_id}/ai/models/search", account_id=account_id),
page=SyncV4PagePaginationArray[object],
options=make_request_options(
extra_headers=extra_headers,
@@ -147,7 +149,7 @@ def with_streaming_response(self) -> AsyncModelsResourceWithStreamingResponse:
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
author: str | Omit = omit,
hide_experimental: bool | Omit = omit,
page: int | Omit = omit,
@@ -163,7 +165,7 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[object, AsyncV4PagePaginationArray[object]]:
"""
- Model Search
+ Searches Workers AI models by name or description.
Args:
author: Filter by Author
@@ -184,10 +186,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/ai/models/search",
+ path_template("/accounts/{account_id}/ai/models/search", account_id=account_id),
page=AsyncV4PagePaginationArray[object],
options=make_request_options(
extra_headers=extra_headers,
diff --git a/src/cloudflare/resources/ai/models/schema.py b/src/cloudflare/resources/ai/models/schema.py
index 2f12236dd38..605cc4f6384 100644
--- a/src/cloudflare/resources/ai/models/schema.py
+++ b/src/cloudflare/resources/ai/models/schema.py
@@ -7,7 +7,7 @@
import httpx
from ...._types import Body, Query, Headers, NotGiven, not_given
-from ...._utils import maybe_transform, async_maybe_transform
+from ...._utils import path_template, maybe_transform, async_maybe_transform
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -19,6 +19,7 @@
from ...._wrappers import ResultWrapper
from ...._base_client import make_request_options
from ....types.ai.models import schema_get_params
+from ....types.ai.models.schema_get_response import SchemaGetResponse
__all__ = ["SchemaResource", "AsyncSchemaResource"]
@@ -46,7 +47,7 @@ def with_streaming_response(self) -> SchemaResourceWithStreamingResponse:
def get(
self,
*,
- account_id: str,
+ account_id: str | None = None,
model: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -54,9 +55,9 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> object:
+ ) -> SchemaGetResponse:
"""
- Get Model Schema
+ Retrieves the input and output JSON schema definition for a Workers AI model.
Args:
model: Model Name
@@ -69,19 +70,21 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get(
- f"/accounts/{account_id}/ai/models/schema",
+ path_template("/accounts/{account_id}/ai/models/schema", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform({"model": model}, schema_get_params.SchemaGetParams),
- post_parser=ResultWrapper[object]._unwrapper,
+ post_parser=ResultWrapper[SchemaGetResponse]._unwrapper,
),
- cast_to=cast(Type[object], ResultWrapper[object]),
+ cast_to=cast(Type[SchemaGetResponse], ResultWrapper[SchemaGetResponse]),
)
@@ -108,7 +111,7 @@ def with_streaming_response(self) -> AsyncSchemaResourceWithStreamingResponse:
async def get(
self,
*,
- account_id: str,
+ account_id: str | None = None,
model: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -116,9 +119,9 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> object:
+ ) -> SchemaGetResponse:
"""
- Get Model Schema
+ Retrieves the input and output JSON schema definition for a Workers AI model.
Args:
model: Model Name
@@ -131,19 +134,21 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._get(
- f"/accounts/{account_id}/ai/models/schema",
+ path_template("/accounts/{account_id}/ai/models/schema", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=await async_maybe_transform({"model": model}, schema_get_params.SchemaGetParams),
- post_parser=ResultWrapper[object]._unwrapper,
+ post_parser=ResultWrapper[SchemaGetResponse]._unwrapper,
),
- cast_to=cast(Type[object], ResultWrapper[object]),
+ cast_to=cast(Type[SchemaGetResponse], ResultWrapper[SchemaGetResponse]),
)
diff --git a/src/cloudflare/resources/ai/tasks.py b/src/cloudflare/resources/ai/tasks.py
index 26fcd51f8b0..3fcc901ea28 100644
--- a/src/cloudflare/resources/ai/tasks.py
+++ b/src/cloudflare/resources/ai/tasks.py
@@ -5,6 +5,7 @@
import httpx
from ..._types import Body, Query, Headers, NotGiven, not_given
+from ..._utils import path_template
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -42,7 +43,7 @@ def with_streaming_response(self) -> TasksResourceWithStreamingResponse:
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -51,7 +52,7 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncSinglePage[object]:
"""
- Task Search
+ Searches Workers AI models by task type (e.g., text-generation, embeddings).
Args:
extra_headers: Send extra headers
@@ -62,10 +63,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/ai/tasks/search",
+ path_template("/accounts/{account_id}/ai/tasks/search", account_id=account_id),
page=SyncSinglePage[object],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -97,7 +100,7 @@ def with_streaming_response(self) -> AsyncTasksResourceWithStreamingResponse:
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -106,7 +109,7 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[object, AsyncSinglePage[object]]:
"""
- Task Search
+ Searches Workers AI models by task type (e.g., text-generation, embeddings).
Args:
extra_headers: Send extra headers
@@ -117,10 +120,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/ai/tasks/search",
+ path_template("/accounts/{account_id}/ai/tasks/search", account_id=account_id),
page=AsyncSinglePage[object],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
diff --git a/src/cloudflare/resources/ai/to_markdown.py b/src/cloudflare/resources/ai/to_markdown.py
index 15cab8aa9e4..2b029ec15b3 100644
--- a/src/cloudflare/resources/ai/to_markdown.py
+++ b/src/cloudflare/resources/ai/to_markdown.py
@@ -7,7 +7,7 @@
import httpx
from ..._types import Body, Query, Headers, NotGiven, not_given
-from ..._utils import extract_files, maybe_transform, deepcopy_minimal
+from ..._utils import extract_files, path_template, maybe_transform, deepcopy_minimal
from ..._compat import cached_property
from ...types.ai import to_markdown_transform_params
from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -48,7 +48,7 @@ def with_streaming_response(self) -> ToMarkdownResourceWithStreamingResponse:
def supported(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -57,7 +57,7 @@ def supported(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncSinglePage[ToMarkdownSupportedResponse]:
"""
- Get all converted formats supported
+ Lists all file formats supported for conversion to Markdown.
Args:
extra_headers: Send extra headers
@@ -68,10 +68,12 @@ def supported(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
- return self._get_api_list(
- f"/accounts/{account_id}/ai/tomarkdown/supported",
+ return self._get_api_list( # type: ignore[call-arg]
+ path_template("/accounts/{account_id}/ai/tomarkdown/supported", account_id=account_id),
page=SyncSinglePage[ToMarkdownSupportedResponse],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -82,7 +84,7 @@ def supported(
def transform(
self,
*,
- account_id: str,
+ account_id: str | None = None,
file: to_markdown_transform_params.File,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -92,7 +94,7 @@ def transform(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncSinglePage[ToMarkdownTransformResponse]:
"""
- Convert Files into Markdown
+ Converts uploaded files into Markdown format using Workers AI.
Args:
extra_headers: Send extra headers
@@ -103,6 +105,8 @@ def transform(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
body = deepcopy_minimal(file)
@@ -111,11 +115,11 @@ def transform(
# sent to the server will contain a `boundary` parameter, e.g.
# multipart/form-data; boundary=---abc--
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
- return self._get_api_list( # type: ignore[call-arg] # pyright: ignore[reportUnknownVariableType, reportCallIssue]
- f"/accounts/{account_id}/ai/tomarkdown",
+ return self._get_api_list( # type: ignore[call-arg]
+ path_template("/accounts/{account_id}/ai/tomarkdown", account_id=account_id),
page=SyncSinglePage[ToMarkdownTransformResponse],
body=maybe_transform(body, to_markdown_transform_params.ToMarkdownTransformParams),
- files=files, # pyright: ignore[reportCallIssue] # type: ignore[call-arg]
+ files=files, # pyright: ignore[reportCallIssue]
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -147,7 +151,7 @@ def with_streaming_response(self) -> AsyncToMarkdownResourceWithStreamingRespons
def supported(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -156,7 +160,7 @@ def supported(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[ToMarkdownSupportedResponse, AsyncSinglePage[ToMarkdownSupportedResponse]]:
"""
- Get all converted formats supported
+ Lists all file formats supported for conversion to Markdown.
Args:
extra_headers: Send extra headers
@@ -167,10 +171,12 @@ def supported(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
- return self._get_api_list(
- f"/accounts/{account_id}/ai/tomarkdown/supported",
+ return self._get_api_list( # type: ignore[call-arg]
+ path_template("/accounts/{account_id}/ai/tomarkdown/supported", account_id=account_id),
page=AsyncSinglePage[ToMarkdownSupportedResponse],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -181,7 +187,7 @@ def supported(
def transform(
self,
*,
- account_id: str,
+ account_id: str | None = None,
file: to_markdown_transform_params.File,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -191,7 +197,7 @@ def transform(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[ToMarkdownTransformResponse, AsyncSinglePage[ToMarkdownTransformResponse]]:
"""
- Convert Files into Markdown
+ Converts uploaded files into Markdown format using Workers AI.
Args:
extra_headers: Send extra headers
@@ -202,6 +208,8 @@ def transform(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
body = deepcopy_minimal(file)
@@ -210,11 +218,11 @@ def transform(
# sent to the server will contain a `boundary` parameter, e.g.
# multipart/form-data; boundary=---abc--
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
- return self._get_api_list( # type: ignore[call-arg] # pyright: ignore[reportUnknownVariableType, reportCallIssue]
- f"/accounts/{account_id}/ai/tomarkdown",
+ return self._get_api_list( # type: ignore[call-arg]
+ path_template("/accounts/{account_id}/ai/tomarkdown", account_id=account_id),
page=AsyncSinglePage[ToMarkdownTransformResponse],
body=maybe_transform(body, to_markdown_transform_params.ToMarkdownTransformParams),
- files=files, # pyright: ignore[reportCallIssue] # type: ignore[call-arg]
+ files=files, # pyright: ignore[reportCallIssue]
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
diff --git a/src/cloudflare/resources/ai_gateway/ai_gateway.py b/src/cloudflare/resources/ai_gateway/ai_gateway.py
index 545ad9b28e6..2591ae29f5f 100644
--- a/src/cloudflare/resources/ai_gateway/ai_gateway.py
+++ b/src/cloudflare/resources/ai_gateway/ai_gateway.py
@@ -24,7 +24,7 @@
AsyncURLsResourceWithStreamingResponse,
)
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ..._utils import maybe_transform, async_maybe_transform
+from ..._utils import path_template, maybe_transform, async_maybe_transform
from .datasets import (
DatasetsResource,
AsyncDatasetsResource,
@@ -137,20 +137,23 @@ def with_streaming_response(self) -> AIGatewayResourceWithStreamingResponse:
def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
id: str,
cache_invalidate_on_update: bool,
cache_ttl: Optional[int],
collect_logs: bool,
rate_limiting_interval: Optional[int],
rate_limiting_limit: Optional[int],
- rate_limiting_technique: Literal["fixed", "sliding"],
authentication: bool | Omit = omit,
- is_default: bool | Omit = omit,
log_management: Optional[int] | Omit = omit,
log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]] | Omit = omit,
logpush: bool | Omit = omit,
logpush_public_key: Optional[str] | Omit = omit,
+ rate_limiting_technique: Optional[Literal["fixed", "sliding"]] | Omit = omit,
+ retry_backoff: Optional[Literal["constant", "linear", "exponential"]] | Omit = omit,
+ retry_delay: Optional[int] | Omit = omit,
+ retry_max_attempts: Optional[int] | Omit = omit,
+ workers_ai_billing_mode: Literal["postpaid"] | Omit = omit,
zdr: bool | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -160,11 +163,20 @@ def create(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AIGatewayCreateResponse:
"""
- Create a new Gateway
+ Creates a new AI Gateway.
Args:
id: gateway id
+ retry_backoff: Backoff strategy for retry delays
+
+ retry_delay: Delay between retry attempts in milliseconds (0-5000)
+
+ retry_max_attempts: Maximum number of retry attempts for failed requests (1-5)
+
+ workers_ai_billing_mode: Controls how Workers AI inference calls routed through this gateway are billed.
+ Only 'postpaid' is currently supported.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -173,10 +185,12 @@ def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._post(
- f"/accounts/{account_id}/ai-gateway/gateways",
+ path_template("/accounts/{account_id}/ai-gateway/gateways", account_id=account_id),
body=maybe_transform(
{
"id": id,
@@ -185,13 +199,16 @@ def create(
"collect_logs": collect_logs,
"rate_limiting_interval": rate_limiting_interval,
"rate_limiting_limit": rate_limiting_limit,
- "rate_limiting_technique": rate_limiting_technique,
"authentication": authentication,
- "is_default": is_default,
"log_management": log_management,
"log_management_strategy": log_management_strategy,
"logpush": logpush,
"logpush_public_key": logpush_public_key,
+ "rate_limiting_technique": rate_limiting_technique,
+ "retry_backoff": retry_backoff,
+ "retry_delay": retry_delay,
+ "retry_max_attempts": retry_max_attempts,
+ "workers_ai_billing_mode": workers_ai_billing_mode,
"zdr": zdr,
},
ai_gateway_create_params.AIGatewayCreateParams,
@@ -210,23 +227,26 @@ def update(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
cache_invalidate_on_update: bool,
cache_ttl: Optional[int],
collect_logs: bool,
rate_limiting_interval: Optional[int],
rate_limiting_limit: Optional[int],
- rate_limiting_technique: Literal["fixed", "sliding"],
authentication: bool | Omit = omit,
dlp: ai_gateway_update_params.DLP | Omit = omit,
- is_default: bool | Omit = omit,
log_management: Optional[int] | Omit = omit,
log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]] | Omit = omit,
logpush: bool | Omit = omit,
logpush_public_key: Optional[str] | Omit = omit,
otel: Optional[Iterable[ai_gateway_update_params.Otel]] | Omit = omit,
+ rate_limiting_technique: Optional[Literal["fixed", "sliding"]] | Omit = omit,
+ retry_backoff: Optional[Literal["constant", "linear", "exponential"]] | Omit = omit,
+ retry_delay: Optional[int] | Omit = omit,
+ retry_max_attempts: Optional[int] | Omit = omit,
store_id: Optional[str] | Omit = omit,
stripe: Optional[ai_gateway_update_params.Stripe] | Omit = omit,
+ workers_ai_billing_mode: Literal["postpaid"] | Omit = omit,
zdr: bool | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -236,11 +256,20 @@ def update(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AIGatewayUpdateResponse:
"""
- Update a Gateway
+ Updates an existing AI Gateway dataset.
Args:
id: gateway id
+ retry_backoff: Backoff strategy for retry delays
+
+ retry_delay: Delay between retry attempts in milliseconds (0-5000)
+
+ retry_max_attempts: Maximum number of retry attempts for failed requests (1-5)
+
+ workers_ai_billing_mode: Controls how Workers AI inference calls routed through this gateway are billed.
+ Only 'postpaid' is currently supported.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -249,12 +278,14 @@ def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._put(
- f"/accounts/{account_id}/ai-gateway/gateways/{id}",
+ path_template("/accounts/{account_id}/ai-gateway/gateways/{id}", account_id=account_id, id=id),
body=maybe_transform(
{
"cache_invalidate_on_update": cache_invalidate_on_update,
@@ -262,17 +293,20 @@ def update(
"collect_logs": collect_logs,
"rate_limiting_interval": rate_limiting_interval,
"rate_limiting_limit": rate_limiting_limit,
- "rate_limiting_technique": rate_limiting_technique,
"authentication": authentication,
"dlp": dlp,
- "is_default": is_default,
"log_management": log_management,
"log_management_strategy": log_management_strategy,
"logpush": logpush,
"logpush_public_key": logpush_public_key,
"otel": otel,
+ "rate_limiting_technique": rate_limiting_technique,
+ "retry_backoff": retry_backoff,
+ "retry_delay": retry_delay,
+ "retry_max_attempts": retry_max_attempts,
"store_id": store_id,
"stripe": stripe,
+ "workers_ai_billing_mode": workers_ai_billing_mode,
"zdr": zdr,
},
ai_gateway_update_params.AIGatewayUpdateParams,
@@ -290,7 +324,7 @@ def update(
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
page: int | Omit = omit,
per_page: int | Omit = omit,
search: str | Omit = omit,
@@ -302,7 +336,7 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncV4PagePaginationArray[AIGatewayListResponse]:
"""
- List Gateways
+ Lists all AI Gateway evaluator types configured for the account.
Args:
search: Search by id
@@ -315,10 +349,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/ai-gateway/gateways",
+ path_template("/accounts/{account_id}/ai-gateway/gateways", account_id=account_id),
page=SyncV4PagePaginationArray[AIGatewayListResponse],
options=make_request_options(
extra_headers=extra_headers,
@@ -341,7 +377,7 @@ def delete(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -350,7 +386,7 @@ def delete(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AIGatewayDeleteResponse:
"""
- Delete a Gateway
+ Deletes an AI Gateway dataset.
Args:
id: gateway id
@@ -363,12 +399,14 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._delete(
- f"/accounts/{account_id}/ai-gateway/gateways/{id}",
+ path_template("/accounts/{account_id}/ai-gateway/gateways/{id}", account_id=account_id, id=id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -383,7 +421,7 @@ def get(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -392,7 +430,7 @@ def get(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AIGatewayGetResponse:
"""
- Fetch a Gateway
+ Retrieves details for a specific AI Gateway dataset.
Args:
id: gateway id
@@ -405,12 +443,14 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._get(
- f"/accounts/{account_id}/ai-gateway/gateways/{id}",
+ path_template("/accounts/{account_id}/ai-gateway/gateways/{id}", account_id=account_id, id=id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -473,20 +513,23 @@ def with_streaming_response(self) -> AsyncAIGatewayResourceWithStreamingResponse
async def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
id: str,
cache_invalidate_on_update: bool,
cache_ttl: Optional[int],
collect_logs: bool,
rate_limiting_interval: Optional[int],
rate_limiting_limit: Optional[int],
- rate_limiting_technique: Literal["fixed", "sliding"],
authentication: bool | Omit = omit,
- is_default: bool | Omit = omit,
log_management: Optional[int] | Omit = omit,
log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]] | Omit = omit,
logpush: bool | Omit = omit,
logpush_public_key: Optional[str] | Omit = omit,
+ rate_limiting_technique: Optional[Literal["fixed", "sliding"]] | Omit = omit,
+ retry_backoff: Optional[Literal["constant", "linear", "exponential"]] | Omit = omit,
+ retry_delay: Optional[int] | Omit = omit,
+ retry_max_attempts: Optional[int] | Omit = omit,
+ workers_ai_billing_mode: Literal["postpaid"] | Omit = omit,
zdr: bool | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -496,11 +539,20 @@ async def create(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AIGatewayCreateResponse:
"""
- Create a new Gateway
+ Creates a new AI Gateway.
Args:
id: gateway id
+ retry_backoff: Backoff strategy for retry delays
+
+ retry_delay: Delay between retry attempts in milliseconds (0-5000)
+
+ retry_max_attempts: Maximum number of retry attempts for failed requests (1-5)
+
+ workers_ai_billing_mode: Controls how Workers AI inference calls routed through this gateway are billed.
+ Only 'postpaid' is currently supported.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -509,10 +561,12 @@ async def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._post(
- f"/accounts/{account_id}/ai-gateway/gateways",
+ path_template("/accounts/{account_id}/ai-gateway/gateways", account_id=account_id),
body=await async_maybe_transform(
{
"id": id,
@@ -521,13 +575,16 @@ async def create(
"collect_logs": collect_logs,
"rate_limiting_interval": rate_limiting_interval,
"rate_limiting_limit": rate_limiting_limit,
- "rate_limiting_technique": rate_limiting_technique,
"authentication": authentication,
- "is_default": is_default,
"log_management": log_management,
"log_management_strategy": log_management_strategy,
"logpush": logpush,
"logpush_public_key": logpush_public_key,
+ "rate_limiting_technique": rate_limiting_technique,
+ "retry_backoff": retry_backoff,
+ "retry_delay": retry_delay,
+ "retry_max_attempts": retry_max_attempts,
+ "workers_ai_billing_mode": workers_ai_billing_mode,
"zdr": zdr,
},
ai_gateway_create_params.AIGatewayCreateParams,
@@ -546,23 +603,26 @@ async def update(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
cache_invalidate_on_update: bool,
cache_ttl: Optional[int],
collect_logs: bool,
rate_limiting_interval: Optional[int],
rate_limiting_limit: Optional[int],
- rate_limiting_technique: Literal["fixed", "sliding"],
authentication: bool | Omit = omit,
dlp: ai_gateway_update_params.DLP | Omit = omit,
- is_default: bool | Omit = omit,
log_management: Optional[int] | Omit = omit,
log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]] | Omit = omit,
logpush: bool | Omit = omit,
logpush_public_key: Optional[str] | Omit = omit,
otel: Optional[Iterable[ai_gateway_update_params.Otel]] | Omit = omit,
+ rate_limiting_technique: Optional[Literal["fixed", "sliding"]] | Omit = omit,
+ retry_backoff: Optional[Literal["constant", "linear", "exponential"]] | Omit = omit,
+ retry_delay: Optional[int] | Omit = omit,
+ retry_max_attempts: Optional[int] | Omit = omit,
store_id: Optional[str] | Omit = omit,
stripe: Optional[ai_gateway_update_params.Stripe] | Omit = omit,
+ workers_ai_billing_mode: Literal["postpaid"] | Omit = omit,
zdr: bool | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -572,11 +632,20 @@ async def update(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AIGatewayUpdateResponse:
"""
- Update a Gateway
+ Updates an existing AI Gateway dataset.
Args:
id: gateway id
+ retry_backoff: Backoff strategy for retry delays
+
+ retry_delay: Delay between retry attempts in milliseconds (0-5000)
+
+ retry_max_attempts: Maximum number of retry attempts for failed requests (1-5)
+
+ workers_ai_billing_mode: Controls how Workers AI inference calls routed through this gateway are billed.
+ Only 'postpaid' is currently supported.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -585,12 +654,14 @@ async def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return await self._put(
- f"/accounts/{account_id}/ai-gateway/gateways/{id}",
+ path_template("/accounts/{account_id}/ai-gateway/gateways/{id}", account_id=account_id, id=id),
body=await async_maybe_transform(
{
"cache_invalidate_on_update": cache_invalidate_on_update,
@@ -598,17 +669,20 @@ async def update(
"collect_logs": collect_logs,
"rate_limiting_interval": rate_limiting_interval,
"rate_limiting_limit": rate_limiting_limit,
- "rate_limiting_technique": rate_limiting_technique,
"authentication": authentication,
"dlp": dlp,
- "is_default": is_default,
"log_management": log_management,
"log_management_strategy": log_management_strategy,
"logpush": logpush,
"logpush_public_key": logpush_public_key,
"otel": otel,
+ "rate_limiting_technique": rate_limiting_technique,
+ "retry_backoff": retry_backoff,
+ "retry_delay": retry_delay,
+ "retry_max_attempts": retry_max_attempts,
"store_id": store_id,
"stripe": stripe,
+ "workers_ai_billing_mode": workers_ai_billing_mode,
"zdr": zdr,
},
ai_gateway_update_params.AIGatewayUpdateParams,
@@ -626,7 +700,7 @@ async def update(
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
page: int | Omit = omit,
per_page: int | Omit = omit,
search: str | Omit = omit,
@@ -638,7 +712,7 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[AIGatewayListResponse, AsyncV4PagePaginationArray[AIGatewayListResponse]]:
"""
- List Gateways
+ Lists all AI Gateway evaluator types configured for the account.
Args:
search: Search by id
@@ -651,10 +725,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/ai-gateway/gateways",
+ path_template("/accounts/{account_id}/ai-gateway/gateways", account_id=account_id),
page=AsyncV4PagePaginationArray[AIGatewayListResponse],
options=make_request_options(
extra_headers=extra_headers,
@@ -677,7 +753,7 @@ async def delete(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -686,7 +762,7 @@ async def delete(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AIGatewayDeleteResponse:
"""
- Delete a Gateway
+ Deletes an AI Gateway dataset.
Args:
id: gateway id
@@ -699,12 +775,14 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return await self._delete(
- f"/accounts/{account_id}/ai-gateway/gateways/{id}",
+ path_template("/accounts/{account_id}/ai-gateway/gateways/{id}", account_id=account_id, id=id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -719,7 +797,7 @@ async def get(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -728,7 +806,7 @@ async def get(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AIGatewayGetResponse:
"""
- Fetch a Gateway
+ Retrieves details for a specific AI Gateway dataset.
Args:
id: gateway id
@@ -741,12 +819,14 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return await self._get(
- f"/accounts/{account_id}/ai-gateway/gateways/{id}",
+ path_template("/accounts/{account_id}/ai-gateway/gateways/{id}", account_id=account_id, id=id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/ai_gateway/api.md b/src/cloudflare/resources/ai_gateway/api.md
new file mode 100644
index 00000000000..7202ceae450
--- /dev/null
+++ b/src/cloudflare/resources/ai_gateway/api.md
@@ -0,0 +1,149 @@
+# AIGateway
+
+Types:
+
+```python
+from cloudflare.types.ai_gateway import (
+ AIGatewayCreateResponse,
+ AIGatewayUpdateResponse,
+ AIGatewayListResponse,
+ AIGatewayDeleteResponse,
+ AIGatewayGetResponse,
+)
+```
+
+Methods:
+
+- client.ai_gateway.create(\*, account_id, \*\*params) -> AIGatewayCreateResponse
+- client.ai_gateway.update(id, \*, account_id, \*\*params) -> AIGatewayUpdateResponse
+- client.ai_gateway.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[AIGatewayListResponse]
+- client.ai_gateway.delete(id, \*, account_id) -> AIGatewayDeleteResponse
+- client.ai_gateway.get(id, \*, account_id) -> AIGatewayGetResponse
+
+## EvaluationTypes
+
+Types:
+
+```python
+from cloudflare.types.ai_gateway import EvaluationTypeListResponse
+```
+
+Methods:
+
+- client.ai_gateway.evaluation_types.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[EvaluationTypeListResponse]
+
+## Logs
+
+Types:
+
+```python
+from cloudflare.types.ai_gateway import LogListResponse, LogDeleteResponse, LogGetResponse
+```
+
+Methods:
+
+- client.ai_gateway.logs.list(gateway_id, \*, account_id, \*\*params) -> SyncV4PagePaginationArray[LogListResponse]
+- client.ai_gateway.logs.delete(gateway_id, \*, account_id, \*\*params) -> LogDeleteResponse
+- client.ai_gateway.logs.edit(id, \*, account_id, gateway_id, \*\*params) -> object
+- client.ai_gateway.logs.get(id, \*, account_id, gateway_id) -> LogGetResponse
+- client.ai_gateway.logs.request(id, \*, account_id, gateway_id) -> object
+- client.ai_gateway.logs.response(id, \*, account_id, gateway_id) -> object
+
+## Datasets
+
+Types:
+
+```python
+from cloudflare.types.ai_gateway import (
+ DatasetCreateResponse,
+ DatasetUpdateResponse,
+ DatasetListResponse,
+ DatasetDeleteResponse,
+ DatasetGetResponse,
+)
+```
+
+Methods:
+
+- client.ai_gateway.datasets.create(gateway_id, \*, account_id, \*\*params) -> DatasetCreateResponse
+- client.ai_gateway.datasets.update(id, \*, account_id, gateway_id, \*\*params) -> DatasetUpdateResponse
+- client.ai_gateway.datasets.list(gateway_id, \*, account_id, \*\*params) -> SyncV4PagePaginationArray[DatasetListResponse]
+- client.ai_gateway.datasets.delete(id, \*, account_id, gateway_id) -> DatasetDeleteResponse
+- client.ai_gateway.datasets.get(id, \*, account_id, gateway_id) -> DatasetGetResponse
+
+## Evaluations
+
+Types:
+
+```python
+from cloudflare.types.ai_gateway import (
+ EvaluationCreateResponse,
+ EvaluationListResponse,
+ EvaluationDeleteResponse,
+ EvaluationGetResponse,
+)
+```
+
+Methods:
+
+- client.ai_gateway.evaluations.create(gateway_id, \*, account_id, \*\*params) -> EvaluationCreateResponse
+- client.ai_gateway.evaluations.list(gateway_id, \*, account_id, \*\*params) -> SyncV4PagePaginationArray[EvaluationListResponse]
+- client.ai_gateway.evaluations.delete(id, \*, account_id, gateway_id) -> EvaluationDeleteResponse
+- client.ai_gateway.evaluations.get(id, \*, account_id, gateway_id) -> EvaluationGetResponse
+
+## DynamicRouting
+
+Types:
+
+```python
+from cloudflare.types.ai_gateway import (
+ DynamicRoutingCreateResponse,
+ DynamicRoutingUpdateResponse,
+ DynamicRoutingListResponse,
+ DynamicRoutingDeleteResponse,
+ DynamicRoutingCreateDeploymentResponse,
+ DynamicRoutingCreateVersionResponse,
+ DynamicRoutingGetResponse,
+ DynamicRoutingGetVersionResponse,
+ DynamicRoutingListDeploymentsResponse,
+ DynamicRoutingListVersionsResponse,
+)
+```
+
+Methods:
+
+- client.ai_gateway.dynamic_routing.create(gateway_id, \*, account_id, \*\*params) -> DynamicRoutingCreateResponse
+- client.ai_gateway.dynamic_routing.update(id, \*, account_id, gateway_id, \*\*params) -> DynamicRoutingUpdateResponse
+- client.ai_gateway.dynamic_routing.list(gateway_id, \*, account_id) -> DynamicRoutingListResponse
+- client.ai_gateway.dynamic_routing.delete(id, \*, account_id, gateway_id) -> DynamicRoutingDeleteResponse
+- client.ai_gateway.dynamic_routing.create_deployment(id, \*, account_id, gateway_id, \*\*params) -> DynamicRoutingCreateDeploymentResponse
+- client.ai_gateway.dynamic_routing.create_version(id, \*, account_id, gateway_id, \*\*params) -> DynamicRoutingCreateVersionResponse
+- client.ai_gateway.dynamic_routing.get(id, \*, account_id, gateway_id) -> DynamicRoutingGetResponse
+- client.ai_gateway.dynamic_routing.get_version(version_id, \*, account_id, gateway_id, id) -> DynamicRoutingGetVersionResponse
+- client.ai_gateway.dynamic_routing.list_deployments(id, \*, account_id, gateway_id) -> DynamicRoutingListDeploymentsResponse
+- client.ai_gateway.dynamic_routing.list_versions(id, \*, account_id, gateway_id) -> DynamicRoutingListVersionsResponse
+
+## ProviderConfigs
+
+Types:
+
+```python
+from cloudflare.types.ai_gateway import ProviderConfigCreateResponse, ProviderConfigListResponse
+```
+
+Methods:
+
+- client.ai_gateway.provider_configs.create(gateway_id, \*, account_id, \*\*params) -> ProviderConfigCreateResponse
+- client.ai_gateway.provider_configs.list(gateway_id, \*, account_id, \*\*params) -> SyncV4PagePaginationArray[ProviderConfigListResponse]
+
+## URLs
+
+Types:
+
+```python
+from cloudflare.types.ai_gateway import URLGetResponse
+```
+
+Methods:
+
+- client.ai_gateway.urls.get(provider, \*, account_id, gateway_id) -> str
diff --git a/src/cloudflare/resources/ai_gateway/datasets.py b/src/cloudflare/resources/ai_gateway/datasets.py
index bb256a33205..1088fe9c208 100644
--- a/src/cloudflare/resources/ai_gateway/datasets.py
+++ b/src/cloudflare/resources/ai_gateway/datasets.py
@@ -7,7 +7,7 @@
import httpx
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ..._utils import maybe_transform, async_maybe_transform
+from ..._utils import path_template, maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -53,7 +53,7 @@ def create(
self,
gateway_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
enable: bool,
filters: Iterable[dataset_create_params.Filter],
name: str,
@@ -65,7 +65,7 @@ def create(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> DatasetCreateResponse:
"""
- Create a new Dataset
+ Creates a new AI Gateway.
Args:
gateway_id: gateway id
@@ -78,12 +78,18 @@ def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
raise ValueError(f"Expected a non-empty value for `gateway_id` but received {gateway_id!r}")
return self._post(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/datasets",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/datasets",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ ),
body=maybe_transform(
{
"enable": enable,
@@ -106,7 +112,7 @@ def update(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
gateway_id: str,
enable: bool,
filters: Iterable[dataset_update_params.Filter],
@@ -119,7 +125,7 @@ def update(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> DatasetUpdateResponse:
"""
- Update a Dataset
+ Updates an existing AI Gateway dataset.
Args:
gateway_id: gateway id
@@ -132,6 +138,8 @@ def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
@@ -139,7 +147,12 @@ def update(
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._put(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/datasets/{id}",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/datasets/{id}",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ id=id,
+ ),
body=maybe_transform(
{
"enable": enable,
@@ -162,7 +175,7 @@ def list(
self,
gateway_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
enable: bool | Omit = omit,
name: str | Omit = omit,
page: int | Omit = omit,
@@ -176,7 +189,7 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncV4PagePaginationArray[DatasetListResponse]:
"""
- List Datasets
+ Lists all AI Gateway evaluator types configured for the account.
Args:
gateway_id: gateway id
@@ -191,12 +204,18 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
raise ValueError(f"Expected a non-empty value for `gateway_id` but received {gateway_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/datasets",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/datasets",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ ),
page=SyncV4PagePaginationArray[DatasetListResponse],
options=make_request_options(
extra_headers=extra_headers,
@@ -221,7 +240,7 @@ def delete(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
gateway_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -231,7 +250,7 @@ def delete(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> DatasetDeleteResponse:
"""
- Delete a Dataset
+ Deletes an AI Gateway dataset.
Args:
gateway_id: gateway id
@@ -244,6 +263,8 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
@@ -251,7 +272,12 @@ def delete(
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._delete(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/datasets/{id}",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/datasets/{id}",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ id=id,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -266,7 +292,7 @@ def get(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
gateway_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -276,7 +302,7 @@ def get(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> DatasetGetResponse:
"""
- Fetch a Dataset
+ Retrieves details for a specific AI Gateway dataset.
Args:
gateway_id: gateway id
@@ -289,6 +315,8 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
@@ -296,7 +324,12 @@ def get(
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._get(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/datasets/{id}",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/datasets/{id}",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ id=id,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -332,7 +365,7 @@ async def create(
self,
gateway_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
enable: bool,
filters: Iterable[dataset_create_params.Filter],
name: str,
@@ -344,7 +377,7 @@ async def create(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> DatasetCreateResponse:
"""
- Create a new Dataset
+ Creates a new AI Gateway.
Args:
gateway_id: gateway id
@@ -357,12 +390,18 @@ async def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
raise ValueError(f"Expected a non-empty value for `gateway_id` but received {gateway_id!r}")
return await self._post(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/datasets",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/datasets",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ ),
body=await async_maybe_transform(
{
"enable": enable,
@@ -385,7 +424,7 @@ async def update(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
gateway_id: str,
enable: bool,
filters: Iterable[dataset_update_params.Filter],
@@ -398,7 +437,7 @@ async def update(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> DatasetUpdateResponse:
"""
- Update a Dataset
+ Updates an existing AI Gateway dataset.
Args:
gateway_id: gateway id
@@ -411,6 +450,8 @@ async def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
@@ -418,7 +459,12 @@ async def update(
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return await self._put(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/datasets/{id}",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/datasets/{id}",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ id=id,
+ ),
body=await async_maybe_transform(
{
"enable": enable,
@@ -441,7 +487,7 @@ def list(
self,
gateway_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
enable: bool | Omit = omit,
name: str | Omit = omit,
page: int | Omit = omit,
@@ -455,7 +501,7 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[DatasetListResponse, AsyncV4PagePaginationArray[DatasetListResponse]]:
"""
- List Datasets
+ Lists all AI Gateway evaluator types configured for the account.
Args:
gateway_id: gateway id
@@ -470,12 +516,18 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
raise ValueError(f"Expected a non-empty value for `gateway_id` but received {gateway_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/datasets",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/datasets",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ ),
page=AsyncV4PagePaginationArray[DatasetListResponse],
options=make_request_options(
extra_headers=extra_headers,
@@ -500,7 +552,7 @@ async def delete(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
gateway_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -510,7 +562,7 @@ async def delete(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> DatasetDeleteResponse:
"""
- Delete a Dataset
+ Deletes an AI Gateway dataset.
Args:
gateway_id: gateway id
@@ -523,6 +575,8 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
@@ -530,7 +584,12 @@ async def delete(
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return await self._delete(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/datasets/{id}",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/datasets/{id}",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ id=id,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -545,7 +604,7 @@ async def get(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
gateway_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -555,7 +614,7 @@ async def get(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> DatasetGetResponse:
"""
- Fetch a Dataset
+ Retrieves details for a specific AI Gateway dataset.
Args:
gateway_id: gateway id
@@ -568,6 +627,8 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
@@ -575,7 +636,12 @@ async def get(
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return await self._get(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/datasets/{id}",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/datasets/{id}",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ id=id,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/ai_gateway/dynamic_routing.py b/src/cloudflare/resources/ai_gateway/dynamic_routing.py
index 719f7e12ff7..3268cf04ed1 100644
--- a/src/cloudflare/resources/ai_gateway/dynamic_routing.py
+++ b/src/cloudflare/resources/ai_gateway/dynamic_routing.py
@@ -7,7 +7,7 @@
import httpx
from ..._types import Body, Query, Headers, NotGiven, not_given
-from ..._utils import maybe_transform, async_maybe_transform
+from ..._utils import path_template, maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -62,7 +62,7 @@ def create(
self,
gateway_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
elements: Iterable[dynamic_routing_create_params.Element],
name: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -84,12 +84,18 @@ def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
raise ValueError(f"Expected a non-empty value for `gateway_id` but received {gateway_id!r}")
return self._post(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ ),
body=maybe_transform(
{
"elements": elements,
@@ -111,7 +117,7 @@ def update(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
gateway_id: str,
name: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -133,6 +139,8 @@ def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
@@ -140,7 +148,12 @@ def update(
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._patch(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ id=id,
+ ),
body=maybe_transform({"name": name}, dynamic_routing_update_params.DynamicRoutingUpdateParams),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -152,7 +165,7 @@ def list(
self,
gateway_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -172,12 +185,18 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
raise ValueError(f"Expected a non-empty value for `gateway_id` but received {gateway_id!r}")
return self._get(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -188,7 +207,7 @@ def delete(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
gateway_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -209,6 +228,8 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
@@ -216,7 +237,12 @@ def delete(
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._delete(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ id=id,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -231,9 +257,8 @@ def create_deployment(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
gateway_id: str,
- comment: str,
version_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -254,6 +279,8 @@ def create_deployment(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
@@ -261,12 +288,14 @@ def create_deployment(
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._post(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/deployments",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/deployments",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ id=id,
+ ),
body=maybe_transform(
- {
- "comment": comment,
- "version_id": version_id,
- },
+ {"version_id": version_id},
dynamic_routing_create_deployment_params.DynamicRoutingCreateDeploymentParams,
),
options=make_request_options(
@@ -285,9 +314,8 @@ def create_version(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
gateway_id: str,
- comment: str,
elements: Iterable[dynamic_routing_create_version_params.Element],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -308,6 +336,8 @@ def create_version(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
@@ -315,13 +345,14 @@ def create_version(
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._post(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/versions",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/versions",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ id=id,
+ ),
body=maybe_transform(
- {
- "comment": comment,
- "elements": elements,
- },
- dynamic_routing_create_version_params.DynamicRoutingCreateVersionParams,
+ {"elements": elements}, dynamic_routing_create_version_params.DynamicRoutingCreateVersionParams
),
options=make_request_options(
extra_headers=extra_headers,
@@ -337,7 +368,7 @@ def get(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
gateway_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -358,6 +389,8 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
@@ -365,7 +398,12 @@ def get(
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._get(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ id=id,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -380,7 +418,7 @@ def get_version(
self,
version_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
gateway_id: str,
id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -402,6 +440,8 @@ def get_version(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
@@ -411,7 +451,13 @@ def get_version(
if not version_id:
raise ValueError(f"Expected a non-empty value for `version_id` but received {version_id!r}")
return self._get(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/versions/{version_id}",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/versions/{version_id}",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ id=id,
+ version_id=version_id,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -426,7 +472,7 @@ def list_deployments(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
gateway_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -447,6 +493,8 @@ def list_deployments(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
@@ -454,7 +502,12 @@ def list_deployments(
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._get(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/deployments",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/deployments",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ id=id,
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -465,7 +518,7 @@ def list_versions(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
gateway_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -486,6 +539,8 @@ def list_versions(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
@@ -493,7 +548,12 @@ def list_versions(
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._get(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/versions",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/versions",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ id=id,
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -525,7 +585,7 @@ async def create(
self,
gateway_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
elements: Iterable[dynamic_routing_create_params.Element],
name: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -547,12 +607,18 @@ async def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
raise ValueError(f"Expected a non-empty value for `gateway_id` but received {gateway_id!r}")
return await self._post(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ ),
body=await async_maybe_transform(
{
"elements": elements,
@@ -574,7 +640,7 @@ async def update(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
gateway_id: str,
name: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -596,6 +662,8 @@ async def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
@@ -603,7 +671,12 @@ async def update(
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return await self._patch(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ id=id,
+ ),
body=await async_maybe_transform({"name": name}, dynamic_routing_update_params.DynamicRoutingUpdateParams),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -615,7 +688,7 @@ async def list(
self,
gateway_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -635,12 +708,18 @@ async def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
raise ValueError(f"Expected a non-empty value for `gateway_id` but received {gateway_id!r}")
return await self._get(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -651,7 +730,7 @@ async def delete(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
gateway_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -672,6 +751,8 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
@@ -679,7 +760,12 @@ async def delete(
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return await self._delete(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ id=id,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -694,9 +780,8 @@ async def create_deployment(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
gateway_id: str,
- comment: str,
version_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -717,6 +802,8 @@ async def create_deployment(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
@@ -724,12 +811,14 @@ async def create_deployment(
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return await self._post(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/deployments",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/deployments",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ id=id,
+ ),
body=await async_maybe_transform(
- {
- "comment": comment,
- "version_id": version_id,
- },
+ {"version_id": version_id},
dynamic_routing_create_deployment_params.DynamicRoutingCreateDeploymentParams,
),
options=make_request_options(
@@ -748,9 +837,8 @@ async def create_version(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
gateway_id: str,
- comment: str,
elements: Iterable[dynamic_routing_create_version_params.Element],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -771,6 +859,8 @@ async def create_version(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
@@ -778,13 +868,14 @@ async def create_version(
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return await self._post(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/versions",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/versions",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ id=id,
+ ),
body=await async_maybe_transform(
- {
- "comment": comment,
- "elements": elements,
- },
- dynamic_routing_create_version_params.DynamicRoutingCreateVersionParams,
+ {"elements": elements}, dynamic_routing_create_version_params.DynamicRoutingCreateVersionParams
),
options=make_request_options(
extra_headers=extra_headers,
@@ -800,7 +891,7 @@ async def get(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
gateway_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -821,6 +912,8 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
@@ -828,7 +921,12 @@ async def get(
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return await self._get(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ id=id,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -843,7 +941,7 @@ async def get_version(
self,
version_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
gateway_id: str,
id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -865,6 +963,8 @@ async def get_version(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
@@ -874,7 +974,13 @@ async def get_version(
if not version_id:
raise ValueError(f"Expected a non-empty value for `version_id` but received {version_id!r}")
return await self._get(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/versions/{version_id}",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/versions/{version_id}",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ id=id,
+ version_id=version_id,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -889,7 +995,7 @@ async def list_deployments(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
gateway_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -910,6 +1016,8 @@ async def list_deployments(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
@@ -917,7 +1025,12 @@ async def list_deployments(
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return await self._get(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/deployments",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/deployments",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ id=id,
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -928,7 +1041,7 @@ async def list_versions(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
gateway_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -949,6 +1062,8 @@ async def list_versions(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
@@ -956,7 +1071,12 @@ async def list_versions(
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return await self._get(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/versions",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/versions",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ id=id,
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
diff --git a/src/cloudflare/resources/ai_gateway/evaluation_types.py b/src/cloudflare/resources/ai_gateway/evaluation_types.py
index ed06314835d..17be00d592a 100644
--- a/src/cloudflare/resources/ai_gateway/evaluation_types.py
+++ b/src/cloudflare/resources/ai_gateway/evaluation_types.py
@@ -7,7 +7,7 @@
import httpx
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ..._utils import maybe_transform
+from ..._utils import path_template, maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -47,7 +47,7 @@ def with_streaming_response(self) -> EvaluationTypesResourceWithStreamingRespons
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
order_by: str | Omit = omit,
order_by_direction: Literal["asc", "desc"] | Omit = omit,
page: int | Omit = omit,
@@ -71,10 +71,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/ai-gateway/evaluation-types",
+ path_template("/accounts/{account_id}/ai-gateway/evaluation-types", account_id=account_id),
page=SyncV4PagePaginationArray[EvaluationTypeListResponse],
options=make_request_options(
extra_headers=extra_headers,
@@ -118,7 +120,7 @@ def with_streaming_response(self) -> AsyncEvaluationTypesResourceWithStreamingRe
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
order_by: str | Omit = omit,
order_by_direction: Literal["asc", "desc"] | Omit = omit,
page: int | Omit = omit,
@@ -142,10 +144,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/ai-gateway/evaluation-types",
+ path_template("/accounts/{account_id}/ai-gateway/evaluation-types", account_id=account_id),
page=AsyncV4PagePaginationArray[EvaluationTypeListResponse],
options=make_request_options(
extra_headers=extra_headers,
diff --git a/src/cloudflare/resources/ai_gateway/evaluations.py b/src/cloudflare/resources/ai_gateway/evaluations.py
index e3d9fd87309..26b1497345b 100644
--- a/src/cloudflare/resources/ai_gateway/evaluations.py
+++ b/src/cloudflare/resources/ai_gateway/evaluations.py
@@ -7,7 +7,7 @@
import httpx
from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
-from ..._utils import maybe_transform, async_maybe_transform
+from ..._utils import path_template, maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -52,7 +52,7 @@ def create(
self,
gateway_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
dataset_ids: SequenceNotStr[str],
evaluation_type_ids: SequenceNotStr[str],
name: str,
@@ -64,7 +64,7 @@ def create(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> EvaluationCreateResponse:
"""
- Create a new Evaluation
+ Creates a new AI Gateway.
Args:
gateway_id: gateway id
@@ -77,12 +77,18 @@ def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
raise ValueError(f"Expected a non-empty value for `gateway_id` but received {gateway_id!r}")
return self._post(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/evaluations",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/evaluations",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ ),
body=maybe_transform(
{
"dataset_ids": dataset_ids,
@@ -105,7 +111,7 @@ def list(
self,
gateway_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
name: str | Omit = omit,
page: int | Omit = omit,
per_page: int | Omit = omit,
@@ -119,7 +125,7 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncV4PagePaginationArray[EvaluationListResponse]:
"""
- List Evaluations
+ Lists all AI Gateway evaluator types configured for the account.
Args:
gateway_id: gateway id
@@ -134,12 +140,18 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
raise ValueError(f"Expected a non-empty value for `gateway_id` but received {gateway_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/evaluations",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/evaluations",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ ),
page=SyncV4PagePaginationArray[EvaluationListResponse],
options=make_request_options(
extra_headers=extra_headers,
@@ -164,7 +176,7 @@ def delete(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
gateway_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -174,7 +186,7 @@ def delete(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> EvaluationDeleteResponse:
"""
- Delete a Evaluation
+ Deletes an AI Gateway dataset.
Args:
gateway_id: gateway id
@@ -187,6 +199,8 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
@@ -194,7 +208,12 @@ def delete(
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._delete(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/evaluations/{id}",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/evaluations/{id}",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ id=id,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -209,7 +228,7 @@ def get(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
gateway_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -219,7 +238,7 @@ def get(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> EvaluationGetResponse:
"""
- Fetch a Evaluation
+ Retrieves details for a specific AI Gateway dataset.
Args:
gateway_id: gateway id
@@ -232,6 +251,8 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
@@ -239,7 +260,12 @@ def get(
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._get(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/evaluations/{id}",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/evaluations/{id}",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ id=id,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -275,7 +301,7 @@ async def create(
self,
gateway_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
dataset_ids: SequenceNotStr[str],
evaluation_type_ids: SequenceNotStr[str],
name: str,
@@ -287,7 +313,7 @@ async def create(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> EvaluationCreateResponse:
"""
- Create a new Evaluation
+ Creates a new AI Gateway.
Args:
gateway_id: gateway id
@@ -300,12 +326,18 @@ async def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
raise ValueError(f"Expected a non-empty value for `gateway_id` but received {gateway_id!r}")
return await self._post(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/evaluations",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/evaluations",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ ),
body=await async_maybe_transform(
{
"dataset_ids": dataset_ids,
@@ -328,7 +360,7 @@ def list(
self,
gateway_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
name: str | Omit = omit,
page: int | Omit = omit,
per_page: int | Omit = omit,
@@ -342,7 +374,7 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[EvaluationListResponse, AsyncV4PagePaginationArray[EvaluationListResponse]]:
"""
- List Evaluations
+ Lists all AI Gateway evaluator types configured for the account.
Args:
gateway_id: gateway id
@@ -357,12 +389,18 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
raise ValueError(f"Expected a non-empty value for `gateway_id` but received {gateway_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/evaluations",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/evaluations",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ ),
page=AsyncV4PagePaginationArray[EvaluationListResponse],
options=make_request_options(
extra_headers=extra_headers,
@@ -387,7 +425,7 @@ async def delete(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
gateway_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -397,7 +435,7 @@ async def delete(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> EvaluationDeleteResponse:
"""
- Delete a Evaluation
+ Deletes an AI Gateway dataset.
Args:
gateway_id: gateway id
@@ -410,6 +448,8 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
@@ -417,7 +457,12 @@ async def delete(
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return await self._delete(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/evaluations/{id}",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/evaluations/{id}",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ id=id,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -432,7 +477,7 @@ async def get(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
gateway_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -442,7 +487,7 @@ async def get(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> EvaluationGetResponse:
"""
- Fetch a Evaluation
+ Retrieves details for a specific AI Gateway dataset.
Args:
gateway_id: gateway id
@@ -455,6 +500,8 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
@@ -462,7 +509,12 @@ async def get(
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return await self._get(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/evaluations/{id}",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/evaluations/{id}",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ id=id,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/ai_gateway/logs.py b/src/cloudflare/resources/ai_gateway/logs.py
index 8518d36781c..32c18a9f5f4 100644
--- a/src/cloudflare/resources/ai_gateway/logs.py
+++ b/src/cloudflare/resources/ai_gateway/logs.py
@@ -9,7 +9,7 @@
import httpx
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ..._utils import maybe_transform, async_maybe_transform
+from ..._utils import path_template, maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -53,7 +53,7 @@ def list(
self,
gateway_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
cached: bool | Omit = omit,
direction: Literal["asc", "desc"] | Omit = omit,
end_date: Union[str, datetime] | Omit = omit,
@@ -103,12 +103,18 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
raise ValueError(f"Expected a non-empty value for `gateway_id` but received {gateway_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ ),
page=SyncV4PagePaginationArray[LogListResponse],
options=make_request_options(
extra_headers=extra_headers,
@@ -156,7 +162,7 @@ def delete(
self,
gateway_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
filters: Iterable[log_delete_params.Filter] | Omit = omit,
limit: int | Omit = omit,
order_by: Literal[
@@ -195,12 +201,18 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
raise ValueError(f"Expected a non-empty value for `gateway_id` but received {gateway_id!r}")
return self._delete(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -223,7 +235,7 @@ def edit(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
gateway_id: str,
feedback: Optional[float] | Omit = omit,
metadata: Optional[Dict[str, Union[str, float, bool]]] | Omit = omit,
@@ -236,7 +248,7 @@ def edit(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
- Patch Gateway Log
+ Updates metadata for an AI Gateway log entry.
Args:
gateway_id: gateway id
@@ -249,6 +261,8 @@ def edit(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
@@ -256,7 +270,12 @@ def edit(
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._patch(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs/{id}",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs/{id}",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ id=id,
+ ),
body=maybe_transform(
{
"feedback": feedback,
@@ -279,7 +298,7 @@ def get(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
gateway_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -289,7 +308,7 @@ def get(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> LogGetResponse:
"""
- Get Gateway Log Detail
+ Retrieves detailed information for a specific AI Gateway log entry.
Args:
gateway_id: gateway id
@@ -302,6 +321,8 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
@@ -309,7 +330,12 @@ def get(
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._get(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs/{id}",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs/{id}",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ id=id,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -324,7 +350,7 @@ def request(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
gateway_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -334,7 +360,7 @@ def request(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
- Get Gateway Log Request
+ Retrieves the original request payload for an AI Gateway log entry.
Args:
gateway_id: gateway id
@@ -347,6 +373,8 @@ def request(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
@@ -354,7 +382,12 @@ def request(
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._get(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs/{id}/request",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs/{id}/request",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ id=id,
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -365,7 +398,7 @@ def response(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
gateway_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -375,7 +408,7 @@ def response(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
- Get Gateway Log Response
+ Retrieves the response payload for an AI Gateway log entry.
Args:
gateway_id: gateway id
@@ -388,6 +421,8 @@ def response(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
@@ -395,7 +430,12 @@ def response(
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._get(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs/{id}/response",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs/{id}/response",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ id=id,
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -427,7 +467,7 @@ def list(
self,
gateway_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
cached: bool | Omit = omit,
direction: Literal["asc", "desc"] | Omit = omit,
end_date: Union[str, datetime] | Omit = omit,
@@ -477,12 +517,18 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
raise ValueError(f"Expected a non-empty value for `gateway_id` but received {gateway_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ ),
page=AsyncV4PagePaginationArray[LogListResponse],
options=make_request_options(
extra_headers=extra_headers,
@@ -530,7 +576,7 @@ async def delete(
self,
gateway_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
filters: Iterable[log_delete_params.Filter] | Omit = omit,
limit: int | Omit = omit,
order_by: Literal[
@@ -569,12 +615,18 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
raise ValueError(f"Expected a non-empty value for `gateway_id` but received {gateway_id!r}")
return await self._delete(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -597,7 +649,7 @@ async def edit(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
gateway_id: str,
feedback: Optional[float] | Omit = omit,
metadata: Optional[Dict[str, Union[str, float, bool]]] | Omit = omit,
@@ -610,7 +662,7 @@ async def edit(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
- Patch Gateway Log
+ Updates metadata for an AI Gateway log entry.
Args:
gateway_id: gateway id
@@ -623,6 +675,8 @@ async def edit(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
@@ -630,7 +684,12 @@ async def edit(
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return await self._patch(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs/{id}",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs/{id}",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ id=id,
+ ),
body=await async_maybe_transform(
{
"feedback": feedback,
@@ -653,7 +712,7 @@ async def get(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
gateway_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -663,7 +722,7 @@ async def get(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> LogGetResponse:
"""
- Get Gateway Log Detail
+ Retrieves detailed information for a specific AI Gateway log entry.
Args:
gateway_id: gateway id
@@ -676,6 +735,8 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
@@ -683,7 +744,12 @@ async def get(
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return await self._get(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs/{id}",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs/{id}",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ id=id,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -698,7 +764,7 @@ async def request(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
gateway_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -708,7 +774,7 @@ async def request(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
- Get Gateway Log Request
+ Retrieves the original request payload for an AI Gateway log entry.
Args:
gateway_id: gateway id
@@ -721,6 +787,8 @@ async def request(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
@@ -728,7 +796,12 @@ async def request(
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return await self._get(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs/{id}/request",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs/{id}/request",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ id=id,
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -739,7 +812,7 @@ async def response(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
gateway_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -749,7 +822,7 @@ async def response(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
- Get Gateway Log Response
+ Retrieves the response payload for an AI Gateway log entry.
Args:
gateway_id: gateway id
@@ -762,6 +835,8 @@ async def response(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
@@ -769,7 +844,12 @@ async def response(
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return await self._get(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs/{id}/response",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs/{id}/response",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ id=id,
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
diff --git a/src/cloudflare/resources/ai_gateway/provider_configs.py b/src/cloudflare/resources/ai_gateway/provider_configs.py
index 60c7fc5f891..c0af4ebe77a 100644
--- a/src/cloudflare/resources/ai_gateway/provider_configs.py
+++ b/src/cloudflare/resources/ai_gateway/provider_configs.py
@@ -7,7 +7,7 @@
import httpx
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ..._utils import maybe_transform, async_maybe_transform
+from ..._utils import path_template, maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -50,7 +50,7 @@ def create(
self,
gateway_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
alias: str,
default_config: bool,
provider_slug: str,
@@ -66,7 +66,7 @@ def create(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> ProviderConfigCreateResponse:
"""
- Create a new Provider Configs
+ Creates a new AI Gateway.
Args:
gateway_id: gateway id
@@ -79,12 +79,18 @@ def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
raise ValueError(f"Expected a non-empty value for `gateway_id` but received {gateway_id!r}")
return self._post(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/provider_configs",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/provider_configs",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ ),
body=maybe_transform(
{
"alias": alias,
@@ -111,7 +117,7 @@ def list(
self,
gateway_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
page: int | Omit = omit,
per_page: int | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -122,7 +128,7 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncV4PagePaginationArray[ProviderConfigListResponse]:
"""
- List Provider Configs
+ Lists all AI Gateway evaluator types configured for the account.
Args:
gateway_id: gateway id
@@ -135,12 +141,18 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
raise ValueError(f"Expected a non-empty value for `gateway_id` but received {gateway_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/provider_configs",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/provider_configs",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ ),
page=SyncV4PagePaginationArray[ProviderConfigListResponse],
options=make_request_options(
extra_headers=extra_headers,
@@ -183,7 +195,7 @@ async def create(
self,
gateway_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
alias: str,
default_config: bool,
provider_slug: str,
@@ -199,7 +211,7 @@ async def create(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> ProviderConfigCreateResponse:
"""
- Create a new Provider Configs
+ Creates a new AI Gateway.
Args:
gateway_id: gateway id
@@ -212,12 +224,18 @@ async def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
raise ValueError(f"Expected a non-empty value for `gateway_id` but received {gateway_id!r}")
return await self._post(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/provider_configs",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/provider_configs",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ ),
body=await async_maybe_transform(
{
"alias": alias,
@@ -244,7 +262,7 @@ def list(
self,
gateway_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
page: int | Omit = omit,
per_page: int | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -255,7 +273,7 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[ProviderConfigListResponse, AsyncV4PagePaginationArray[ProviderConfigListResponse]]:
"""
- List Provider Configs
+ Lists all AI Gateway evaluator types configured for the account.
Args:
gateway_id: gateway id
@@ -268,12 +286,18 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
raise ValueError(f"Expected a non-empty value for `gateway_id` but received {gateway_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/provider_configs",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/provider_configs",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ ),
page=AsyncV4PagePaginationArray[ProviderConfigListResponse],
options=make_request_options(
extra_headers=extra_headers,
diff --git a/src/cloudflare/resources/ai_gateway/urls.py b/src/cloudflare/resources/ai_gateway/urls.py
index 8f660faa164..50c6c57c708 100644
--- a/src/cloudflare/resources/ai_gateway/urls.py
+++ b/src/cloudflare/resources/ai_gateway/urls.py
@@ -7,6 +7,7 @@
import httpx
from ..._types import Body, Query, Headers, NotGiven, not_given
+from ..._utils import path_template
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -46,7 +47,7 @@ def get(
self,
provider: str,
*,
- account_id: str,
+ account_id: str | None = None,
gateway_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -56,7 +57,7 @@ def get(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> str:
"""
- Get Gateway URL
+ Retrieves the endpoint URL for an AI Gateway.
Args:
gateway_id: gateway id
@@ -69,6 +70,8 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
@@ -76,7 +79,12 @@ def get(
if not provider:
raise ValueError(f"Expected a non-empty value for `provider` but received {provider!r}")
return self._get(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/url/{provider}",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/url/{provider}",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ provider=provider,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -112,7 +120,7 @@ async def get(
self,
provider: str,
*,
- account_id: str,
+ account_id: str | None = None,
gateway_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -122,7 +130,7 @@ async def get(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> str:
"""
- Get Gateway URL
+ Retrieves the endpoint URL for an AI Gateway.
Args:
gateway_id: gateway id
@@ -135,6 +143,8 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not gateway_id:
@@ -142,7 +152,12 @@ async def get(
if not provider:
raise ValueError(f"Expected a non-empty value for `provider` but received {provider!r}")
return await self._get(
- f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/url/{provider}",
+ path_template(
+ "/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/url/{provider}",
+ account_id=account_id,
+ gateway_id=gateway_id,
+ provider=provider,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/aisearch/__init__.py b/src/cloudflare/resources/aisearch/__init__.py
index e7d15dd59ad..1929faa11e4 100644
--- a/src/cloudflare/resources/aisearch/__init__.py
+++ b/src/cloudflare/resources/aisearch/__init__.py
@@ -24,8 +24,22 @@
InstancesResourceWithStreamingResponse,
AsyncInstancesResourceWithStreamingResponse,
)
+from .namespaces import (
+ NamespacesResource,
+ AsyncNamespacesResource,
+ NamespacesResourceWithRawResponse,
+ AsyncNamespacesResourceWithRawResponse,
+ NamespacesResourceWithStreamingResponse,
+ AsyncNamespacesResourceWithStreamingResponse,
+)
__all__ = [
+ "NamespacesResource",
+ "AsyncNamespacesResource",
+ "NamespacesResourceWithRawResponse",
+ "AsyncNamespacesResourceWithRawResponse",
+ "NamespacesResourceWithStreamingResponse",
+ "AsyncNamespacesResourceWithStreamingResponse",
"InstancesResource",
"AsyncInstancesResource",
"InstancesResourceWithRawResponse",
diff --git a/src/cloudflare/resources/aisearch/aisearch.py b/src/cloudflare/resources/aisearch/aisearch.py
index 483739a1224..a77e3929dbf 100644
--- a/src/cloudflare/resources/aisearch/aisearch.py
+++ b/src/cloudflare/resources/aisearch/aisearch.py
@@ -20,11 +20,23 @@
InstancesResourceWithStreamingResponse,
AsyncInstancesResourceWithStreamingResponse,
)
+from .namespaces.namespaces import (
+ NamespacesResource,
+ AsyncNamespacesResource,
+ NamespacesResourceWithRawResponse,
+ AsyncNamespacesResourceWithRawResponse,
+ NamespacesResourceWithStreamingResponse,
+ AsyncNamespacesResourceWithStreamingResponse,
+)
__all__ = ["AISearchResource", "AsyncAISearchResource"]
class AISearchResource(SyncAPIResource):
+ @cached_property
+ def namespaces(self) -> NamespacesResource:
+ return NamespacesResource(self._client)
+
@cached_property
def instances(self) -> InstancesResource:
return InstancesResource(self._client)
@@ -54,6 +66,10 @@ def with_streaming_response(self) -> AISearchResourceWithStreamingResponse:
class AsyncAISearchResource(AsyncAPIResource):
+ @cached_property
+ def namespaces(self) -> AsyncNamespacesResource:
+ return AsyncNamespacesResource(self._client)
+
@cached_property
def instances(self) -> AsyncInstancesResource:
return AsyncInstancesResource(self._client)
@@ -86,6 +102,10 @@ class AISearchResourceWithRawResponse:
def __init__(self, aisearch: AISearchResource) -> None:
self._aisearch = aisearch
+ @cached_property
+ def namespaces(self) -> NamespacesResourceWithRawResponse:
+ return NamespacesResourceWithRawResponse(self._aisearch.namespaces)
+
@cached_property
def instances(self) -> InstancesResourceWithRawResponse:
return InstancesResourceWithRawResponse(self._aisearch.instances)
@@ -99,6 +119,10 @@ class AsyncAISearchResourceWithRawResponse:
def __init__(self, aisearch: AsyncAISearchResource) -> None:
self._aisearch = aisearch
+ @cached_property
+ def namespaces(self) -> AsyncNamespacesResourceWithRawResponse:
+ return AsyncNamespacesResourceWithRawResponse(self._aisearch.namespaces)
+
@cached_property
def instances(self) -> AsyncInstancesResourceWithRawResponse:
return AsyncInstancesResourceWithRawResponse(self._aisearch.instances)
@@ -112,6 +136,10 @@ class AISearchResourceWithStreamingResponse:
def __init__(self, aisearch: AISearchResource) -> None:
self._aisearch = aisearch
+ @cached_property
+ def namespaces(self) -> NamespacesResourceWithStreamingResponse:
+ return NamespacesResourceWithStreamingResponse(self._aisearch.namespaces)
+
@cached_property
def instances(self) -> InstancesResourceWithStreamingResponse:
return InstancesResourceWithStreamingResponse(self._aisearch.instances)
@@ -125,6 +153,10 @@ class AsyncAISearchResourceWithStreamingResponse:
def __init__(self, aisearch: AsyncAISearchResource) -> None:
self._aisearch = aisearch
+ @cached_property
+ def namespaces(self) -> AsyncNamespacesResourceWithStreamingResponse:
+ return AsyncNamespacesResourceWithStreamingResponse(self._aisearch.namespaces)
+
@cached_property
def instances(self) -> AsyncInstancesResourceWithStreamingResponse:
return AsyncInstancesResourceWithStreamingResponse(self._aisearch.instances)
diff --git a/src/cloudflare/resources/aisearch/api.md b/src/cloudflare/resources/aisearch/api.md
new file mode 100644
index 00000000000..f861fd17930
--- /dev/null
+++ b/src/cloudflare/resources/aisearch/api.md
@@ -0,0 +1,174 @@
+# AISearch
+
+## Namespaces
+
+Types:
+
+```python
+from cloudflare.types.aisearch import (
+ NamespaceCreateResponse,
+ NamespaceUpdateResponse,
+ NamespaceListResponse,
+ NamespaceChatCompletionsResponse,
+ NamespaceReadResponse,
+ NamespaceSearchResponse,
+)
+```
+
+Methods:
+
+- client.aisearch.namespaces.create(\*, account_id, \*\*params) -> NamespaceCreateResponse
+- client.aisearch.namespaces.update(name, \*, account_id, \*\*params) -> NamespaceUpdateResponse
+- client.aisearch.namespaces.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[NamespaceListResponse]
+- client.aisearch.namespaces.delete(name, \*, account_id) -> object
+- client.aisearch.namespaces.chat_completions(name, \*, account_id, \*\*params) -> NamespaceChatCompletionsResponse
+- client.aisearch.namespaces.read(name, \*, account_id) -> NamespaceReadResponse
+- client.aisearch.namespaces.search(name, \*, account_id, \*\*params) -> NamespaceSearchResponse
+
+### Instances
+
+Types:
+
+```python
+from cloudflare.types.aisearch.namespaces import (
+ InstanceCreateResponse,
+ InstanceUpdateResponse,
+ InstanceListResponse,
+ InstanceDeleteResponse,
+ InstanceChatCompletionsResponse,
+ InstanceReadResponse,
+ InstanceSearchResponse,
+ InstanceStatsResponse,
+)
+```
+
+Methods:
+
+- client.aisearch.namespaces.instances.create(name, \*, account_id, \*\*params) -> InstanceCreateResponse
+- client.aisearch.namespaces.instances.update(id, \*, account_id, name, \*\*params) -> InstanceUpdateResponse
+- client.aisearch.namespaces.instances.list(name, \*, account_id, \*\*params) -> SyncV4PagePaginationArray[InstanceListResponse]
+- client.aisearch.namespaces.instances.delete(id, \*, account_id, name) -> InstanceDeleteResponse
+- client.aisearch.namespaces.instances.chat_completions(id, \*, account_id, name, \*\*params) -> InstanceChatCompletionsResponse
+- client.aisearch.namespaces.instances.read(id, \*, account_id, name) -> InstanceReadResponse
+- client.aisearch.namespaces.instances.search(id, \*, account_id, name, \*\*params) -> InstanceSearchResponse
+- client.aisearch.namespaces.instances.stats(id, \*, account_id, name) -> InstanceStatsResponse
+
+#### Jobs
+
+Types:
+
+```python
+from cloudflare.types.aisearch.namespaces.instances import (
+ JobCreateResponse,
+ JobUpdateResponse,
+ JobListResponse,
+ JobGetResponse,
+ JobLogsResponse,
+)
+```
+
+Methods:
+
+- client.aisearch.namespaces.instances.jobs.create(id, \*, account_id, name, \*\*params) -> JobCreateResponse
+- client.aisearch.namespaces.instances.jobs.update(job_id, \*, account_id, name, id, \*\*params) -> JobUpdateResponse
+- client.aisearch.namespaces.instances.jobs.list(id, \*, account_id, name, \*\*params) -> SyncV4PagePaginationArray[JobListResponse]
+- client.aisearch.namespaces.instances.jobs.get(job_id, \*, account_id, name, id) -> JobGetResponse
+- client.aisearch.namespaces.instances.jobs.logs(job_id, \*, account_id, name, id, \*\*params) -> JobLogsResponse
+
+#### Items
+
+Types:
+
+```python
+from cloudflare.types.aisearch.namespaces.instances import (
+ ItemListResponse,
+ ItemDeleteResponse,
+ ItemChunksResponse,
+ ItemCreateOrUpdateResponse,
+ ItemGetResponse,
+ ItemLogsResponse,
+ ItemSyncResponse,
+ ItemUploadResponse,
+)
+```
+
+Methods:
+
+- client.aisearch.namespaces.instances.items.list(id, \*, account_id, name, \*\*params) -> SyncV4PagePaginationArray[ItemListResponse]
+- client.aisearch.namespaces.instances.items.delete(item_id, \*, account_id, name, id) -> ItemDeleteResponse
+- client.aisearch.namespaces.instances.items.chunks(item_id, \*, account_id, name, id, \*\*params) -> ItemChunksResponse
+- client.aisearch.namespaces.instances.items.create_or_update(id, \*, account_id, name, \*\*params) -> ItemCreateOrUpdateResponse
+- client.aisearch.namespaces.instances.items.download(item_id, \*, account_id, name, id) -> BinaryAPIResponse
+- client.aisearch.namespaces.instances.items.get(item_id, \*, account_id, name, id) -> ItemGetResponse
+- client.aisearch.namespaces.instances.items.logs(item_id, \*, account_id, name, id, \*\*params) -> ItemLogsResponse
+- client.aisearch.namespaces.instances.items.sync(item_id, \*, account_id, name, id, \*\*params) -> ItemSyncResponse
+- client.aisearch.namespaces.instances.items.upload(id, \*, account_id, name, \*\*params) -> ItemUploadResponse
+
+## Instances
+
+Types:
+
+```python
+from cloudflare.types.aisearch import (
+ InstanceCreateResponse,
+ InstanceUpdateResponse,
+ InstanceListResponse,
+ InstanceDeleteResponse,
+ InstanceChatCompletionsResponse,
+ InstanceReadResponse,
+ InstanceSearchResponse,
+ InstanceStatsResponse,
+)
+```
+
+Methods:
+
+- client.aisearch.instances.create(\*, account_id, \*\*params) -> InstanceCreateResponse
+- client.aisearch.instances.update(id, \*, account_id, \*\*params) -> InstanceUpdateResponse
+- client.aisearch.instances.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[InstanceListResponse]
+- client.aisearch.instances.delete(id, \*, account_id) -> InstanceDeleteResponse
+- client.aisearch.instances.chat_completions(id, \*, account_id, \*\*params) -> InstanceChatCompletionsResponse
+- client.aisearch.instances.read(id, \*, account_id) -> InstanceReadResponse
+- client.aisearch.instances.search(id, \*, account_id, \*\*params) -> InstanceSearchResponse
+- client.aisearch.instances.stats(id, \*, account_id) -> InstanceStatsResponse
+
+### Jobs
+
+Types:
+
+```python
+from cloudflare.types.aisearch.instances import (
+ JobCreateResponse,
+ JobListResponse,
+ JobGetResponse,
+ JobLogsResponse,
+)
+```
+
+Methods:
+
+- client.aisearch.instances.jobs.create(id, \*, account_id, \*\*params) -> JobCreateResponse
+- client.aisearch.instances.jobs.list(id, \*, account_id, \*\*params) -> SyncV4PagePaginationArray[JobListResponse]
+- client.aisearch.instances.jobs.get(job_id, \*, account_id, id) -> JobGetResponse
+- client.aisearch.instances.jobs.logs(job_id, \*, account_id, id, \*\*params) -> JobLogsResponse
+
+## Tokens
+
+Types:
+
+```python
+from cloudflare.types.aisearch import (
+ TokenCreateResponse,
+ TokenUpdateResponse,
+ TokenListResponse,
+ TokenReadResponse,
+)
+```
+
+Methods:
+
+- client.aisearch.tokens.create(\*, account_id, \*\*params) -> TokenCreateResponse
+- client.aisearch.tokens.update(id, \*, account_id, \*\*params) -> TokenUpdateResponse
+- client.aisearch.tokens.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[TokenListResponse]
+- client.aisearch.tokens.delete(id, \*, account_id) -> object
+- client.aisearch.tokens.read(id, \*, account_id) -> TokenReadResponse
diff --git a/src/cloudflare/resources/aisearch/instances/__init__.py b/src/cloudflare/resources/aisearch/instances/__init__.py
index bcd3fe82f43..f07262e470e 100644
--- a/src/cloudflare/resources/aisearch/instances/__init__.py
+++ b/src/cloudflare/resources/aisearch/instances/__init__.py
@@ -8,14 +8,6 @@
JobsResourceWithStreamingResponse,
AsyncJobsResourceWithStreamingResponse,
)
-from .items import (
- ItemsResource,
- AsyncItemsResource,
- ItemsResourceWithRawResponse,
- AsyncItemsResourceWithRawResponse,
- ItemsResourceWithStreamingResponse,
- AsyncItemsResourceWithStreamingResponse,
-)
from .instances import (
InstancesResource,
AsyncInstancesResource,
@@ -26,12 +18,6 @@
)
__all__ = [
- "ItemsResource",
- "AsyncItemsResource",
- "ItemsResourceWithRawResponse",
- "AsyncItemsResourceWithRawResponse",
- "ItemsResourceWithStreamingResponse",
- "AsyncItemsResourceWithStreamingResponse",
"JobsResource",
"AsyncJobsResource",
"JobsResourceWithRawResponse",
diff --git a/src/cloudflare/resources/aisearch/instances/instances.py b/src/cloudflare/resources/aisearch/instances/instances.py
index 44984f27f89..1f033a72cbc 100644
--- a/src/cloudflare/resources/aisearch/instances/instances.py
+++ b/src/cloudflare/resources/aisearch/instances/instances.py
@@ -2,7 +2,7 @@
from __future__ import annotations
-from typing import Type, Iterable, cast
+from typing import Type, Iterable, Optional, cast
from typing_extensions import Literal
import httpx
@@ -15,16 +15,8 @@
JobsResourceWithStreamingResponse,
AsyncJobsResourceWithStreamingResponse,
)
-from .items import (
- ItemsResource,
- AsyncItemsResource,
- ItemsResourceWithRawResponse,
- AsyncItemsResourceWithRawResponse,
- ItemsResourceWithStreamingResponse,
- AsyncItemsResourceWithStreamingResponse,
-)
from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ...._utils import maybe_transform, async_maybe_transform
+from ...._utils import path_template, maybe_transform, async_maybe_transform
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -56,10 +48,6 @@
class InstancesResource(SyncAPIResource):
- @cached_property
- def items(self) -> ItemsResource:
- return ItemsResource(self._client)
-
@cached_property
def jobs(self) -> JobsResource:
return JobsResource(self._client)
@@ -86,94 +74,117 @@ def with_streaming_response(self) -> InstancesResourceWithStreamingResponse:
def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
id: str,
- source: str,
- type: Literal["r2", "web-crawler"],
- ai_gateway_id: str | Omit = omit,
- aisearch_model: Literal[
- "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
- "@cf/meta/llama-3.1-8b-instruct-fast",
- "@cf/meta/llama-3.1-8b-instruct-fp8",
- "@cf/meta/llama-4-scout-17b-16e-instruct",
- "@cf/qwen/qwen3-30b-a3b-fp8",
- "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
- "@cf/moonshotai/kimi-k2-instruct",
- "anthropic/claude-3-7-sonnet",
- "anthropic/claude-sonnet-4",
- "anthropic/claude-opus-4",
- "anthropic/claude-3-5-haiku",
- "cerebras/qwen-3-235b-a22b-instruct",
- "cerebras/qwen-3-235b-a22b-thinking",
- "cerebras/llama-3.3-70b",
- "cerebras/llama-4-maverick-17b-128e-instruct",
- "cerebras/llama-4-scout-17b-16e-instruct",
- "cerebras/gpt-oss-120b",
- "google-ai-studio/gemini-2.5-flash",
- "google-ai-studio/gemini-2.5-pro",
- "grok/grok-4",
- "groq/llama-3.3-70b-versatile",
- "groq/llama-3.1-8b-instant",
- "openai/gpt-5",
- "openai/gpt-5-mini",
- "openai/gpt-5-nano",
- "",
+ ai_gateway_id: Optional[str] | Omit = omit,
+ aisearch_model: Optional[
+ Literal[
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
+ "@cf/zai-org/glm-4.7-flash",
+ "@cf/meta/llama-3.1-8b-instruct-fast",
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
+ "@cf/qwen/qwen3-30b-a3b-fp8",
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
+ "@cf/moonshotai/kimi-k2-instruct",
+ "@cf/google/gemma-3-12b-it",
+ "@cf/google/gemma-4-26b-a4b-it",
+ "@cf/moonshotai/kimi-k2.5",
+ "anthropic/claude-3-7-sonnet",
+ "anthropic/claude-sonnet-4",
+ "anthropic/claude-opus-4",
+ "anthropic/claude-3-5-haiku",
+ "cerebras/qwen-3-235b-a22b-instruct",
+ "cerebras/qwen-3-235b-a22b-thinking",
+ "cerebras/llama-3.3-70b",
+ "cerebras/llama-4-maverick-17b-128e-instruct",
+ "cerebras/llama-4-scout-17b-16e-instruct",
+ "cerebras/gpt-oss-120b",
+ "google-ai-studio/gemini-2.5-flash",
+ "google-ai-studio/gemini-2.5-pro",
+ "grok/grok-4",
+ "groq/llama-3.3-70b-versatile",
+ "groq/llama-3.1-8b-instant",
+ "openai/gpt-5",
+ "openai/gpt-5-mini",
+ "openai/gpt-5-nano",
+ "",
+ ]
]
| Omit = omit,
+ cache: bool | Omit = omit,
+ cache_threshold: Literal["super_strict_match", "close_enough", "flexible_friend", "anything_goes"]
+ | Omit = omit,
chunk: bool | Omit = omit,
chunk_overlap: int | Omit = omit,
chunk_size: int | Omit = omit,
custom_metadata: Iterable[instance_create_params.CustomMetadata] | Omit = omit,
- embedding_model: Literal[
- "@cf/qwen/qwen3-embedding-0.6b",
- "@cf/baai/bge-m3",
- "@cf/baai/bge-large-en-v1.5",
- "@cf/google/embeddinggemma-300m",
- "google-ai-studio/gemini-embedding-001",
- "openai/text-embedding-3-small",
- "openai/text-embedding-3-large",
- "",
+ embedding_model: Optional[
+ Literal[
+ "@cf/qwen/qwen3-embedding-0.6b",
+ "@cf/baai/bge-m3",
+ "@cf/baai/bge-large-en-v1.5",
+ "@cf/google/embeddinggemma-300m",
+ "google-ai-studio/gemini-embedding-001",
+ "google-ai-studio/gemini-embedding-2-preview",
+ "openai/text-embedding-3-small",
+ "openai/text-embedding-3-large",
+ "",
+ ]
]
| Omit = omit,
+ fusion_method: Literal["max", "rrf"] | Omit = omit,
hybrid_search_enabled: bool | Omit = omit,
+ index_method: instance_create_params.IndexMethod | Omit = omit,
+ indexing_options: Optional[instance_create_params.IndexingOptions] | Omit = omit,
max_num_results: int | Omit = omit,
metadata: instance_create_params.Metadata | Omit = omit,
public_endpoint_params: instance_create_params.PublicEndpointParams | Omit = omit,
reranking: bool | Omit = omit,
- reranking_model: Literal["@cf/baai/bge-reranker-base", ""] | Omit = omit,
- rewrite_model: Literal[
- "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
- "@cf/meta/llama-3.1-8b-instruct-fast",
- "@cf/meta/llama-3.1-8b-instruct-fp8",
- "@cf/meta/llama-4-scout-17b-16e-instruct",
- "@cf/qwen/qwen3-30b-a3b-fp8",
- "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
- "@cf/moonshotai/kimi-k2-instruct",
- "anthropic/claude-3-7-sonnet",
- "anthropic/claude-sonnet-4",
- "anthropic/claude-opus-4",
- "anthropic/claude-3-5-haiku",
- "cerebras/qwen-3-235b-a22b-instruct",
- "cerebras/qwen-3-235b-a22b-thinking",
- "cerebras/llama-3.3-70b",
- "cerebras/llama-4-maverick-17b-128e-instruct",
- "cerebras/llama-4-scout-17b-16e-instruct",
- "cerebras/gpt-oss-120b",
- "google-ai-studio/gemini-2.5-flash",
- "google-ai-studio/gemini-2.5-pro",
- "grok/grok-4",
- "groq/llama-3.3-70b-versatile",
- "groq/llama-3.1-8b-instant",
- "openai/gpt-5",
- "openai/gpt-5-mini",
- "openai/gpt-5-nano",
- "",
+ reranking_model: Optional[Literal["@cf/baai/bge-reranker-base", ""]] | Omit = omit,
+ retrieval_options: Optional[instance_create_params.RetrievalOptions] | Omit = omit,
+ rewrite_model: Optional[
+ Literal[
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
+ "@cf/zai-org/glm-4.7-flash",
+ "@cf/meta/llama-3.1-8b-instruct-fast",
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
+ "@cf/qwen/qwen3-30b-a3b-fp8",
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
+ "@cf/moonshotai/kimi-k2-instruct",
+ "@cf/google/gemma-3-12b-it",
+ "@cf/google/gemma-4-26b-a4b-it",
+ "@cf/moonshotai/kimi-k2.5",
+ "anthropic/claude-3-7-sonnet",
+ "anthropic/claude-sonnet-4",
+ "anthropic/claude-opus-4",
+ "anthropic/claude-3-5-haiku",
+ "cerebras/qwen-3-235b-a22b-instruct",
+ "cerebras/qwen-3-235b-a22b-thinking",
+ "cerebras/llama-3.3-70b",
+ "cerebras/llama-4-maverick-17b-128e-instruct",
+ "cerebras/llama-4-scout-17b-16e-instruct",
+ "cerebras/gpt-oss-120b",
+ "google-ai-studio/gemini-2.5-flash",
+ "google-ai-studio/gemini-2.5-pro",
+ "grok/grok-4",
+ "groq/llama-3.3-70b-versatile",
+ "groq/llama-3.1-8b-instant",
+ "openai/gpt-5",
+ "openai/gpt-5-mini",
+ "openai/gpt-5-nano",
+ "",
+ ]
]
| Omit = omit,
rewrite_query: bool | Omit = omit,
score_threshold: float | Omit = omit,
- source_params: instance_create_params.SourceParams | Omit = omit,
+ source: Optional[str] | Omit = omit,
+ source_params: Optional[instance_create_params.SourceParams] | Omit = omit,
+ sync_interval: Literal[900, 1800, 3600, 7200, 14400, 21600, 43200, 86400] | Omit = omit,
token_id: str | Omit = omit,
+ type: Optional[Literal["r2", "web-crawler"]] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -181,11 +192,20 @@ def create(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceCreateResponse:
- """
- Create new instances.
+ """Create a new instances.
Args:
- id: Use your AI Search ID.
+ id: AI Search instance ID.
+
+ Lowercase alphanumeric, hyphens, and underscores.
+
+ hybrid_search_enabled: Deprecated — use index_method instead.
+
+ index_method: Controls which storage backends are used during indexing. Defaults to
+ vector-only.
+
+ sync_interval: Interval between automatic syncs, in seconds. Allowed values: 900 (15min), 1800
+ (30min), 3600 (1h), 7200 (2h), 14400 (4h), 21600 (6h), 43200 (12h), 86400 (24h).
extra_headers: Send extra headers
@@ -195,33 +215,42 @@ def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._post(
- f"/accounts/{account_id}/ai-search/instances",
+ path_template("/accounts/{account_id}/ai-search/instances", account_id=account_id),
body=maybe_transform(
{
"id": id,
- "source": source,
- "type": type,
"ai_gateway_id": ai_gateway_id,
"aisearch_model": aisearch_model,
+ "cache": cache,
+ "cache_threshold": cache_threshold,
"chunk": chunk,
"chunk_overlap": chunk_overlap,
"chunk_size": chunk_size,
"custom_metadata": custom_metadata,
"embedding_model": embedding_model,
+ "fusion_method": fusion_method,
"hybrid_search_enabled": hybrid_search_enabled,
+ "index_method": index_method,
+ "indexing_options": indexing_options,
"max_num_results": max_num_results,
"metadata": metadata,
"public_endpoint_params": public_endpoint_params,
"reranking": reranking,
"reranking_model": reranking_model,
+ "retrieval_options": retrieval_options,
"rewrite_model": rewrite_model,
"rewrite_query": rewrite_query,
"score_threshold": score_threshold,
+ "source": source,
"source_params": source_params,
+ "sync_interval": sync_interval,
"token_id": token_id,
+ "type": type,
},
instance_create_params.InstanceCreateParams,
),
@@ -239,35 +268,41 @@ def update(
self,
id: str,
*,
- account_id: str,
- ai_gateway_id: str | Omit = omit,
- aisearch_model: Literal[
- "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
- "@cf/meta/llama-3.1-8b-instruct-fast",
- "@cf/meta/llama-3.1-8b-instruct-fp8",
- "@cf/meta/llama-4-scout-17b-16e-instruct",
- "@cf/qwen/qwen3-30b-a3b-fp8",
- "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
- "@cf/moonshotai/kimi-k2-instruct",
- "anthropic/claude-3-7-sonnet",
- "anthropic/claude-sonnet-4",
- "anthropic/claude-opus-4",
- "anthropic/claude-3-5-haiku",
- "cerebras/qwen-3-235b-a22b-instruct",
- "cerebras/qwen-3-235b-a22b-thinking",
- "cerebras/llama-3.3-70b",
- "cerebras/llama-4-maverick-17b-128e-instruct",
- "cerebras/llama-4-scout-17b-16e-instruct",
- "cerebras/gpt-oss-120b",
- "google-ai-studio/gemini-2.5-flash",
- "google-ai-studio/gemini-2.5-pro",
- "grok/grok-4",
- "groq/llama-3.3-70b-versatile",
- "groq/llama-3.1-8b-instant",
- "openai/gpt-5",
- "openai/gpt-5-mini",
- "openai/gpt-5-nano",
- "",
+ account_id: str | None = None,
+ ai_gateway_id: Optional[str] | Omit = omit,
+ aisearch_model: Optional[
+ Literal[
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
+ "@cf/zai-org/glm-4.7-flash",
+ "@cf/meta/llama-3.1-8b-instruct-fast",
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
+ "@cf/qwen/qwen3-30b-a3b-fp8",
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
+ "@cf/moonshotai/kimi-k2-instruct",
+ "@cf/google/gemma-3-12b-it",
+ "@cf/google/gemma-4-26b-a4b-it",
+ "@cf/moonshotai/kimi-k2.5",
+ "anthropic/claude-3-7-sonnet",
+ "anthropic/claude-sonnet-4",
+ "anthropic/claude-opus-4",
+ "anthropic/claude-3-5-haiku",
+ "cerebras/qwen-3-235b-a22b-instruct",
+ "cerebras/qwen-3-235b-a22b-thinking",
+ "cerebras/llama-3.3-70b",
+ "cerebras/llama-4-maverick-17b-128e-instruct",
+ "cerebras/llama-4-scout-17b-16e-instruct",
+ "cerebras/gpt-oss-120b",
+ "google-ai-studio/gemini-2.5-flash",
+ "google-ai-studio/gemini-2.5-pro",
+ "grok/grok-4",
+ "groq/llama-3.3-70b-versatile",
+ "groq/llama-3.1-8b-instant",
+ "openai/gpt-5",
+ "openai/gpt-5-mini",
+ "openai/gpt-5-nano",
+ "",
+ ]
]
| Omit = omit,
cache: bool | Omit = omit,
@@ -277,89 +312,108 @@ def update(
chunk_overlap: int | Omit = omit,
chunk_size: int | Omit = omit,
custom_metadata: Iterable[instance_update_params.CustomMetadata] | Omit = omit,
- embedding_model: Literal[
- "@cf/qwen/qwen3-embedding-0.6b",
- "@cf/baai/bge-m3",
- "@cf/baai/bge-large-en-v1.5",
- "@cf/google/embeddinggemma-300m",
- "google-ai-studio/gemini-embedding-001",
- "openai/text-embedding-3-small",
- "openai/text-embedding-3-large",
- "",
+ embedding_model: Optional[
+ Literal[
+ "@cf/qwen/qwen3-embedding-0.6b",
+ "@cf/baai/bge-m3",
+ "@cf/baai/bge-large-en-v1.5",
+ "@cf/google/embeddinggemma-300m",
+ "google-ai-studio/gemini-embedding-001",
+ "google-ai-studio/gemini-embedding-2-preview",
+ "openai/text-embedding-3-small",
+ "openai/text-embedding-3-large",
+ "",
+ ]
]
| Omit = omit,
- hybrid_search_enabled: bool | Omit = omit,
+ fusion_method: Literal["max", "rrf"] | Omit = omit,
+ index_method: instance_update_params.IndexMethod | Omit = omit,
+ indexing_options: Optional[instance_update_params.IndexingOptions] | Omit = omit,
max_num_results: int | Omit = omit,
metadata: instance_update_params.Metadata | Omit = omit,
paused: bool | Omit = omit,
public_endpoint_params: instance_update_params.PublicEndpointParams | Omit = omit,
reranking: bool | Omit = omit,
- reranking_model: Literal["@cf/baai/bge-reranker-base", ""] | Omit = omit,
- rewrite_model: Literal[
- "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
- "@cf/meta/llama-3.1-8b-instruct-fast",
- "@cf/meta/llama-3.1-8b-instruct-fp8",
- "@cf/meta/llama-4-scout-17b-16e-instruct",
- "@cf/qwen/qwen3-30b-a3b-fp8",
- "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
- "@cf/moonshotai/kimi-k2-instruct",
- "anthropic/claude-3-7-sonnet",
- "anthropic/claude-sonnet-4",
- "anthropic/claude-opus-4",
- "anthropic/claude-3-5-haiku",
- "cerebras/qwen-3-235b-a22b-instruct",
- "cerebras/qwen-3-235b-a22b-thinking",
- "cerebras/llama-3.3-70b",
- "cerebras/llama-4-maverick-17b-128e-instruct",
- "cerebras/llama-4-scout-17b-16e-instruct",
- "cerebras/gpt-oss-120b",
- "google-ai-studio/gemini-2.5-flash",
- "google-ai-studio/gemini-2.5-pro",
- "grok/grok-4",
- "groq/llama-3.3-70b-versatile",
- "groq/llama-3.1-8b-instant",
- "openai/gpt-5",
- "openai/gpt-5-mini",
- "openai/gpt-5-nano",
- "",
+ reranking_model: Optional[Literal["@cf/baai/bge-reranker-base", ""]] | Omit = omit,
+ retrieval_options: Optional[instance_update_params.RetrievalOptions] | Omit = omit,
+ rewrite_model: Optional[
+ Literal[
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
+ "@cf/zai-org/glm-4.7-flash",
+ "@cf/meta/llama-3.1-8b-instruct-fast",
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
+ "@cf/qwen/qwen3-30b-a3b-fp8",
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
+ "@cf/moonshotai/kimi-k2-instruct",
+ "@cf/google/gemma-3-12b-it",
+ "@cf/google/gemma-4-26b-a4b-it",
+ "@cf/moonshotai/kimi-k2.5",
+ "anthropic/claude-3-7-sonnet",
+ "anthropic/claude-sonnet-4",
+ "anthropic/claude-opus-4",
+ "anthropic/claude-3-5-haiku",
+ "cerebras/qwen-3-235b-a22b-instruct",
+ "cerebras/qwen-3-235b-a22b-thinking",
+ "cerebras/llama-3.3-70b",
+ "cerebras/llama-4-maverick-17b-128e-instruct",
+ "cerebras/llama-4-scout-17b-16e-instruct",
+ "cerebras/gpt-oss-120b",
+ "google-ai-studio/gemini-2.5-flash",
+ "google-ai-studio/gemini-2.5-pro",
+ "grok/grok-4",
+ "groq/llama-3.3-70b-versatile",
+ "groq/llama-3.1-8b-instant",
+ "openai/gpt-5",
+ "openai/gpt-5-mini",
+ "openai/gpt-5-nano",
+ "",
+ ]
]
| Omit = omit,
rewrite_query: bool | Omit = omit,
score_threshold: float | Omit = omit,
- source_params: instance_update_params.SourceParams | Omit = omit,
+ source_params: Optional[instance_update_params.SourceParams] | Omit = omit,
summarization: bool | Omit = omit,
- summarization_model: Literal[
- "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
- "@cf/meta/llama-3.1-8b-instruct-fast",
- "@cf/meta/llama-3.1-8b-instruct-fp8",
- "@cf/meta/llama-4-scout-17b-16e-instruct",
- "@cf/qwen/qwen3-30b-a3b-fp8",
- "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
- "@cf/moonshotai/kimi-k2-instruct",
- "anthropic/claude-3-7-sonnet",
- "anthropic/claude-sonnet-4",
- "anthropic/claude-opus-4",
- "anthropic/claude-3-5-haiku",
- "cerebras/qwen-3-235b-a22b-instruct",
- "cerebras/qwen-3-235b-a22b-thinking",
- "cerebras/llama-3.3-70b",
- "cerebras/llama-4-maverick-17b-128e-instruct",
- "cerebras/llama-4-scout-17b-16e-instruct",
- "cerebras/gpt-oss-120b",
- "google-ai-studio/gemini-2.5-flash",
- "google-ai-studio/gemini-2.5-pro",
- "grok/grok-4",
- "groq/llama-3.3-70b-versatile",
- "groq/llama-3.1-8b-instant",
- "openai/gpt-5",
- "openai/gpt-5-mini",
- "openai/gpt-5-nano",
- "",
+ summarization_model: Optional[
+ Literal[
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
+ "@cf/zai-org/glm-4.7-flash",
+ "@cf/meta/llama-3.1-8b-instruct-fast",
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
+ "@cf/qwen/qwen3-30b-a3b-fp8",
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
+ "@cf/moonshotai/kimi-k2-instruct",
+ "@cf/google/gemma-3-12b-it",
+ "@cf/google/gemma-4-26b-a4b-it",
+ "@cf/moonshotai/kimi-k2.5",
+ "anthropic/claude-3-7-sonnet",
+ "anthropic/claude-sonnet-4",
+ "anthropic/claude-opus-4",
+ "anthropic/claude-3-5-haiku",
+ "cerebras/qwen-3-235b-a22b-instruct",
+ "cerebras/qwen-3-235b-a22b-thinking",
+ "cerebras/llama-3.3-70b",
+ "cerebras/llama-4-maverick-17b-128e-instruct",
+ "cerebras/llama-4-scout-17b-16e-instruct",
+ "cerebras/gpt-oss-120b",
+ "google-ai-studio/gemini-2.5-flash",
+ "google-ai-studio/gemini-2.5-pro",
+ "grok/grok-4",
+ "groq/llama-3.3-70b-versatile",
+ "groq/llama-3.1-8b-instant",
+ "openai/gpt-5",
+ "openai/gpt-5-mini",
+ "openai/gpt-5-nano",
+ "",
+ ]
]
| Omit = omit,
- system_prompt_aisearch: str | Omit = omit,
- system_prompt_index_summarization: str | Omit = omit,
- system_prompt_rewrite_query: str | Omit = omit,
+ sync_interval: Literal[900, 1800, 3600, 7200, 14400, 21600, 43200, 86400] | Omit = omit,
+ system_prompt_aisearch: Optional[str] | Omit = omit,
+ system_prompt_index_summarization: Optional[str] | Omit = omit,
+ system_prompt_rewrite_query: Optional[str] | Omit = omit,
token_id: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -368,11 +422,18 @@ def update(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceUpdateResponse:
- """
- Update instances.
+ """Update instances.
Args:
- id: Use your AI Search ID.
+ id: AI Search instance ID.
+
+ Lowercase alphanumeric, hyphens, and underscores.
+
+ index_method: Controls which storage backends are used during indexing. Defaults to
+ vector-only.
+
+ sync_interval: Interval between automatic syncs, in seconds. Allowed values: 900 (15min), 1800
+ (30min), 3600 (1h), 7200 (2h), 14400 (4h), 21600 (6h), 43200 (12h), 86400 (24h).
extra_headers: Send extra headers
@@ -382,12 +443,14 @@ def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._put(
- f"/accounts/{account_id}/ai-search/instances/{id}",
+ path_template("/accounts/{account_id}/ai-search/instances/{id}", account_id=account_id, id=id),
body=maybe_transform(
{
"ai_gateway_id": ai_gateway_id,
@@ -399,19 +462,23 @@ def update(
"chunk_size": chunk_size,
"custom_metadata": custom_metadata,
"embedding_model": embedding_model,
- "hybrid_search_enabled": hybrid_search_enabled,
+ "fusion_method": fusion_method,
+ "index_method": index_method,
+ "indexing_options": indexing_options,
"max_num_results": max_num_results,
"metadata": metadata,
"paused": paused,
"public_endpoint_params": public_endpoint_params,
"reranking": reranking,
"reranking_model": reranking_model,
+ "retrieval_options": retrieval_options,
"rewrite_model": rewrite_model,
"rewrite_query": rewrite_query,
"score_threshold": score_threshold,
"source_params": source_params,
"summarization": summarization,
"summarization_model": summarization_model,
+ "sync_interval": sync_interval,
"system_prompt_aisearch": system_prompt_aisearch,
"system_prompt_index_summarization": system_prompt_index_summarization,
"system_prompt_rewrite_query": system_prompt_rewrite_query,
@@ -432,7 +499,10 @@ def update(
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
+ namespace: Optional[str] | Omit = omit,
+ order_by: Literal["created_at"] | Omit = omit,
+ order_by_direction: Literal["asc", "desc"] | Omit = omit,
page: int | Omit = omit,
per_page: int | Omit = omit,
search: str | Omit = omit,
@@ -447,6 +517,10 @@ def list(
List instances.
Args:
+ order_by: Order By Column Name
+
+ order_by_direction: Order By Direction
+
search: Search by id
extra_headers: Send extra headers
@@ -457,10 +531,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/ai-search/instances",
+ path_template("/accounts/{account_id}/ai-search/instances", account_id=account_id),
page=SyncV4PagePaginationArray[InstanceListResponse],
options=make_request_options(
extra_headers=extra_headers,
@@ -469,6 +545,9 @@ def list(
timeout=timeout,
query=maybe_transform(
{
+ "namespace": namespace,
+ "order_by": order_by,
+ "order_by_direction": order_by_direction,
"page": page,
"per_page": per_page,
"search": search,
@@ -483,7 +562,7 @@ def delete(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -491,11 +570,12 @@ def delete(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceDeleteResponse:
- """
- Delete instances.
+ """Delete instances.
Args:
- id: Use your AI Search ID.
+ id: AI Search instance ID.
+
+ Lowercase alphanumeric, hyphens, and underscores.
extra_headers: Send extra headers
@@ -505,12 +585,14 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._delete(
- f"/accounts/{account_id}/ai-search/instances/{id}",
+ path_template("/accounts/{account_id}/ai-search/instances/{id}", account_id=account_id, id=id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -525,17 +607,21 @@ def chat_completions(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
messages: Iterable[instance_chat_completions_params.Message],
aisearch_options: instance_chat_completions_params.AISearchOptions | Omit = omit,
model: Literal[
"@cf/meta/llama-3.3-70b-instruct-fp8-fast",
+ "@cf/zai-org/glm-4.7-flash",
"@cf/meta/llama-3.1-8b-instruct-fast",
"@cf/meta/llama-3.1-8b-instruct-fp8",
"@cf/meta/llama-4-scout-17b-16e-instruct",
"@cf/qwen/qwen3-30b-a3b-fp8",
"@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
"@cf/moonshotai/kimi-k2-instruct",
+ "@cf/google/gemma-3-12b-it",
+ "@cf/google/gemma-4-26b-a4b-it",
+ "@cf/moonshotai/kimi-k2.5",
"anthropic/claude-3-7-sonnet",
"anthropic/claude-sonnet-4",
"anthropic/claude-opus-4",
@@ -566,10 +652,11 @@ def chat_completions(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceChatCompletionsResponse:
"""
- Chat Completions
+ Performs a chat completion request against an AI Search instance, using indexed
+ content as context for generating responses.
Args:
- id: Use your AI Search ID.
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
extra_headers: Send extra headers
@@ -579,12 +666,16 @@ def chat_completions(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._post(
- f"/accounts/{account_id}/ai-search/instances/{id}/chat/completions",
+ path_template(
+ "/accounts/{account_id}/ai-search/instances/{id}/chat/completions", account_id=account_id, id=id
+ ),
body=maybe_transform(
{
"messages": messages,
@@ -604,7 +695,7 @@ def read(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -612,11 +703,12 @@ def read(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceReadResponse:
- """
- Read instances.
+ """Read instances.
Args:
- id: Use your AI Search ID.
+ id: AI Search instance ID.
+
+ Lowercase alphanumeric, hyphens, and underscores.
extra_headers: Send extra headers
@@ -626,12 +718,14 @@ def read(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._get(
- f"/accounts/{account_id}/ai-search/instances/{id}",
+ path_template("/accounts/{account_id}/ai-search/instances/{id}", account_id=account_id, id=id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -646,9 +740,10 @@ def search(
self,
id: str,
*,
- account_id: str,
- messages: Iterable[instance_search_params.Message],
+ account_id: str | None = None,
aisearch_options: instance_search_params.AISearchOptions | Omit = omit,
+ messages: Iterable[instance_search_params.Message] | Omit = omit,
+ query: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -657,10 +752,14 @@ def search(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceSearchResponse:
"""
- Search
+ Executes a semantic search query against an AI Search instance to find relevant
+ indexed content.
Args:
- id: Use your AI Search ID.
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
+
+ query: A simple text query string. Alternative to 'messages' — provide either this or
+ 'messages', not both.
extra_headers: Send extra headers
@@ -670,16 +769,19 @@ def search(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._post(
- f"/accounts/{account_id}/ai-search/instances/{id}/search",
+ path_template("/accounts/{account_id}/ai-search/instances/{id}/search", account_id=account_id, id=id),
body=maybe_transform(
{
- "messages": messages,
"aisearch_options": aisearch_options,
+ "messages": messages,
+ "query": query,
},
instance_search_params.InstanceSearchParams,
),
@@ -697,7 +799,7 @@ def stats(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -706,10 +808,10 @@ def stats(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceStatsResponse:
"""
- Stats
+ Retrieves usage statistics for AI Search instances.
Args:
- id: Use your AI Search ID.
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
extra_headers: Send extra headers
@@ -719,12 +821,14 @@ def stats(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._get(
- f"/accounts/{account_id}/ai-search/instances/{id}/stats",
+ path_template("/accounts/{account_id}/ai-search/instances/{id}/stats", account_id=account_id, id=id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -737,10 +841,6 @@ def stats(
class AsyncInstancesResource(AsyncAPIResource):
- @cached_property
- def items(self) -> AsyncItemsResource:
- return AsyncItemsResource(self._client)
-
@cached_property
def jobs(self) -> AsyncJobsResource:
return AsyncJobsResource(self._client)
@@ -767,94 +867,117 @@ def with_streaming_response(self) -> AsyncInstancesResourceWithStreamingResponse
async def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
id: str,
- source: str,
- type: Literal["r2", "web-crawler"],
- ai_gateway_id: str | Omit = omit,
- aisearch_model: Literal[
- "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
- "@cf/meta/llama-3.1-8b-instruct-fast",
- "@cf/meta/llama-3.1-8b-instruct-fp8",
- "@cf/meta/llama-4-scout-17b-16e-instruct",
- "@cf/qwen/qwen3-30b-a3b-fp8",
- "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
- "@cf/moonshotai/kimi-k2-instruct",
- "anthropic/claude-3-7-sonnet",
- "anthropic/claude-sonnet-4",
- "anthropic/claude-opus-4",
- "anthropic/claude-3-5-haiku",
- "cerebras/qwen-3-235b-a22b-instruct",
- "cerebras/qwen-3-235b-a22b-thinking",
- "cerebras/llama-3.3-70b",
- "cerebras/llama-4-maverick-17b-128e-instruct",
- "cerebras/llama-4-scout-17b-16e-instruct",
- "cerebras/gpt-oss-120b",
- "google-ai-studio/gemini-2.5-flash",
- "google-ai-studio/gemini-2.5-pro",
- "grok/grok-4",
- "groq/llama-3.3-70b-versatile",
- "groq/llama-3.1-8b-instant",
- "openai/gpt-5",
- "openai/gpt-5-mini",
- "openai/gpt-5-nano",
- "",
+ ai_gateway_id: Optional[str] | Omit = omit,
+ aisearch_model: Optional[
+ Literal[
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
+ "@cf/zai-org/glm-4.7-flash",
+ "@cf/meta/llama-3.1-8b-instruct-fast",
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
+ "@cf/qwen/qwen3-30b-a3b-fp8",
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
+ "@cf/moonshotai/kimi-k2-instruct",
+ "@cf/google/gemma-3-12b-it",
+ "@cf/google/gemma-4-26b-a4b-it",
+ "@cf/moonshotai/kimi-k2.5",
+ "anthropic/claude-3-7-sonnet",
+ "anthropic/claude-sonnet-4",
+ "anthropic/claude-opus-4",
+ "anthropic/claude-3-5-haiku",
+ "cerebras/qwen-3-235b-a22b-instruct",
+ "cerebras/qwen-3-235b-a22b-thinking",
+ "cerebras/llama-3.3-70b",
+ "cerebras/llama-4-maverick-17b-128e-instruct",
+ "cerebras/llama-4-scout-17b-16e-instruct",
+ "cerebras/gpt-oss-120b",
+ "google-ai-studio/gemini-2.5-flash",
+ "google-ai-studio/gemini-2.5-pro",
+ "grok/grok-4",
+ "groq/llama-3.3-70b-versatile",
+ "groq/llama-3.1-8b-instant",
+ "openai/gpt-5",
+ "openai/gpt-5-mini",
+ "openai/gpt-5-nano",
+ "",
+ ]
]
| Omit = omit,
+ cache: bool | Omit = omit,
+ cache_threshold: Literal["super_strict_match", "close_enough", "flexible_friend", "anything_goes"]
+ | Omit = omit,
chunk: bool | Omit = omit,
chunk_overlap: int | Omit = omit,
chunk_size: int | Omit = omit,
custom_metadata: Iterable[instance_create_params.CustomMetadata] | Omit = omit,
- embedding_model: Literal[
- "@cf/qwen/qwen3-embedding-0.6b",
- "@cf/baai/bge-m3",
- "@cf/baai/bge-large-en-v1.5",
- "@cf/google/embeddinggemma-300m",
- "google-ai-studio/gemini-embedding-001",
- "openai/text-embedding-3-small",
- "openai/text-embedding-3-large",
- "",
+ embedding_model: Optional[
+ Literal[
+ "@cf/qwen/qwen3-embedding-0.6b",
+ "@cf/baai/bge-m3",
+ "@cf/baai/bge-large-en-v1.5",
+ "@cf/google/embeddinggemma-300m",
+ "google-ai-studio/gemini-embedding-001",
+ "google-ai-studio/gemini-embedding-2-preview",
+ "openai/text-embedding-3-small",
+ "openai/text-embedding-3-large",
+ "",
+ ]
]
| Omit = omit,
+ fusion_method: Literal["max", "rrf"] | Omit = omit,
hybrid_search_enabled: bool | Omit = omit,
+ index_method: instance_create_params.IndexMethod | Omit = omit,
+ indexing_options: Optional[instance_create_params.IndexingOptions] | Omit = omit,
max_num_results: int | Omit = omit,
metadata: instance_create_params.Metadata | Omit = omit,
public_endpoint_params: instance_create_params.PublicEndpointParams | Omit = omit,
reranking: bool | Omit = omit,
- reranking_model: Literal["@cf/baai/bge-reranker-base", ""] | Omit = omit,
- rewrite_model: Literal[
- "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
- "@cf/meta/llama-3.1-8b-instruct-fast",
- "@cf/meta/llama-3.1-8b-instruct-fp8",
- "@cf/meta/llama-4-scout-17b-16e-instruct",
- "@cf/qwen/qwen3-30b-a3b-fp8",
- "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
- "@cf/moonshotai/kimi-k2-instruct",
- "anthropic/claude-3-7-sonnet",
- "anthropic/claude-sonnet-4",
- "anthropic/claude-opus-4",
- "anthropic/claude-3-5-haiku",
- "cerebras/qwen-3-235b-a22b-instruct",
- "cerebras/qwen-3-235b-a22b-thinking",
- "cerebras/llama-3.3-70b",
- "cerebras/llama-4-maverick-17b-128e-instruct",
- "cerebras/llama-4-scout-17b-16e-instruct",
- "cerebras/gpt-oss-120b",
- "google-ai-studio/gemini-2.5-flash",
- "google-ai-studio/gemini-2.5-pro",
- "grok/grok-4",
- "groq/llama-3.3-70b-versatile",
- "groq/llama-3.1-8b-instant",
- "openai/gpt-5",
- "openai/gpt-5-mini",
- "openai/gpt-5-nano",
- "",
+ reranking_model: Optional[Literal["@cf/baai/bge-reranker-base", ""]] | Omit = omit,
+ retrieval_options: Optional[instance_create_params.RetrievalOptions] | Omit = omit,
+ rewrite_model: Optional[
+ Literal[
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
+ "@cf/zai-org/glm-4.7-flash",
+ "@cf/meta/llama-3.1-8b-instruct-fast",
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
+ "@cf/qwen/qwen3-30b-a3b-fp8",
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
+ "@cf/moonshotai/kimi-k2-instruct",
+ "@cf/google/gemma-3-12b-it",
+ "@cf/google/gemma-4-26b-a4b-it",
+ "@cf/moonshotai/kimi-k2.5",
+ "anthropic/claude-3-7-sonnet",
+ "anthropic/claude-sonnet-4",
+ "anthropic/claude-opus-4",
+ "anthropic/claude-3-5-haiku",
+ "cerebras/qwen-3-235b-a22b-instruct",
+ "cerebras/qwen-3-235b-a22b-thinking",
+ "cerebras/llama-3.3-70b",
+ "cerebras/llama-4-maverick-17b-128e-instruct",
+ "cerebras/llama-4-scout-17b-16e-instruct",
+ "cerebras/gpt-oss-120b",
+ "google-ai-studio/gemini-2.5-flash",
+ "google-ai-studio/gemini-2.5-pro",
+ "grok/grok-4",
+ "groq/llama-3.3-70b-versatile",
+ "groq/llama-3.1-8b-instant",
+ "openai/gpt-5",
+ "openai/gpt-5-mini",
+ "openai/gpt-5-nano",
+ "",
+ ]
]
| Omit = omit,
rewrite_query: bool | Omit = omit,
score_threshold: float | Omit = omit,
- source_params: instance_create_params.SourceParams | Omit = omit,
+ source: Optional[str] | Omit = omit,
+ source_params: Optional[instance_create_params.SourceParams] | Omit = omit,
+ sync_interval: Literal[900, 1800, 3600, 7200, 14400, 21600, 43200, 86400] | Omit = omit,
token_id: str | Omit = omit,
+ type: Optional[Literal["r2", "web-crawler"]] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -862,11 +985,20 @@ async def create(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceCreateResponse:
- """
- Create new instances.
+ """Create a new instances.
Args:
- id: Use your AI Search ID.
+ id: AI Search instance ID.
+
+ Lowercase alphanumeric, hyphens, and underscores.
+
+ hybrid_search_enabled: Deprecated — use index_method instead.
+
+ index_method: Controls which storage backends are used during indexing. Defaults to
+ vector-only.
+
+ sync_interval: Interval between automatic syncs, in seconds. Allowed values: 900 (15min), 1800
+ (30min), 3600 (1h), 7200 (2h), 14400 (4h), 21600 (6h), 43200 (12h), 86400 (24h).
extra_headers: Send extra headers
@@ -876,33 +1008,42 @@ async def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._post(
- f"/accounts/{account_id}/ai-search/instances",
+ path_template("/accounts/{account_id}/ai-search/instances", account_id=account_id),
body=await async_maybe_transform(
{
"id": id,
- "source": source,
- "type": type,
"ai_gateway_id": ai_gateway_id,
"aisearch_model": aisearch_model,
+ "cache": cache,
+ "cache_threshold": cache_threshold,
"chunk": chunk,
"chunk_overlap": chunk_overlap,
"chunk_size": chunk_size,
"custom_metadata": custom_metadata,
"embedding_model": embedding_model,
+ "fusion_method": fusion_method,
"hybrid_search_enabled": hybrid_search_enabled,
+ "index_method": index_method,
+ "indexing_options": indexing_options,
"max_num_results": max_num_results,
"metadata": metadata,
"public_endpoint_params": public_endpoint_params,
"reranking": reranking,
"reranking_model": reranking_model,
+ "retrieval_options": retrieval_options,
"rewrite_model": rewrite_model,
"rewrite_query": rewrite_query,
"score_threshold": score_threshold,
+ "source": source,
"source_params": source_params,
+ "sync_interval": sync_interval,
"token_id": token_id,
+ "type": type,
},
instance_create_params.InstanceCreateParams,
),
@@ -920,35 +1061,41 @@ async def update(
self,
id: str,
*,
- account_id: str,
- ai_gateway_id: str | Omit = omit,
- aisearch_model: Literal[
- "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
- "@cf/meta/llama-3.1-8b-instruct-fast",
- "@cf/meta/llama-3.1-8b-instruct-fp8",
- "@cf/meta/llama-4-scout-17b-16e-instruct",
- "@cf/qwen/qwen3-30b-a3b-fp8",
- "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
- "@cf/moonshotai/kimi-k2-instruct",
- "anthropic/claude-3-7-sonnet",
- "anthropic/claude-sonnet-4",
- "anthropic/claude-opus-4",
- "anthropic/claude-3-5-haiku",
- "cerebras/qwen-3-235b-a22b-instruct",
- "cerebras/qwen-3-235b-a22b-thinking",
- "cerebras/llama-3.3-70b",
- "cerebras/llama-4-maverick-17b-128e-instruct",
- "cerebras/llama-4-scout-17b-16e-instruct",
- "cerebras/gpt-oss-120b",
- "google-ai-studio/gemini-2.5-flash",
- "google-ai-studio/gemini-2.5-pro",
- "grok/grok-4",
- "groq/llama-3.3-70b-versatile",
- "groq/llama-3.1-8b-instant",
- "openai/gpt-5",
- "openai/gpt-5-mini",
- "openai/gpt-5-nano",
- "",
+ account_id: str | None = None,
+ ai_gateway_id: Optional[str] | Omit = omit,
+ aisearch_model: Optional[
+ Literal[
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
+ "@cf/zai-org/glm-4.7-flash",
+ "@cf/meta/llama-3.1-8b-instruct-fast",
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
+ "@cf/qwen/qwen3-30b-a3b-fp8",
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
+ "@cf/moonshotai/kimi-k2-instruct",
+ "@cf/google/gemma-3-12b-it",
+ "@cf/google/gemma-4-26b-a4b-it",
+ "@cf/moonshotai/kimi-k2.5",
+ "anthropic/claude-3-7-sonnet",
+ "anthropic/claude-sonnet-4",
+ "anthropic/claude-opus-4",
+ "anthropic/claude-3-5-haiku",
+ "cerebras/qwen-3-235b-a22b-instruct",
+ "cerebras/qwen-3-235b-a22b-thinking",
+ "cerebras/llama-3.3-70b",
+ "cerebras/llama-4-maverick-17b-128e-instruct",
+ "cerebras/llama-4-scout-17b-16e-instruct",
+ "cerebras/gpt-oss-120b",
+ "google-ai-studio/gemini-2.5-flash",
+ "google-ai-studio/gemini-2.5-pro",
+ "grok/grok-4",
+ "groq/llama-3.3-70b-versatile",
+ "groq/llama-3.1-8b-instant",
+ "openai/gpt-5",
+ "openai/gpt-5-mini",
+ "openai/gpt-5-nano",
+ "",
+ ]
]
| Omit = omit,
cache: bool | Omit = omit,
@@ -958,89 +1105,108 @@ async def update(
chunk_overlap: int | Omit = omit,
chunk_size: int | Omit = omit,
custom_metadata: Iterable[instance_update_params.CustomMetadata] | Omit = omit,
- embedding_model: Literal[
- "@cf/qwen/qwen3-embedding-0.6b",
- "@cf/baai/bge-m3",
- "@cf/baai/bge-large-en-v1.5",
- "@cf/google/embeddinggemma-300m",
- "google-ai-studio/gemini-embedding-001",
- "openai/text-embedding-3-small",
- "openai/text-embedding-3-large",
- "",
+ embedding_model: Optional[
+ Literal[
+ "@cf/qwen/qwen3-embedding-0.6b",
+ "@cf/baai/bge-m3",
+ "@cf/baai/bge-large-en-v1.5",
+ "@cf/google/embeddinggemma-300m",
+ "google-ai-studio/gemini-embedding-001",
+ "google-ai-studio/gemini-embedding-2-preview",
+ "openai/text-embedding-3-small",
+ "openai/text-embedding-3-large",
+ "",
+ ]
]
| Omit = omit,
- hybrid_search_enabled: bool | Omit = omit,
+ fusion_method: Literal["max", "rrf"] | Omit = omit,
+ index_method: instance_update_params.IndexMethod | Omit = omit,
+ indexing_options: Optional[instance_update_params.IndexingOptions] | Omit = omit,
max_num_results: int | Omit = omit,
metadata: instance_update_params.Metadata | Omit = omit,
paused: bool | Omit = omit,
public_endpoint_params: instance_update_params.PublicEndpointParams | Omit = omit,
reranking: bool | Omit = omit,
- reranking_model: Literal["@cf/baai/bge-reranker-base", ""] | Omit = omit,
- rewrite_model: Literal[
- "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
- "@cf/meta/llama-3.1-8b-instruct-fast",
- "@cf/meta/llama-3.1-8b-instruct-fp8",
- "@cf/meta/llama-4-scout-17b-16e-instruct",
- "@cf/qwen/qwen3-30b-a3b-fp8",
- "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
- "@cf/moonshotai/kimi-k2-instruct",
- "anthropic/claude-3-7-sonnet",
- "anthropic/claude-sonnet-4",
- "anthropic/claude-opus-4",
- "anthropic/claude-3-5-haiku",
- "cerebras/qwen-3-235b-a22b-instruct",
- "cerebras/qwen-3-235b-a22b-thinking",
- "cerebras/llama-3.3-70b",
- "cerebras/llama-4-maverick-17b-128e-instruct",
- "cerebras/llama-4-scout-17b-16e-instruct",
- "cerebras/gpt-oss-120b",
- "google-ai-studio/gemini-2.5-flash",
- "google-ai-studio/gemini-2.5-pro",
- "grok/grok-4",
- "groq/llama-3.3-70b-versatile",
- "groq/llama-3.1-8b-instant",
- "openai/gpt-5",
- "openai/gpt-5-mini",
- "openai/gpt-5-nano",
- "",
+ reranking_model: Optional[Literal["@cf/baai/bge-reranker-base", ""]] | Omit = omit,
+ retrieval_options: Optional[instance_update_params.RetrievalOptions] | Omit = omit,
+ rewrite_model: Optional[
+ Literal[
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
+ "@cf/zai-org/glm-4.7-flash",
+ "@cf/meta/llama-3.1-8b-instruct-fast",
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
+ "@cf/qwen/qwen3-30b-a3b-fp8",
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
+ "@cf/moonshotai/kimi-k2-instruct",
+ "@cf/google/gemma-3-12b-it",
+ "@cf/google/gemma-4-26b-a4b-it",
+ "@cf/moonshotai/kimi-k2.5",
+ "anthropic/claude-3-7-sonnet",
+ "anthropic/claude-sonnet-4",
+ "anthropic/claude-opus-4",
+ "anthropic/claude-3-5-haiku",
+ "cerebras/qwen-3-235b-a22b-instruct",
+ "cerebras/qwen-3-235b-a22b-thinking",
+ "cerebras/llama-3.3-70b",
+ "cerebras/llama-4-maverick-17b-128e-instruct",
+ "cerebras/llama-4-scout-17b-16e-instruct",
+ "cerebras/gpt-oss-120b",
+ "google-ai-studio/gemini-2.5-flash",
+ "google-ai-studio/gemini-2.5-pro",
+ "grok/grok-4",
+ "groq/llama-3.3-70b-versatile",
+ "groq/llama-3.1-8b-instant",
+ "openai/gpt-5",
+ "openai/gpt-5-mini",
+ "openai/gpt-5-nano",
+ "",
+ ]
]
| Omit = omit,
rewrite_query: bool | Omit = omit,
score_threshold: float | Omit = omit,
- source_params: instance_update_params.SourceParams | Omit = omit,
+ source_params: Optional[instance_update_params.SourceParams] | Omit = omit,
summarization: bool | Omit = omit,
- summarization_model: Literal[
- "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
- "@cf/meta/llama-3.1-8b-instruct-fast",
- "@cf/meta/llama-3.1-8b-instruct-fp8",
- "@cf/meta/llama-4-scout-17b-16e-instruct",
- "@cf/qwen/qwen3-30b-a3b-fp8",
- "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
- "@cf/moonshotai/kimi-k2-instruct",
- "anthropic/claude-3-7-sonnet",
- "anthropic/claude-sonnet-4",
- "anthropic/claude-opus-4",
- "anthropic/claude-3-5-haiku",
- "cerebras/qwen-3-235b-a22b-instruct",
- "cerebras/qwen-3-235b-a22b-thinking",
- "cerebras/llama-3.3-70b",
- "cerebras/llama-4-maverick-17b-128e-instruct",
- "cerebras/llama-4-scout-17b-16e-instruct",
- "cerebras/gpt-oss-120b",
- "google-ai-studio/gemini-2.5-flash",
- "google-ai-studio/gemini-2.5-pro",
- "grok/grok-4",
- "groq/llama-3.3-70b-versatile",
- "groq/llama-3.1-8b-instant",
- "openai/gpt-5",
- "openai/gpt-5-mini",
- "openai/gpt-5-nano",
- "",
+ summarization_model: Optional[
+ Literal[
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
+ "@cf/zai-org/glm-4.7-flash",
+ "@cf/meta/llama-3.1-8b-instruct-fast",
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
+ "@cf/qwen/qwen3-30b-a3b-fp8",
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
+ "@cf/moonshotai/kimi-k2-instruct",
+ "@cf/google/gemma-3-12b-it",
+ "@cf/google/gemma-4-26b-a4b-it",
+ "@cf/moonshotai/kimi-k2.5",
+ "anthropic/claude-3-7-sonnet",
+ "anthropic/claude-sonnet-4",
+ "anthropic/claude-opus-4",
+ "anthropic/claude-3-5-haiku",
+ "cerebras/qwen-3-235b-a22b-instruct",
+ "cerebras/qwen-3-235b-a22b-thinking",
+ "cerebras/llama-3.3-70b",
+ "cerebras/llama-4-maverick-17b-128e-instruct",
+ "cerebras/llama-4-scout-17b-16e-instruct",
+ "cerebras/gpt-oss-120b",
+ "google-ai-studio/gemini-2.5-flash",
+ "google-ai-studio/gemini-2.5-pro",
+ "grok/grok-4",
+ "groq/llama-3.3-70b-versatile",
+ "groq/llama-3.1-8b-instant",
+ "openai/gpt-5",
+ "openai/gpt-5-mini",
+ "openai/gpt-5-nano",
+ "",
+ ]
]
| Omit = omit,
- system_prompt_aisearch: str | Omit = omit,
- system_prompt_index_summarization: str | Omit = omit,
- system_prompt_rewrite_query: str | Omit = omit,
+ sync_interval: Literal[900, 1800, 3600, 7200, 14400, 21600, 43200, 86400] | Omit = omit,
+ system_prompt_aisearch: Optional[str] | Omit = omit,
+ system_prompt_index_summarization: Optional[str] | Omit = omit,
+ system_prompt_rewrite_query: Optional[str] | Omit = omit,
token_id: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -1049,11 +1215,18 @@ async def update(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceUpdateResponse:
- """
- Update instances.
+ """Update instances.
Args:
- id: Use your AI Search ID.
+ id: AI Search instance ID.
+
+ Lowercase alphanumeric, hyphens, and underscores.
+
+ index_method: Controls which storage backends are used during indexing. Defaults to
+ vector-only.
+
+ sync_interval: Interval between automatic syncs, in seconds. Allowed values: 900 (15min), 1800
+ (30min), 3600 (1h), 7200 (2h), 14400 (4h), 21600 (6h), 43200 (12h), 86400 (24h).
extra_headers: Send extra headers
@@ -1063,12 +1236,14 @@ async def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return await self._put(
- f"/accounts/{account_id}/ai-search/instances/{id}",
+ path_template("/accounts/{account_id}/ai-search/instances/{id}", account_id=account_id, id=id),
body=await async_maybe_transform(
{
"ai_gateway_id": ai_gateway_id,
@@ -1080,19 +1255,23 @@ async def update(
"chunk_size": chunk_size,
"custom_metadata": custom_metadata,
"embedding_model": embedding_model,
- "hybrid_search_enabled": hybrid_search_enabled,
+ "fusion_method": fusion_method,
+ "index_method": index_method,
+ "indexing_options": indexing_options,
"max_num_results": max_num_results,
"metadata": metadata,
"paused": paused,
"public_endpoint_params": public_endpoint_params,
"reranking": reranking,
"reranking_model": reranking_model,
+ "retrieval_options": retrieval_options,
"rewrite_model": rewrite_model,
"rewrite_query": rewrite_query,
"score_threshold": score_threshold,
"source_params": source_params,
"summarization": summarization,
"summarization_model": summarization_model,
+ "sync_interval": sync_interval,
"system_prompt_aisearch": system_prompt_aisearch,
"system_prompt_index_summarization": system_prompt_index_summarization,
"system_prompt_rewrite_query": system_prompt_rewrite_query,
@@ -1113,7 +1292,10 @@ async def update(
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
+ namespace: Optional[str] | Omit = omit,
+ order_by: Literal["created_at"] | Omit = omit,
+ order_by_direction: Literal["asc", "desc"] | Omit = omit,
page: int | Omit = omit,
per_page: int | Omit = omit,
search: str | Omit = omit,
@@ -1128,6 +1310,10 @@ def list(
List instances.
Args:
+ order_by: Order By Column Name
+
+ order_by_direction: Order By Direction
+
search: Search by id
extra_headers: Send extra headers
@@ -1138,10 +1324,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/ai-search/instances",
+ path_template("/accounts/{account_id}/ai-search/instances", account_id=account_id),
page=AsyncV4PagePaginationArray[InstanceListResponse],
options=make_request_options(
extra_headers=extra_headers,
@@ -1150,6 +1338,9 @@ def list(
timeout=timeout,
query=maybe_transform(
{
+ "namespace": namespace,
+ "order_by": order_by,
+ "order_by_direction": order_by_direction,
"page": page,
"per_page": per_page,
"search": search,
@@ -1164,7 +1355,7 @@ async def delete(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -1172,11 +1363,12 @@ async def delete(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceDeleteResponse:
- """
- Delete instances.
+ """Delete instances.
Args:
- id: Use your AI Search ID.
+ id: AI Search instance ID.
+
+ Lowercase alphanumeric, hyphens, and underscores.
extra_headers: Send extra headers
@@ -1186,12 +1378,14 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return await self._delete(
- f"/accounts/{account_id}/ai-search/instances/{id}",
+ path_template("/accounts/{account_id}/ai-search/instances/{id}", account_id=account_id, id=id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -1206,17 +1400,21 @@ async def chat_completions(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
messages: Iterable[instance_chat_completions_params.Message],
aisearch_options: instance_chat_completions_params.AISearchOptions | Omit = omit,
model: Literal[
"@cf/meta/llama-3.3-70b-instruct-fp8-fast",
+ "@cf/zai-org/glm-4.7-flash",
"@cf/meta/llama-3.1-8b-instruct-fast",
"@cf/meta/llama-3.1-8b-instruct-fp8",
"@cf/meta/llama-4-scout-17b-16e-instruct",
"@cf/qwen/qwen3-30b-a3b-fp8",
"@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
"@cf/moonshotai/kimi-k2-instruct",
+ "@cf/google/gemma-3-12b-it",
+ "@cf/google/gemma-4-26b-a4b-it",
+ "@cf/moonshotai/kimi-k2.5",
"anthropic/claude-3-7-sonnet",
"anthropic/claude-sonnet-4",
"anthropic/claude-opus-4",
@@ -1247,10 +1445,11 @@ async def chat_completions(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceChatCompletionsResponse:
"""
- Chat Completions
+ Performs a chat completion request against an AI Search instance, using indexed
+ content as context for generating responses.
Args:
- id: Use your AI Search ID.
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
extra_headers: Send extra headers
@@ -1260,12 +1459,16 @@ async def chat_completions(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return await self._post(
- f"/accounts/{account_id}/ai-search/instances/{id}/chat/completions",
+ path_template(
+ "/accounts/{account_id}/ai-search/instances/{id}/chat/completions", account_id=account_id, id=id
+ ),
body=await async_maybe_transform(
{
"messages": messages,
@@ -1285,7 +1488,7 @@ async def read(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -1293,11 +1496,12 @@ async def read(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceReadResponse:
- """
- Read instances.
+ """Read instances.
Args:
- id: Use your AI Search ID.
+ id: AI Search instance ID.
+
+ Lowercase alphanumeric, hyphens, and underscores.
extra_headers: Send extra headers
@@ -1307,12 +1511,14 @@ async def read(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return await self._get(
- f"/accounts/{account_id}/ai-search/instances/{id}",
+ path_template("/accounts/{account_id}/ai-search/instances/{id}", account_id=account_id, id=id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -1327,9 +1533,10 @@ async def search(
self,
id: str,
*,
- account_id: str,
- messages: Iterable[instance_search_params.Message],
+ account_id: str | None = None,
aisearch_options: instance_search_params.AISearchOptions | Omit = omit,
+ messages: Iterable[instance_search_params.Message] | Omit = omit,
+ query: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -1338,10 +1545,14 @@ async def search(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceSearchResponse:
"""
- Search
+ Executes a semantic search query against an AI Search instance to find relevant
+ indexed content.
Args:
- id: Use your AI Search ID.
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
+
+ query: A simple text query string. Alternative to 'messages' — provide either this or
+ 'messages', not both.
extra_headers: Send extra headers
@@ -1351,16 +1562,19 @@ async def search(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return await self._post(
- f"/accounts/{account_id}/ai-search/instances/{id}/search",
+ path_template("/accounts/{account_id}/ai-search/instances/{id}/search", account_id=account_id, id=id),
body=await async_maybe_transform(
{
- "messages": messages,
"aisearch_options": aisearch_options,
+ "messages": messages,
+ "query": query,
},
instance_search_params.InstanceSearchParams,
),
@@ -1378,7 +1592,7 @@ async def stats(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -1387,10 +1601,10 @@ async def stats(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceStatsResponse:
"""
- Stats
+ Retrieves usage statistics for AI Search instances.
Args:
- id: Use your AI Search ID.
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
extra_headers: Send extra headers
@@ -1400,12 +1614,14 @@ async def stats(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return await self._get(
- f"/accounts/{account_id}/ai-search/instances/{id}/stats",
+ path_template("/accounts/{account_id}/ai-search/instances/{id}/stats", account_id=account_id, id=id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -1446,10 +1662,6 @@ def __init__(self, instances: InstancesResource) -> None:
instances.stats,
)
- @cached_property
- def items(self) -> ItemsResourceWithRawResponse:
- return ItemsResourceWithRawResponse(self._instances.items)
-
@cached_property
def jobs(self) -> JobsResourceWithRawResponse:
return JobsResourceWithRawResponse(self._instances.jobs)
@@ -1484,10 +1696,6 @@ def __init__(self, instances: AsyncInstancesResource) -> None:
instances.stats,
)
- @cached_property
- def items(self) -> AsyncItemsResourceWithRawResponse:
- return AsyncItemsResourceWithRawResponse(self._instances.items)
-
@cached_property
def jobs(self) -> AsyncJobsResourceWithRawResponse:
return AsyncJobsResourceWithRawResponse(self._instances.jobs)
@@ -1522,10 +1730,6 @@ def __init__(self, instances: InstancesResource) -> None:
instances.stats,
)
- @cached_property
- def items(self) -> ItemsResourceWithStreamingResponse:
- return ItemsResourceWithStreamingResponse(self._instances.items)
-
@cached_property
def jobs(self) -> JobsResourceWithStreamingResponse:
return JobsResourceWithStreamingResponse(self._instances.jobs)
@@ -1560,10 +1764,6 @@ def __init__(self, instances: AsyncInstancesResource) -> None:
instances.stats,
)
- @cached_property
- def items(self) -> AsyncItemsResourceWithStreamingResponse:
- return AsyncItemsResourceWithStreamingResponse(self._instances.items)
-
@cached_property
def jobs(self) -> AsyncJobsResourceWithStreamingResponse:
return AsyncJobsResourceWithStreamingResponse(self._instances.jobs)
diff --git a/src/cloudflare/resources/aisearch/instances/jobs.py b/src/cloudflare/resources/aisearch/instances/jobs.py
index 2c6bb4226f5..f7c31e7d100 100644
--- a/src/cloudflare/resources/aisearch/instances/jobs.py
+++ b/src/cloudflare/resources/aisearch/instances/jobs.py
@@ -7,7 +7,7 @@
import httpx
from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ...._utils import maybe_transform, async_maybe_transform
+from ...._utils import path_template, maybe_transform, async_maybe_transform
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -19,7 +19,7 @@
from ...._wrappers import ResultWrapper
from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray
from ...._base_client import AsyncPaginator, make_request_options
-from ....types.aisearch.instances import job_list_params, job_logs_params
+from ....types.aisearch.instances import job_list_params, job_logs_params, job_create_params
from ....types.aisearch.instances.job_get_response import JobGetResponse
from ....types.aisearch.instances.job_list_response import JobListResponse
from ....types.aisearch.instances.job_logs_response import JobLogsResponse
@@ -52,7 +52,8 @@ def create(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
+ description: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -61,10 +62,10 @@ def create(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> JobCreateResponse:
"""
- Create new job
+ Creates a new indexing job for an AI Search instance.
Args:
- id: Use your AI Search ID.
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
extra_headers: Send extra headers
@@ -74,12 +75,15 @@ def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._post(
- f"/accounts/{account_id}/ai-search/instances/{id}/jobs",
+ path_template("/accounts/{account_id}/ai-search/instances/{id}/jobs", account_id=account_id, id=id),
+ body=maybe_transform({"description": description}, job_create_params.JobCreateParams),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -94,7 +98,7 @@ def list(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
page: int | Omit = omit,
per_page: int | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -105,10 +109,10 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncV4PagePaginationArray[JobListResponse]:
"""
- List Jobs
+ Lists indexing jobs for an AI Search instance.
Args:
- id: Use your AI Search ID.
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
extra_headers: Send extra headers
@@ -118,12 +122,14 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/ai-search/instances/{id}/jobs",
+ path_template("/accounts/{account_id}/ai-search/instances/{id}/jobs", account_id=account_id, id=id),
page=SyncV4PagePaginationArray[JobListResponse],
options=make_request_options(
extra_headers=extra_headers,
@@ -145,7 +151,7 @@ def get(
self,
job_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -155,10 +161,10 @@ def get(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> JobGetResponse:
"""
- Get a Job Details
+ Retrieves details for a specific AI Search indexing job.
Args:
- id: Use your AI Search ID.
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
extra_headers: Send extra headers
@@ -168,6 +174,8 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not id:
@@ -175,7 +183,12 @@ def get(
if not job_id:
raise ValueError(f"Expected a non-empty value for `job_id` but received {job_id!r}")
return self._get(
- f"/accounts/{account_id}/ai-search/instances/{id}/jobs/{job_id}",
+ path_template(
+ "/accounts/{account_id}/ai-search/instances/{id}/jobs/{job_id}",
+ account_id=account_id,
+ id=id,
+ job_id=job_id,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -190,7 +203,7 @@ def logs(
self,
job_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
id: str,
page: int | Omit = omit,
per_page: int | Omit = omit,
@@ -202,10 +215,10 @@ def logs(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> JobLogsResponse:
"""
- List Job Logs
+ Lists log entries for an AI Search indexing job.
Args:
- id: Use your AI Search ID.
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
extra_headers: Send extra headers
@@ -215,6 +228,8 @@ def logs(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not id:
@@ -222,7 +237,12 @@ def logs(
if not job_id:
raise ValueError(f"Expected a non-empty value for `job_id` but received {job_id!r}")
return self._get(
- f"/accounts/{account_id}/ai-search/instances/{id}/jobs/{job_id}/logs",
+ path_template(
+ "/accounts/{account_id}/ai-search/instances/{id}/jobs/{job_id}/logs",
+ account_id=account_id,
+ id=id,
+ job_id=job_id,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -265,7 +285,8 @@ async def create(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
+ description: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -274,10 +295,10 @@ async def create(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> JobCreateResponse:
"""
- Create new job
+ Creates a new indexing job for an AI Search instance.
Args:
- id: Use your AI Search ID.
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
extra_headers: Send extra headers
@@ -287,12 +308,15 @@ async def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return await self._post(
- f"/accounts/{account_id}/ai-search/instances/{id}/jobs",
+ path_template("/accounts/{account_id}/ai-search/instances/{id}/jobs", account_id=account_id, id=id),
+ body=await async_maybe_transform({"description": description}, job_create_params.JobCreateParams),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -307,7 +331,7 @@ def list(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
page: int | Omit = omit,
per_page: int | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -318,10 +342,10 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[JobListResponse, AsyncV4PagePaginationArray[JobListResponse]]:
"""
- List Jobs
+ Lists indexing jobs for an AI Search instance.
Args:
- id: Use your AI Search ID.
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
extra_headers: Send extra headers
@@ -331,12 +355,14 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/ai-search/instances/{id}/jobs",
+ path_template("/accounts/{account_id}/ai-search/instances/{id}/jobs", account_id=account_id, id=id),
page=AsyncV4PagePaginationArray[JobListResponse],
options=make_request_options(
extra_headers=extra_headers,
@@ -358,7 +384,7 @@ async def get(
self,
job_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -368,10 +394,10 @@ async def get(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> JobGetResponse:
"""
- Get a Job Details
+ Retrieves details for a specific AI Search indexing job.
Args:
- id: Use your AI Search ID.
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
extra_headers: Send extra headers
@@ -381,6 +407,8 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not id:
@@ -388,7 +416,12 @@ async def get(
if not job_id:
raise ValueError(f"Expected a non-empty value for `job_id` but received {job_id!r}")
return await self._get(
- f"/accounts/{account_id}/ai-search/instances/{id}/jobs/{job_id}",
+ path_template(
+ "/accounts/{account_id}/ai-search/instances/{id}/jobs/{job_id}",
+ account_id=account_id,
+ id=id,
+ job_id=job_id,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -403,7 +436,7 @@ async def logs(
self,
job_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
id: str,
page: int | Omit = omit,
per_page: int | Omit = omit,
@@ -415,10 +448,10 @@ async def logs(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> JobLogsResponse:
"""
- List Job Logs
+ Lists log entries for an AI Search indexing job.
Args:
- id: Use your AI Search ID.
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
extra_headers: Send extra headers
@@ -428,6 +461,8 @@ async def logs(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not id:
@@ -435,7 +470,12 @@ async def logs(
if not job_id:
raise ValueError(f"Expected a non-empty value for `job_id` but received {job_id!r}")
return await self._get(
- f"/accounts/{account_id}/ai-search/instances/{id}/jobs/{job_id}/logs",
+ path_template(
+ "/accounts/{account_id}/ai-search/instances/{id}/jobs/{job_id}/logs",
+ account_id=account_id,
+ id=id,
+ job_id=job_id,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/aisearch/namespaces/__init__.py b/src/cloudflare/resources/aisearch/namespaces/__init__.py
new file mode 100644
index 00000000000..de69633eb36
--- /dev/null
+++ b/src/cloudflare/resources/aisearch/namespaces/__init__.py
@@ -0,0 +1,33 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from .instances import (
+ InstancesResource,
+ AsyncInstancesResource,
+ InstancesResourceWithRawResponse,
+ AsyncInstancesResourceWithRawResponse,
+ InstancesResourceWithStreamingResponse,
+ AsyncInstancesResourceWithStreamingResponse,
+)
+from .namespaces import (
+ NamespacesResource,
+ AsyncNamespacesResource,
+ NamespacesResourceWithRawResponse,
+ AsyncNamespacesResourceWithRawResponse,
+ NamespacesResourceWithStreamingResponse,
+ AsyncNamespacesResourceWithStreamingResponse,
+)
+
+__all__ = [
+ "InstancesResource",
+ "AsyncInstancesResource",
+ "InstancesResourceWithRawResponse",
+ "AsyncInstancesResourceWithRawResponse",
+ "InstancesResourceWithStreamingResponse",
+ "AsyncInstancesResourceWithStreamingResponse",
+ "NamespacesResource",
+ "AsyncNamespacesResource",
+ "NamespacesResourceWithRawResponse",
+ "AsyncNamespacesResourceWithRawResponse",
+ "NamespacesResourceWithStreamingResponse",
+ "AsyncNamespacesResourceWithStreamingResponse",
+]
diff --git a/src/cloudflare/resources/aisearch/namespaces/instances/__init__.py b/src/cloudflare/resources/aisearch/namespaces/instances/__init__.py
new file mode 100644
index 00000000000..258ebff8a28
--- /dev/null
+++ b/src/cloudflare/resources/aisearch/namespaces/instances/__init__.py
@@ -0,0 +1,47 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from .jobs import (
+ JobsResource,
+ AsyncJobsResource,
+ JobsResourceWithRawResponse,
+ AsyncJobsResourceWithRawResponse,
+ JobsResourceWithStreamingResponse,
+ AsyncJobsResourceWithStreamingResponse,
+)
+from .items import (
+ ItemsResource,
+ AsyncItemsResource,
+ ItemsResourceWithRawResponse,
+ AsyncItemsResourceWithRawResponse,
+ ItemsResourceWithStreamingResponse,
+ AsyncItemsResourceWithStreamingResponse,
+)
+from .instances import (
+ InstancesResource,
+ AsyncInstancesResource,
+ InstancesResourceWithRawResponse,
+ AsyncInstancesResourceWithRawResponse,
+ InstancesResourceWithStreamingResponse,
+ AsyncInstancesResourceWithStreamingResponse,
+)
+
+__all__ = [
+ "JobsResource",
+ "AsyncJobsResource",
+ "JobsResourceWithRawResponse",
+ "AsyncJobsResourceWithRawResponse",
+ "JobsResourceWithStreamingResponse",
+ "AsyncJobsResourceWithStreamingResponse",
+ "ItemsResource",
+ "AsyncItemsResource",
+ "ItemsResourceWithRawResponse",
+ "AsyncItemsResourceWithRawResponse",
+ "ItemsResourceWithStreamingResponse",
+ "AsyncItemsResourceWithStreamingResponse",
+ "InstancesResource",
+ "AsyncInstancesResource",
+ "InstancesResourceWithRawResponse",
+ "AsyncInstancesResourceWithRawResponse",
+ "InstancesResourceWithStreamingResponse",
+ "AsyncInstancesResourceWithStreamingResponse",
+]
diff --git a/src/cloudflare/resources/aisearch/namespaces/instances/instances.py b/src/cloudflare/resources/aisearch/namespaces/instances/instances.py
new file mode 100644
index 00000000000..3a08044deed
--- /dev/null
+++ b/src/cloudflare/resources/aisearch/namespaces/instances/instances.py
@@ -0,0 +1,1913 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Type, Iterable, Optional, cast
+from typing_extensions import Literal
+
+import httpx
+
+from .jobs import (
+ JobsResource,
+ AsyncJobsResource,
+ JobsResourceWithRawResponse,
+ AsyncJobsResourceWithRawResponse,
+ JobsResourceWithStreamingResponse,
+ AsyncJobsResourceWithStreamingResponse,
+)
+from .items import (
+ ItemsResource,
+ AsyncItemsResource,
+ ItemsResourceWithRawResponse,
+ AsyncItemsResourceWithRawResponse,
+ ItemsResourceWithStreamingResponse,
+ AsyncItemsResourceWithStreamingResponse,
+)
+from ....._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
+from ....._utils import path_template, maybe_transform, async_maybe_transform
+from ....._compat import cached_property
+from ....._resource import SyncAPIResource, AsyncAPIResource
+from ....._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from ....._wrappers import ResultWrapper
+from .....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray
+from ....._base_client import AsyncPaginator, make_request_options
+from .....types.aisearch.namespaces import (
+ instance_list_params,
+ instance_create_params,
+ instance_search_params,
+ instance_update_params,
+ instance_chat_completions_params,
+)
+from .....types.aisearch.namespaces.instance_list_response import InstanceListResponse
+from .....types.aisearch.namespaces.instance_read_response import InstanceReadResponse
+from .....types.aisearch.namespaces.instance_stats_response import InstanceStatsResponse
+from .....types.aisearch.namespaces.instance_create_response import InstanceCreateResponse
+from .....types.aisearch.namespaces.instance_delete_response import InstanceDeleteResponse
+from .....types.aisearch.namespaces.instance_search_response import InstanceSearchResponse
+from .....types.aisearch.namespaces.instance_update_response import InstanceUpdateResponse
+from .....types.aisearch.namespaces.instance_chat_completions_response import InstanceChatCompletionsResponse
+
+__all__ = ["InstancesResource", "AsyncInstancesResource"]
+
+
+class InstancesResource(SyncAPIResource):
+ @cached_property
+ def jobs(self) -> JobsResource:
+ return JobsResource(self._client)
+
+ @cached_property
+ def items(self) -> ItemsResource:
+ return ItemsResource(self._client)
+
+ @cached_property
+ def with_raw_response(self) -> InstancesResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return InstancesResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> InstancesResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return InstancesResourceWithStreamingResponse(self)
+
+ def create(
+ self,
+ name: str,
+ *,
+ account_id: str | None = None,
+ id: str,
+ ai_gateway_id: Optional[str] | Omit = omit,
+ aisearch_model: Optional[
+ Literal[
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
+ "@cf/zai-org/glm-4.7-flash",
+ "@cf/meta/llama-3.1-8b-instruct-fast",
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
+ "@cf/qwen/qwen3-30b-a3b-fp8",
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
+ "@cf/moonshotai/kimi-k2-instruct",
+ "@cf/google/gemma-3-12b-it",
+ "@cf/google/gemma-4-26b-a4b-it",
+ "@cf/moonshotai/kimi-k2.5",
+ "anthropic/claude-3-7-sonnet",
+ "anthropic/claude-sonnet-4",
+ "anthropic/claude-opus-4",
+ "anthropic/claude-3-5-haiku",
+ "cerebras/qwen-3-235b-a22b-instruct",
+ "cerebras/qwen-3-235b-a22b-thinking",
+ "cerebras/llama-3.3-70b",
+ "cerebras/llama-4-maverick-17b-128e-instruct",
+ "cerebras/llama-4-scout-17b-16e-instruct",
+ "cerebras/gpt-oss-120b",
+ "google-ai-studio/gemini-2.5-flash",
+ "google-ai-studio/gemini-2.5-pro",
+ "grok/grok-4",
+ "groq/llama-3.3-70b-versatile",
+ "groq/llama-3.1-8b-instant",
+ "openai/gpt-5",
+ "openai/gpt-5-mini",
+ "openai/gpt-5-nano",
+ "",
+ ]
+ ]
+ | Omit = omit,
+ cache: bool | Omit = omit,
+ cache_threshold: Literal["super_strict_match", "close_enough", "flexible_friend", "anything_goes"]
+ | Omit = omit,
+ chunk: bool | Omit = omit,
+ chunk_overlap: int | Omit = omit,
+ chunk_size: int | Omit = omit,
+ custom_metadata: Iterable[instance_create_params.CustomMetadata] | Omit = omit,
+ embedding_model: Optional[
+ Literal[
+ "@cf/qwen/qwen3-embedding-0.6b",
+ "@cf/baai/bge-m3",
+ "@cf/baai/bge-large-en-v1.5",
+ "@cf/google/embeddinggemma-300m",
+ "google-ai-studio/gemini-embedding-001",
+ "google-ai-studio/gemini-embedding-2-preview",
+ "openai/text-embedding-3-small",
+ "openai/text-embedding-3-large",
+ "",
+ ]
+ ]
+ | Omit = omit,
+ fusion_method: Literal["max", "rrf"] | Omit = omit,
+ hybrid_search_enabled: bool | Omit = omit,
+ index_method: instance_create_params.IndexMethod | Omit = omit,
+ indexing_options: Optional[instance_create_params.IndexingOptions] | Omit = omit,
+ max_num_results: int | Omit = omit,
+ metadata: instance_create_params.Metadata | Omit = omit,
+ public_endpoint_params: instance_create_params.PublicEndpointParams | Omit = omit,
+ reranking: bool | Omit = omit,
+ reranking_model: Optional[Literal["@cf/baai/bge-reranker-base", ""]] | Omit = omit,
+ retrieval_options: Optional[instance_create_params.RetrievalOptions] | Omit = omit,
+ rewrite_model: Optional[
+ Literal[
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
+ "@cf/zai-org/glm-4.7-flash",
+ "@cf/meta/llama-3.1-8b-instruct-fast",
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
+ "@cf/qwen/qwen3-30b-a3b-fp8",
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
+ "@cf/moonshotai/kimi-k2-instruct",
+ "@cf/google/gemma-3-12b-it",
+ "@cf/google/gemma-4-26b-a4b-it",
+ "@cf/moonshotai/kimi-k2.5",
+ "anthropic/claude-3-7-sonnet",
+ "anthropic/claude-sonnet-4",
+ "anthropic/claude-opus-4",
+ "anthropic/claude-3-5-haiku",
+ "cerebras/qwen-3-235b-a22b-instruct",
+ "cerebras/qwen-3-235b-a22b-thinking",
+ "cerebras/llama-3.3-70b",
+ "cerebras/llama-4-maverick-17b-128e-instruct",
+ "cerebras/llama-4-scout-17b-16e-instruct",
+ "cerebras/gpt-oss-120b",
+ "google-ai-studio/gemini-2.5-flash",
+ "google-ai-studio/gemini-2.5-pro",
+ "grok/grok-4",
+ "groq/llama-3.3-70b-versatile",
+ "groq/llama-3.1-8b-instant",
+ "openai/gpt-5",
+ "openai/gpt-5-mini",
+ "openai/gpt-5-nano",
+ "",
+ ]
+ ]
+ | Omit = omit,
+ rewrite_query: bool | Omit = omit,
+ score_threshold: float | Omit = omit,
+ source: Optional[str] | Omit = omit,
+ source_params: Optional[instance_create_params.SourceParams] | Omit = omit,
+ sync_interval: Literal[900, 1800, 3600, 7200, 14400, 21600, 43200, 86400] | Omit = omit,
+ token_id: str | Omit = omit,
+ type: Optional[Literal["r2", "web-crawler"]] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> InstanceCreateResponse:
+ """Create a new instances.
+
+ Args:
+ id: AI Search instance ID.
+
+ Lowercase alphanumeric, hyphens, and underscores.
+
+ hybrid_search_enabled: Deprecated — use index_method instead.
+
+ index_method: Controls which storage backends are used during indexing. Defaults to
+ vector-only.
+
+ sync_interval: Interval between automatic syncs, in seconds. Allowed values: 900 (15min), 1800
+ (30min), 3600 (1h), 7200 (2h), 14400 (4h), 21600 (6h), 43200 (12h), 86400 (24h).
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ return self._post(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances", account_id=account_id, name=name
+ ),
+ body=maybe_transform(
+ {
+ "id": id,
+ "ai_gateway_id": ai_gateway_id,
+ "aisearch_model": aisearch_model,
+ "cache": cache,
+ "cache_threshold": cache_threshold,
+ "chunk": chunk,
+ "chunk_overlap": chunk_overlap,
+ "chunk_size": chunk_size,
+ "custom_metadata": custom_metadata,
+ "embedding_model": embedding_model,
+ "fusion_method": fusion_method,
+ "hybrid_search_enabled": hybrid_search_enabled,
+ "index_method": index_method,
+ "indexing_options": indexing_options,
+ "max_num_results": max_num_results,
+ "metadata": metadata,
+ "public_endpoint_params": public_endpoint_params,
+ "reranking": reranking,
+ "reranking_model": reranking_model,
+ "retrieval_options": retrieval_options,
+ "rewrite_model": rewrite_model,
+ "rewrite_query": rewrite_query,
+ "score_threshold": score_threshold,
+ "source": source,
+ "source_params": source_params,
+ "sync_interval": sync_interval,
+ "token_id": token_id,
+ "type": type,
+ },
+ instance_create_params.InstanceCreateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[InstanceCreateResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[InstanceCreateResponse], ResultWrapper[InstanceCreateResponse]),
+ )
+
+ def update(
+ self,
+ id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ ai_gateway_id: Optional[str] | Omit = omit,
+ aisearch_model: Optional[
+ Literal[
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
+ "@cf/zai-org/glm-4.7-flash",
+ "@cf/meta/llama-3.1-8b-instruct-fast",
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
+ "@cf/qwen/qwen3-30b-a3b-fp8",
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
+ "@cf/moonshotai/kimi-k2-instruct",
+ "@cf/google/gemma-3-12b-it",
+ "@cf/google/gemma-4-26b-a4b-it",
+ "@cf/moonshotai/kimi-k2.5",
+ "anthropic/claude-3-7-sonnet",
+ "anthropic/claude-sonnet-4",
+ "anthropic/claude-opus-4",
+ "anthropic/claude-3-5-haiku",
+ "cerebras/qwen-3-235b-a22b-instruct",
+ "cerebras/qwen-3-235b-a22b-thinking",
+ "cerebras/llama-3.3-70b",
+ "cerebras/llama-4-maverick-17b-128e-instruct",
+ "cerebras/llama-4-scout-17b-16e-instruct",
+ "cerebras/gpt-oss-120b",
+ "google-ai-studio/gemini-2.5-flash",
+ "google-ai-studio/gemini-2.5-pro",
+ "grok/grok-4",
+ "groq/llama-3.3-70b-versatile",
+ "groq/llama-3.1-8b-instant",
+ "openai/gpt-5",
+ "openai/gpt-5-mini",
+ "openai/gpt-5-nano",
+ "",
+ ]
+ ]
+ | Omit = omit,
+ cache: bool | Omit = omit,
+ cache_threshold: Literal["super_strict_match", "close_enough", "flexible_friend", "anything_goes"]
+ | Omit = omit,
+ chunk: bool | Omit = omit,
+ chunk_overlap: int | Omit = omit,
+ chunk_size: int | Omit = omit,
+ custom_metadata: Iterable[instance_update_params.CustomMetadata] | Omit = omit,
+ embedding_model: Optional[
+ Literal[
+ "@cf/qwen/qwen3-embedding-0.6b",
+ "@cf/baai/bge-m3",
+ "@cf/baai/bge-large-en-v1.5",
+ "@cf/google/embeddinggemma-300m",
+ "google-ai-studio/gemini-embedding-001",
+ "google-ai-studio/gemini-embedding-2-preview",
+ "openai/text-embedding-3-small",
+ "openai/text-embedding-3-large",
+ "",
+ ]
+ ]
+ | Omit = omit,
+ fusion_method: Literal["max", "rrf"] | Omit = omit,
+ index_method: instance_update_params.IndexMethod | Omit = omit,
+ indexing_options: Optional[instance_update_params.IndexingOptions] | Omit = omit,
+ max_num_results: int | Omit = omit,
+ metadata: instance_update_params.Metadata | Omit = omit,
+ paused: bool | Omit = omit,
+ public_endpoint_params: instance_update_params.PublicEndpointParams | Omit = omit,
+ reranking: bool | Omit = omit,
+ reranking_model: Optional[Literal["@cf/baai/bge-reranker-base", ""]] | Omit = omit,
+ retrieval_options: Optional[instance_update_params.RetrievalOptions] | Omit = omit,
+ rewrite_model: Optional[
+ Literal[
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
+ "@cf/zai-org/glm-4.7-flash",
+ "@cf/meta/llama-3.1-8b-instruct-fast",
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
+ "@cf/qwen/qwen3-30b-a3b-fp8",
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
+ "@cf/moonshotai/kimi-k2-instruct",
+ "@cf/google/gemma-3-12b-it",
+ "@cf/google/gemma-4-26b-a4b-it",
+ "@cf/moonshotai/kimi-k2.5",
+ "anthropic/claude-3-7-sonnet",
+ "anthropic/claude-sonnet-4",
+ "anthropic/claude-opus-4",
+ "anthropic/claude-3-5-haiku",
+ "cerebras/qwen-3-235b-a22b-instruct",
+ "cerebras/qwen-3-235b-a22b-thinking",
+ "cerebras/llama-3.3-70b",
+ "cerebras/llama-4-maverick-17b-128e-instruct",
+ "cerebras/llama-4-scout-17b-16e-instruct",
+ "cerebras/gpt-oss-120b",
+ "google-ai-studio/gemini-2.5-flash",
+ "google-ai-studio/gemini-2.5-pro",
+ "grok/grok-4",
+ "groq/llama-3.3-70b-versatile",
+ "groq/llama-3.1-8b-instant",
+ "openai/gpt-5",
+ "openai/gpt-5-mini",
+ "openai/gpt-5-nano",
+ "",
+ ]
+ ]
+ | Omit = omit,
+ rewrite_query: bool | Omit = omit,
+ score_threshold: float | Omit = omit,
+ source_params: Optional[instance_update_params.SourceParams] | Omit = omit,
+ summarization: bool | Omit = omit,
+ summarization_model: Optional[
+ Literal[
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
+ "@cf/zai-org/glm-4.7-flash",
+ "@cf/meta/llama-3.1-8b-instruct-fast",
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
+ "@cf/qwen/qwen3-30b-a3b-fp8",
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
+ "@cf/moonshotai/kimi-k2-instruct",
+ "@cf/google/gemma-3-12b-it",
+ "@cf/google/gemma-4-26b-a4b-it",
+ "@cf/moonshotai/kimi-k2.5",
+ "anthropic/claude-3-7-sonnet",
+ "anthropic/claude-sonnet-4",
+ "anthropic/claude-opus-4",
+ "anthropic/claude-3-5-haiku",
+ "cerebras/qwen-3-235b-a22b-instruct",
+ "cerebras/qwen-3-235b-a22b-thinking",
+ "cerebras/llama-3.3-70b",
+ "cerebras/llama-4-maverick-17b-128e-instruct",
+ "cerebras/llama-4-scout-17b-16e-instruct",
+ "cerebras/gpt-oss-120b",
+ "google-ai-studio/gemini-2.5-flash",
+ "google-ai-studio/gemini-2.5-pro",
+ "grok/grok-4",
+ "groq/llama-3.3-70b-versatile",
+ "groq/llama-3.1-8b-instant",
+ "openai/gpt-5",
+ "openai/gpt-5-mini",
+ "openai/gpt-5-nano",
+ "",
+ ]
+ ]
+ | Omit = omit,
+ sync_interval: Literal[900, 1800, 3600, 7200, 14400, 21600, 43200, 86400] | Omit = omit,
+ system_prompt_aisearch: Optional[str] | Omit = omit,
+ system_prompt_index_summarization: Optional[str] | Omit = omit,
+ system_prompt_rewrite_query: Optional[str] | Omit = omit,
+ token_id: str | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> InstanceUpdateResponse:
+ """Update instances.
+
+ Args:
+ id: AI Search instance ID.
+
+ Lowercase alphanumeric, hyphens, and underscores.
+
+ index_method: Controls which storage backends are used during indexing. Defaults to
+ vector-only.
+
+ sync_interval: Interval between automatic syncs, in seconds. Allowed values: 900 (15min), 1800
+ (30min), 3600 (1h), 7200 (2h), 14400 (4h), 21600 (6h), 43200 (12h), 86400 (24h).
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ return self._put(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}",
+ account_id=account_id,
+ name=name,
+ id=id,
+ ),
+ body=maybe_transform(
+ {
+ "ai_gateway_id": ai_gateway_id,
+ "aisearch_model": aisearch_model,
+ "cache": cache,
+ "cache_threshold": cache_threshold,
+ "chunk": chunk,
+ "chunk_overlap": chunk_overlap,
+ "chunk_size": chunk_size,
+ "custom_metadata": custom_metadata,
+ "embedding_model": embedding_model,
+ "fusion_method": fusion_method,
+ "index_method": index_method,
+ "indexing_options": indexing_options,
+ "max_num_results": max_num_results,
+ "metadata": metadata,
+ "paused": paused,
+ "public_endpoint_params": public_endpoint_params,
+ "reranking": reranking,
+ "reranking_model": reranking_model,
+ "retrieval_options": retrieval_options,
+ "rewrite_model": rewrite_model,
+ "rewrite_query": rewrite_query,
+ "score_threshold": score_threshold,
+ "source_params": source_params,
+ "summarization": summarization,
+ "summarization_model": summarization_model,
+ "sync_interval": sync_interval,
+ "system_prompt_aisearch": system_prompt_aisearch,
+ "system_prompt_index_summarization": system_prompt_index_summarization,
+ "system_prompt_rewrite_query": system_prompt_rewrite_query,
+ "token_id": token_id,
+ },
+ instance_update_params.InstanceUpdateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[InstanceUpdateResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[InstanceUpdateResponse], ResultWrapper[InstanceUpdateResponse]),
+ )
+
+ def list(
+ self,
+ name: str,
+ *,
+ account_id: str | None = None,
+ namespace: Optional[str] | Omit = omit,
+ order_by: Literal["created_at"] | Omit = omit,
+ order_by_direction: Literal["asc", "desc"] | Omit = omit,
+ page: int | Omit = omit,
+ per_page: int | Omit = omit,
+ search: str | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> SyncV4PagePaginationArray[InstanceListResponse]:
+ """
+ List instances.
+
+ Args:
+ order_by: Order By Column Name
+
+ order_by_direction: Order By Direction
+
+ search: Search by id
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ return self._get_api_list(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances", account_id=account_id, name=name
+ ),
+ page=SyncV4PagePaginationArray[InstanceListResponse],
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "namespace": namespace,
+ "order_by": order_by,
+ "order_by_direction": order_by_direction,
+ "page": page,
+ "per_page": per_page,
+ "search": search,
+ },
+ instance_list_params.InstanceListParams,
+ ),
+ ),
+ model=InstanceListResponse,
+ )
+
+ def delete(
+ self,
+ id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> InstanceDeleteResponse:
+ """Delete instances.
+
+ Args:
+ id: AI Search instance ID.
+
+ Lowercase alphanumeric, hyphens, and underscores.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ return self._delete(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}",
+ account_id=account_id,
+ name=name,
+ id=id,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[InstanceDeleteResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[InstanceDeleteResponse], ResultWrapper[InstanceDeleteResponse]),
+ )
+
+ def chat_completions(
+ self,
+ id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ messages: Iterable[instance_chat_completions_params.Message],
+ aisearch_options: instance_chat_completions_params.AISearchOptions | Omit = omit,
+ model: Literal[
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
+ "@cf/zai-org/glm-4.7-flash",
+ "@cf/meta/llama-3.1-8b-instruct-fast",
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
+ "@cf/qwen/qwen3-30b-a3b-fp8",
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
+ "@cf/moonshotai/kimi-k2-instruct",
+ "@cf/google/gemma-3-12b-it",
+ "@cf/google/gemma-4-26b-a4b-it",
+ "@cf/moonshotai/kimi-k2.5",
+ "anthropic/claude-3-7-sonnet",
+ "anthropic/claude-sonnet-4",
+ "anthropic/claude-opus-4",
+ "anthropic/claude-3-5-haiku",
+ "cerebras/qwen-3-235b-a22b-instruct",
+ "cerebras/qwen-3-235b-a22b-thinking",
+ "cerebras/llama-3.3-70b",
+ "cerebras/llama-4-maverick-17b-128e-instruct",
+ "cerebras/llama-4-scout-17b-16e-instruct",
+ "cerebras/gpt-oss-120b",
+ "google-ai-studio/gemini-2.5-flash",
+ "google-ai-studio/gemini-2.5-pro",
+ "grok/grok-4",
+ "groq/llama-3.3-70b-versatile",
+ "groq/llama-3.1-8b-instant",
+ "openai/gpt-5",
+ "openai/gpt-5-mini",
+ "openai/gpt-5-nano",
+ "",
+ ]
+ | Omit = omit,
+ stream: bool | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> InstanceChatCompletionsResponse:
+ """
+ Performs a chat completion request against an AI Search instance, using indexed
+ content as context for generating responses.
+
+ Args:
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ return self._post(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/chat/completions",
+ account_id=account_id,
+ name=name,
+ id=id,
+ ),
+ body=maybe_transform(
+ {
+ "messages": messages,
+ "aisearch_options": aisearch_options,
+ "model": model,
+ "stream": stream,
+ },
+ instance_chat_completions_params.InstanceChatCompletionsParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=InstanceChatCompletionsResponse,
+ )
+
+ def read(
+ self,
+ id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> InstanceReadResponse:
+ """Read instances.
+
+ Args:
+ id: AI Search instance ID.
+
+ Lowercase alphanumeric, hyphens, and underscores.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ return self._get(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}",
+ account_id=account_id,
+ name=name,
+ id=id,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[InstanceReadResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[InstanceReadResponse], ResultWrapper[InstanceReadResponse]),
+ )
+
+ def search(
+ self,
+ id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ aisearch_options: instance_search_params.AISearchOptions | Omit = omit,
+ messages: Iterable[instance_search_params.Message] | Omit = omit,
+ query: str | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> InstanceSearchResponse:
+ """
+ Executes a semantic search query against an AI Search instance to find relevant
+ indexed content.
+
+ Args:
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
+
+ query: A simple text query string. Alternative to 'messages' — provide either this or
+ 'messages', not both.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ return self._post(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/search",
+ account_id=account_id,
+ name=name,
+ id=id,
+ ),
+ body=maybe_transform(
+ {
+ "aisearch_options": aisearch_options,
+ "messages": messages,
+ "query": query,
+ },
+ instance_search_params.InstanceSearchParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[InstanceSearchResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[InstanceSearchResponse], ResultWrapper[InstanceSearchResponse]),
+ )
+
+ def stats(
+ self,
+ id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> InstanceStatsResponse:
+ """
+ Retrieves usage statistics for AI Search instances.
+
+ Args:
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ return self._get(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/stats",
+ account_id=account_id,
+ name=name,
+ id=id,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[InstanceStatsResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[InstanceStatsResponse], ResultWrapper[InstanceStatsResponse]),
+ )
+
+
+class AsyncInstancesResource(AsyncAPIResource):
+ @cached_property
+ def jobs(self) -> AsyncJobsResource:
+ return AsyncJobsResource(self._client)
+
+ @cached_property
+ def items(self) -> AsyncItemsResource:
+ return AsyncItemsResource(self._client)
+
+ @cached_property
+ def with_raw_response(self) -> AsyncInstancesResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncInstancesResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncInstancesResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return AsyncInstancesResourceWithStreamingResponse(self)
+
+ async def create(
+ self,
+ name: str,
+ *,
+ account_id: str | None = None,
+ id: str,
+ ai_gateway_id: Optional[str] | Omit = omit,
+ aisearch_model: Optional[
+ Literal[
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
+ "@cf/zai-org/glm-4.7-flash",
+ "@cf/meta/llama-3.1-8b-instruct-fast",
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
+ "@cf/qwen/qwen3-30b-a3b-fp8",
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
+ "@cf/moonshotai/kimi-k2-instruct",
+ "@cf/google/gemma-3-12b-it",
+ "@cf/google/gemma-4-26b-a4b-it",
+ "@cf/moonshotai/kimi-k2.5",
+ "anthropic/claude-3-7-sonnet",
+ "anthropic/claude-sonnet-4",
+ "anthropic/claude-opus-4",
+ "anthropic/claude-3-5-haiku",
+ "cerebras/qwen-3-235b-a22b-instruct",
+ "cerebras/qwen-3-235b-a22b-thinking",
+ "cerebras/llama-3.3-70b",
+ "cerebras/llama-4-maverick-17b-128e-instruct",
+ "cerebras/llama-4-scout-17b-16e-instruct",
+ "cerebras/gpt-oss-120b",
+ "google-ai-studio/gemini-2.5-flash",
+ "google-ai-studio/gemini-2.5-pro",
+ "grok/grok-4",
+ "groq/llama-3.3-70b-versatile",
+ "groq/llama-3.1-8b-instant",
+ "openai/gpt-5",
+ "openai/gpt-5-mini",
+ "openai/gpt-5-nano",
+ "",
+ ]
+ ]
+ | Omit = omit,
+ cache: bool | Omit = omit,
+ cache_threshold: Literal["super_strict_match", "close_enough", "flexible_friend", "anything_goes"]
+ | Omit = omit,
+ chunk: bool | Omit = omit,
+ chunk_overlap: int | Omit = omit,
+ chunk_size: int | Omit = omit,
+ custom_metadata: Iterable[instance_create_params.CustomMetadata] | Omit = omit,
+ embedding_model: Optional[
+ Literal[
+ "@cf/qwen/qwen3-embedding-0.6b",
+ "@cf/baai/bge-m3",
+ "@cf/baai/bge-large-en-v1.5",
+ "@cf/google/embeddinggemma-300m",
+ "google-ai-studio/gemini-embedding-001",
+ "google-ai-studio/gemini-embedding-2-preview",
+ "openai/text-embedding-3-small",
+ "openai/text-embedding-3-large",
+ "",
+ ]
+ ]
+ | Omit = omit,
+ fusion_method: Literal["max", "rrf"] | Omit = omit,
+ hybrid_search_enabled: bool | Omit = omit,
+ index_method: instance_create_params.IndexMethod | Omit = omit,
+ indexing_options: Optional[instance_create_params.IndexingOptions] | Omit = omit,
+ max_num_results: int | Omit = omit,
+ metadata: instance_create_params.Metadata | Omit = omit,
+ public_endpoint_params: instance_create_params.PublicEndpointParams | Omit = omit,
+ reranking: bool | Omit = omit,
+ reranking_model: Optional[Literal["@cf/baai/bge-reranker-base", ""]] | Omit = omit,
+ retrieval_options: Optional[instance_create_params.RetrievalOptions] | Omit = omit,
+ rewrite_model: Optional[
+ Literal[
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
+ "@cf/zai-org/glm-4.7-flash",
+ "@cf/meta/llama-3.1-8b-instruct-fast",
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
+ "@cf/qwen/qwen3-30b-a3b-fp8",
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
+ "@cf/moonshotai/kimi-k2-instruct",
+ "@cf/google/gemma-3-12b-it",
+ "@cf/google/gemma-4-26b-a4b-it",
+ "@cf/moonshotai/kimi-k2.5",
+ "anthropic/claude-3-7-sonnet",
+ "anthropic/claude-sonnet-4",
+ "anthropic/claude-opus-4",
+ "anthropic/claude-3-5-haiku",
+ "cerebras/qwen-3-235b-a22b-instruct",
+ "cerebras/qwen-3-235b-a22b-thinking",
+ "cerebras/llama-3.3-70b",
+ "cerebras/llama-4-maverick-17b-128e-instruct",
+ "cerebras/llama-4-scout-17b-16e-instruct",
+ "cerebras/gpt-oss-120b",
+ "google-ai-studio/gemini-2.5-flash",
+ "google-ai-studio/gemini-2.5-pro",
+ "grok/grok-4",
+ "groq/llama-3.3-70b-versatile",
+ "groq/llama-3.1-8b-instant",
+ "openai/gpt-5",
+ "openai/gpt-5-mini",
+ "openai/gpt-5-nano",
+ "",
+ ]
+ ]
+ | Omit = omit,
+ rewrite_query: bool | Omit = omit,
+ score_threshold: float | Omit = omit,
+ source: Optional[str] | Omit = omit,
+ source_params: Optional[instance_create_params.SourceParams] | Omit = omit,
+ sync_interval: Literal[900, 1800, 3600, 7200, 14400, 21600, 43200, 86400] | Omit = omit,
+ token_id: str | Omit = omit,
+ type: Optional[Literal["r2", "web-crawler"]] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> InstanceCreateResponse:
+ """Create a new instances.
+
+ Args:
+ id: AI Search instance ID.
+
+ Lowercase alphanumeric, hyphens, and underscores.
+
+ hybrid_search_enabled: Deprecated — use index_method instead.
+
+ index_method: Controls which storage backends are used during indexing. Defaults to
+ vector-only.
+
+ sync_interval: Interval between automatic syncs, in seconds. Allowed values: 900 (15min), 1800
+ (30min), 3600 (1h), 7200 (2h), 14400 (4h), 21600 (6h), 43200 (12h), 86400 (24h).
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ return await self._post(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances", account_id=account_id, name=name
+ ),
+ body=await async_maybe_transform(
+ {
+ "id": id,
+ "ai_gateway_id": ai_gateway_id,
+ "aisearch_model": aisearch_model,
+ "cache": cache,
+ "cache_threshold": cache_threshold,
+ "chunk": chunk,
+ "chunk_overlap": chunk_overlap,
+ "chunk_size": chunk_size,
+ "custom_metadata": custom_metadata,
+ "embedding_model": embedding_model,
+ "fusion_method": fusion_method,
+ "hybrid_search_enabled": hybrid_search_enabled,
+ "index_method": index_method,
+ "indexing_options": indexing_options,
+ "max_num_results": max_num_results,
+ "metadata": metadata,
+ "public_endpoint_params": public_endpoint_params,
+ "reranking": reranking,
+ "reranking_model": reranking_model,
+ "retrieval_options": retrieval_options,
+ "rewrite_model": rewrite_model,
+ "rewrite_query": rewrite_query,
+ "score_threshold": score_threshold,
+ "source": source,
+ "source_params": source_params,
+ "sync_interval": sync_interval,
+ "token_id": token_id,
+ "type": type,
+ },
+ instance_create_params.InstanceCreateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[InstanceCreateResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[InstanceCreateResponse], ResultWrapper[InstanceCreateResponse]),
+ )
+
+ async def update(
+ self,
+ id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ ai_gateway_id: Optional[str] | Omit = omit,
+ aisearch_model: Optional[
+ Literal[
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
+ "@cf/zai-org/glm-4.7-flash",
+ "@cf/meta/llama-3.1-8b-instruct-fast",
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
+ "@cf/qwen/qwen3-30b-a3b-fp8",
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
+ "@cf/moonshotai/kimi-k2-instruct",
+ "@cf/google/gemma-3-12b-it",
+ "@cf/google/gemma-4-26b-a4b-it",
+ "@cf/moonshotai/kimi-k2.5",
+ "anthropic/claude-3-7-sonnet",
+ "anthropic/claude-sonnet-4",
+ "anthropic/claude-opus-4",
+ "anthropic/claude-3-5-haiku",
+ "cerebras/qwen-3-235b-a22b-instruct",
+ "cerebras/qwen-3-235b-a22b-thinking",
+ "cerebras/llama-3.3-70b",
+ "cerebras/llama-4-maverick-17b-128e-instruct",
+ "cerebras/llama-4-scout-17b-16e-instruct",
+ "cerebras/gpt-oss-120b",
+ "google-ai-studio/gemini-2.5-flash",
+ "google-ai-studio/gemini-2.5-pro",
+ "grok/grok-4",
+ "groq/llama-3.3-70b-versatile",
+ "groq/llama-3.1-8b-instant",
+ "openai/gpt-5",
+ "openai/gpt-5-mini",
+ "openai/gpt-5-nano",
+ "",
+ ]
+ ]
+ | Omit = omit,
+ cache: bool | Omit = omit,
+ cache_threshold: Literal["super_strict_match", "close_enough", "flexible_friend", "anything_goes"]
+ | Omit = omit,
+ chunk: bool | Omit = omit,
+ chunk_overlap: int | Omit = omit,
+ chunk_size: int | Omit = omit,
+ custom_metadata: Iterable[instance_update_params.CustomMetadata] | Omit = omit,
+ embedding_model: Optional[
+ Literal[
+ "@cf/qwen/qwen3-embedding-0.6b",
+ "@cf/baai/bge-m3",
+ "@cf/baai/bge-large-en-v1.5",
+ "@cf/google/embeddinggemma-300m",
+ "google-ai-studio/gemini-embedding-001",
+ "google-ai-studio/gemini-embedding-2-preview",
+ "openai/text-embedding-3-small",
+ "openai/text-embedding-3-large",
+ "",
+ ]
+ ]
+ | Omit = omit,
+ fusion_method: Literal["max", "rrf"] | Omit = omit,
+ index_method: instance_update_params.IndexMethod | Omit = omit,
+ indexing_options: Optional[instance_update_params.IndexingOptions] | Omit = omit,
+ max_num_results: int | Omit = omit,
+ metadata: instance_update_params.Metadata | Omit = omit,
+ paused: bool | Omit = omit,
+ public_endpoint_params: instance_update_params.PublicEndpointParams | Omit = omit,
+ reranking: bool | Omit = omit,
+ reranking_model: Optional[Literal["@cf/baai/bge-reranker-base", ""]] | Omit = omit,
+ retrieval_options: Optional[instance_update_params.RetrievalOptions] | Omit = omit,
+ rewrite_model: Optional[
+ Literal[
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
+ "@cf/zai-org/glm-4.7-flash",
+ "@cf/meta/llama-3.1-8b-instruct-fast",
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
+ "@cf/qwen/qwen3-30b-a3b-fp8",
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
+ "@cf/moonshotai/kimi-k2-instruct",
+ "@cf/google/gemma-3-12b-it",
+ "@cf/google/gemma-4-26b-a4b-it",
+ "@cf/moonshotai/kimi-k2.5",
+ "anthropic/claude-3-7-sonnet",
+ "anthropic/claude-sonnet-4",
+ "anthropic/claude-opus-4",
+ "anthropic/claude-3-5-haiku",
+ "cerebras/qwen-3-235b-a22b-instruct",
+ "cerebras/qwen-3-235b-a22b-thinking",
+ "cerebras/llama-3.3-70b",
+ "cerebras/llama-4-maverick-17b-128e-instruct",
+ "cerebras/llama-4-scout-17b-16e-instruct",
+ "cerebras/gpt-oss-120b",
+ "google-ai-studio/gemini-2.5-flash",
+ "google-ai-studio/gemini-2.5-pro",
+ "grok/grok-4",
+ "groq/llama-3.3-70b-versatile",
+ "groq/llama-3.1-8b-instant",
+ "openai/gpt-5",
+ "openai/gpt-5-mini",
+ "openai/gpt-5-nano",
+ "",
+ ]
+ ]
+ | Omit = omit,
+ rewrite_query: bool | Omit = omit,
+ score_threshold: float | Omit = omit,
+ source_params: Optional[instance_update_params.SourceParams] | Omit = omit,
+ summarization: bool | Omit = omit,
+ summarization_model: Optional[
+ Literal[
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
+ "@cf/zai-org/glm-4.7-flash",
+ "@cf/meta/llama-3.1-8b-instruct-fast",
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
+ "@cf/qwen/qwen3-30b-a3b-fp8",
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
+ "@cf/moonshotai/kimi-k2-instruct",
+ "@cf/google/gemma-3-12b-it",
+ "@cf/google/gemma-4-26b-a4b-it",
+ "@cf/moonshotai/kimi-k2.5",
+ "anthropic/claude-3-7-sonnet",
+ "anthropic/claude-sonnet-4",
+ "anthropic/claude-opus-4",
+ "anthropic/claude-3-5-haiku",
+ "cerebras/qwen-3-235b-a22b-instruct",
+ "cerebras/qwen-3-235b-a22b-thinking",
+ "cerebras/llama-3.3-70b",
+ "cerebras/llama-4-maverick-17b-128e-instruct",
+ "cerebras/llama-4-scout-17b-16e-instruct",
+ "cerebras/gpt-oss-120b",
+ "google-ai-studio/gemini-2.5-flash",
+ "google-ai-studio/gemini-2.5-pro",
+ "grok/grok-4",
+ "groq/llama-3.3-70b-versatile",
+ "groq/llama-3.1-8b-instant",
+ "openai/gpt-5",
+ "openai/gpt-5-mini",
+ "openai/gpt-5-nano",
+ "",
+ ]
+ ]
+ | Omit = omit,
+ sync_interval: Literal[900, 1800, 3600, 7200, 14400, 21600, 43200, 86400] | Omit = omit,
+ system_prompt_aisearch: Optional[str] | Omit = omit,
+ system_prompt_index_summarization: Optional[str] | Omit = omit,
+ system_prompt_rewrite_query: Optional[str] | Omit = omit,
+ token_id: str | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> InstanceUpdateResponse:
+ """Update instances.
+
+ Args:
+ id: AI Search instance ID.
+
+ Lowercase alphanumeric, hyphens, and underscores.
+
+ index_method: Controls which storage backends are used during indexing. Defaults to
+ vector-only.
+
+ sync_interval: Interval between automatic syncs, in seconds. Allowed values: 900 (15min), 1800
+ (30min), 3600 (1h), 7200 (2h), 14400 (4h), 21600 (6h), 43200 (12h), 86400 (24h).
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ return await self._put(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}",
+ account_id=account_id,
+ name=name,
+ id=id,
+ ),
+ body=await async_maybe_transform(
+ {
+ "ai_gateway_id": ai_gateway_id,
+ "aisearch_model": aisearch_model,
+ "cache": cache,
+ "cache_threshold": cache_threshold,
+ "chunk": chunk,
+ "chunk_overlap": chunk_overlap,
+ "chunk_size": chunk_size,
+ "custom_metadata": custom_metadata,
+ "embedding_model": embedding_model,
+ "fusion_method": fusion_method,
+ "index_method": index_method,
+ "indexing_options": indexing_options,
+ "max_num_results": max_num_results,
+ "metadata": metadata,
+ "paused": paused,
+ "public_endpoint_params": public_endpoint_params,
+ "reranking": reranking,
+ "reranking_model": reranking_model,
+ "retrieval_options": retrieval_options,
+ "rewrite_model": rewrite_model,
+ "rewrite_query": rewrite_query,
+ "score_threshold": score_threshold,
+ "source_params": source_params,
+ "summarization": summarization,
+ "summarization_model": summarization_model,
+ "sync_interval": sync_interval,
+ "system_prompt_aisearch": system_prompt_aisearch,
+ "system_prompt_index_summarization": system_prompt_index_summarization,
+ "system_prompt_rewrite_query": system_prompt_rewrite_query,
+ "token_id": token_id,
+ },
+ instance_update_params.InstanceUpdateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[InstanceUpdateResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[InstanceUpdateResponse], ResultWrapper[InstanceUpdateResponse]),
+ )
+
+ def list(
+ self,
+ name: str,
+ *,
+ account_id: str | None = None,
+ namespace: Optional[str] | Omit = omit,
+ order_by: Literal["created_at"] | Omit = omit,
+ order_by_direction: Literal["asc", "desc"] | Omit = omit,
+ page: int | Omit = omit,
+ per_page: int | Omit = omit,
+ search: str | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> AsyncPaginator[InstanceListResponse, AsyncV4PagePaginationArray[InstanceListResponse]]:
+ """
+ List instances.
+
+ Args:
+ order_by: Order By Column Name
+
+ order_by_direction: Order By Direction
+
+ search: Search by id
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ return self._get_api_list(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances", account_id=account_id, name=name
+ ),
+ page=AsyncV4PagePaginationArray[InstanceListResponse],
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "namespace": namespace,
+ "order_by": order_by,
+ "order_by_direction": order_by_direction,
+ "page": page,
+ "per_page": per_page,
+ "search": search,
+ },
+ instance_list_params.InstanceListParams,
+ ),
+ ),
+ model=InstanceListResponse,
+ )
+
+ async def delete(
+ self,
+ id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> InstanceDeleteResponse:
+ """Delete instances.
+
+ Args:
+ id: AI Search instance ID.
+
+ Lowercase alphanumeric, hyphens, and underscores.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ return await self._delete(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}",
+ account_id=account_id,
+ name=name,
+ id=id,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[InstanceDeleteResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[InstanceDeleteResponse], ResultWrapper[InstanceDeleteResponse]),
+ )
+
+ async def chat_completions(
+ self,
+ id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ messages: Iterable[instance_chat_completions_params.Message],
+ aisearch_options: instance_chat_completions_params.AISearchOptions | Omit = omit,
+ model: Literal[
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
+ "@cf/zai-org/glm-4.7-flash",
+ "@cf/meta/llama-3.1-8b-instruct-fast",
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
+ "@cf/qwen/qwen3-30b-a3b-fp8",
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
+ "@cf/moonshotai/kimi-k2-instruct",
+ "@cf/google/gemma-3-12b-it",
+ "@cf/google/gemma-4-26b-a4b-it",
+ "@cf/moonshotai/kimi-k2.5",
+ "anthropic/claude-3-7-sonnet",
+ "anthropic/claude-sonnet-4",
+ "anthropic/claude-opus-4",
+ "anthropic/claude-3-5-haiku",
+ "cerebras/qwen-3-235b-a22b-instruct",
+ "cerebras/qwen-3-235b-a22b-thinking",
+ "cerebras/llama-3.3-70b",
+ "cerebras/llama-4-maverick-17b-128e-instruct",
+ "cerebras/llama-4-scout-17b-16e-instruct",
+ "cerebras/gpt-oss-120b",
+ "google-ai-studio/gemini-2.5-flash",
+ "google-ai-studio/gemini-2.5-pro",
+ "grok/grok-4",
+ "groq/llama-3.3-70b-versatile",
+ "groq/llama-3.1-8b-instant",
+ "openai/gpt-5",
+ "openai/gpt-5-mini",
+ "openai/gpt-5-nano",
+ "",
+ ]
+ | Omit = omit,
+ stream: bool | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> InstanceChatCompletionsResponse:
+ """
+ Performs a chat completion request against an AI Search instance, using indexed
+ content as context for generating responses.
+
+ Args:
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ return await self._post(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/chat/completions",
+ account_id=account_id,
+ name=name,
+ id=id,
+ ),
+ body=await async_maybe_transform(
+ {
+ "messages": messages,
+ "aisearch_options": aisearch_options,
+ "model": model,
+ "stream": stream,
+ },
+ instance_chat_completions_params.InstanceChatCompletionsParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=InstanceChatCompletionsResponse,
+ )
+
+ async def read(
+ self,
+ id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> InstanceReadResponse:
+ """Read instances.
+
+ Args:
+ id: AI Search instance ID.
+
+ Lowercase alphanumeric, hyphens, and underscores.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ return await self._get(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}",
+ account_id=account_id,
+ name=name,
+ id=id,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[InstanceReadResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[InstanceReadResponse], ResultWrapper[InstanceReadResponse]),
+ )
+
+ async def search(
+ self,
+ id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ aisearch_options: instance_search_params.AISearchOptions | Omit = omit,
+ messages: Iterable[instance_search_params.Message] | Omit = omit,
+ query: str | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> InstanceSearchResponse:
+ """
+ Executes a semantic search query against an AI Search instance to find relevant
+ indexed content.
+
+ Args:
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
+
+ query: A simple text query string. Alternative to 'messages' — provide either this or
+ 'messages', not both.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ return await self._post(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/search",
+ account_id=account_id,
+ name=name,
+ id=id,
+ ),
+ body=await async_maybe_transform(
+ {
+ "aisearch_options": aisearch_options,
+ "messages": messages,
+ "query": query,
+ },
+ instance_search_params.InstanceSearchParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[InstanceSearchResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[InstanceSearchResponse], ResultWrapper[InstanceSearchResponse]),
+ )
+
+ async def stats(
+ self,
+ id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> InstanceStatsResponse:
+ """
+ Retrieves usage statistics for AI Search instances.
+
+ Args:
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ return await self._get(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/stats",
+ account_id=account_id,
+ name=name,
+ id=id,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[InstanceStatsResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[InstanceStatsResponse], ResultWrapper[InstanceStatsResponse]),
+ )
+
+
+class InstancesResourceWithRawResponse:
+ def __init__(self, instances: InstancesResource) -> None:
+ self._instances = instances
+
+ self.create = to_raw_response_wrapper(
+ instances.create,
+ )
+ self.update = to_raw_response_wrapper(
+ instances.update,
+ )
+ self.list = to_raw_response_wrapper(
+ instances.list,
+ )
+ self.delete = to_raw_response_wrapper(
+ instances.delete,
+ )
+ self.chat_completions = to_raw_response_wrapper(
+ instances.chat_completions,
+ )
+ self.read = to_raw_response_wrapper(
+ instances.read,
+ )
+ self.search = to_raw_response_wrapper(
+ instances.search,
+ )
+ self.stats = to_raw_response_wrapper(
+ instances.stats,
+ )
+
+ @cached_property
+ def jobs(self) -> JobsResourceWithRawResponse:
+ return JobsResourceWithRawResponse(self._instances.jobs)
+
+ @cached_property
+ def items(self) -> ItemsResourceWithRawResponse:
+ return ItemsResourceWithRawResponse(self._instances.items)
+
+
+class AsyncInstancesResourceWithRawResponse:
+ def __init__(self, instances: AsyncInstancesResource) -> None:
+ self._instances = instances
+
+ self.create = async_to_raw_response_wrapper(
+ instances.create,
+ )
+ self.update = async_to_raw_response_wrapper(
+ instances.update,
+ )
+ self.list = async_to_raw_response_wrapper(
+ instances.list,
+ )
+ self.delete = async_to_raw_response_wrapper(
+ instances.delete,
+ )
+ self.chat_completions = async_to_raw_response_wrapper(
+ instances.chat_completions,
+ )
+ self.read = async_to_raw_response_wrapper(
+ instances.read,
+ )
+ self.search = async_to_raw_response_wrapper(
+ instances.search,
+ )
+ self.stats = async_to_raw_response_wrapper(
+ instances.stats,
+ )
+
+ @cached_property
+ def jobs(self) -> AsyncJobsResourceWithRawResponse:
+ return AsyncJobsResourceWithRawResponse(self._instances.jobs)
+
+ @cached_property
+ def items(self) -> AsyncItemsResourceWithRawResponse:
+ return AsyncItemsResourceWithRawResponse(self._instances.items)
+
+
+class InstancesResourceWithStreamingResponse:
+ def __init__(self, instances: InstancesResource) -> None:
+ self._instances = instances
+
+ self.create = to_streamed_response_wrapper(
+ instances.create,
+ )
+ self.update = to_streamed_response_wrapper(
+ instances.update,
+ )
+ self.list = to_streamed_response_wrapper(
+ instances.list,
+ )
+ self.delete = to_streamed_response_wrapper(
+ instances.delete,
+ )
+ self.chat_completions = to_streamed_response_wrapper(
+ instances.chat_completions,
+ )
+ self.read = to_streamed_response_wrapper(
+ instances.read,
+ )
+ self.search = to_streamed_response_wrapper(
+ instances.search,
+ )
+ self.stats = to_streamed_response_wrapper(
+ instances.stats,
+ )
+
+ @cached_property
+ def jobs(self) -> JobsResourceWithStreamingResponse:
+ return JobsResourceWithStreamingResponse(self._instances.jobs)
+
+ @cached_property
+ def items(self) -> ItemsResourceWithStreamingResponse:
+ return ItemsResourceWithStreamingResponse(self._instances.items)
+
+
+class AsyncInstancesResourceWithStreamingResponse:
+ def __init__(self, instances: AsyncInstancesResource) -> None:
+ self._instances = instances
+
+ self.create = async_to_streamed_response_wrapper(
+ instances.create,
+ )
+ self.update = async_to_streamed_response_wrapper(
+ instances.update,
+ )
+ self.list = async_to_streamed_response_wrapper(
+ instances.list,
+ )
+ self.delete = async_to_streamed_response_wrapper(
+ instances.delete,
+ )
+ self.chat_completions = async_to_streamed_response_wrapper(
+ instances.chat_completions,
+ )
+ self.read = async_to_streamed_response_wrapper(
+ instances.read,
+ )
+ self.search = async_to_streamed_response_wrapper(
+ instances.search,
+ )
+ self.stats = async_to_streamed_response_wrapper(
+ instances.stats,
+ )
+
+ @cached_property
+ def jobs(self) -> AsyncJobsResourceWithStreamingResponse:
+ return AsyncJobsResourceWithStreamingResponse(self._instances.jobs)
+
+ @cached_property
+ def items(self) -> AsyncItemsResourceWithStreamingResponse:
+ return AsyncItemsResourceWithStreamingResponse(self._instances.items)
diff --git a/src/cloudflare/resources/aisearch/namespaces/instances/items.py b/src/cloudflare/resources/aisearch/namespaces/instances/items.py
new file mode 100644
index 00000000000..1fecc1e6539
--- /dev/null
+++ b/src/cloudflare/resources/aisearch/namespaces/instances/items.py
@@ -0,0 +1,1364 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Type, Mapping, cast
+from typing_extensions import Literal
+
+import httpx
+
+from ....._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
+from ....._utils import extract_files, path_template, maybe_transform, deepcopy_minimal, async_maybe_transform
+from ....._compat import cached_property
+from ....._resource import SyncAPIResource, AsyncAPIResource
+from ....._response import (
+ BinaryAPIResponse,
+ AsyncBinaryAPIResponse,
+ StreamedBinaryAPIResponse,
+ AsyncStreamedBinaryAPIResponse,
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ to_custom_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+ to_custom_streamed_response_wrapper,
+ async_to_custom_raw_response_wrapper,
+ async_to_custom_streamed_response_wrapper,
+)
+from ....._wrappers import ResultWrapper
+from .....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray
+from ....._base_client import AsyncPaginator, make_request_options
+from .....types.aisearch.namespaces.instances import (
+ item_list_params,
+ item_logs_params,
+ item_sync_params,
+ item_chunks_params,
+ item_upload_params,
+ item_create_or_update_params,
+)
+from .....types.aisearch.namespaces.instances.item_get_response import ItemGetResponse
+from .....types.aisearch.namespaces.instances.item_list_response import ItemListResponse
+from .....types.aisearch.namespaces.instances.item_logs_response import ItemLogsResponse
+from .....types.aisearch.namespaces.instances.item_sync_response import ItemSyncResponse
+from .....types.aisearch.namespaces.instances.item_chunks_response import ItemChunksResponse
+from .....types.aisearch.namespaces.instances.item_delete_response import ItemDeleteResponse
+from .....types.aisearch.namespaces.instances.item_upload_response import ItemUploadResponse
+from .....types.aisearch.namespaces.instances.item_create_or_update_response import ItemCreateOrUpdateResponse
+
+__all__ = ["ItemsResource", "AsyncItemsResource"]
+
+
+class ItemsResource(SyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> ItemsResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return ItemsResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> ItemsResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return ItemsResourceWithStreamingResponse(self)
+
+ def list(
+ self,
+ id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ item_id: str | Omit = omit,
+ metadata_filter: str | Omit = omit,
+ page: int | Omit = omit,
+ per_page: int | Omit = omit,
+ search: str | Omit = omit,
+ sort_by: Literal["status", "modified_at"] | Omit = omit,
+ source: str | Omit = omit,
+ status: Literal["queued", "running", "completed", "error", "skipped", "outdated"] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> SyncV4PagePaginationArray[ItemListResponse]:
+ """Lists indexed items in an AI Search instance.
+
+ Args:
+ id: AI Search instance ID.
+
+ Lowercase alphanumeric, hyphens, and underscores.
+
+ item_id: Filter items by their unique ID. Returns at most one item.
+
+ metadata_filter:
+ JSON-encoded metadata filter using Vectorize filter syntax. Examples:
+ {"folder":"reports/"},
+ {"timestamp":{"$gte":1700000000000}}, {"folder":{"$in":["docs/","reports/"]}}
+
+ sort_by: Sort order for items. "status" (default) sorts by status priority then
+ last_seen_at. "modified_at" sorts by file modification time (most recent first),
+ falling back to created_at.
+
+ source: Filter items by source_id. Use "builtin" for uploaded files, or a source
+ identifier like "web-crawler:https://example.com".
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ return self._get_api_list(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/items",
+ account_id=account_id,
+ name=name,
+ id=id,
+ ),
+ page=SyncV4PagePaginationArray[ItemListResponse],
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "item_id": item_id,
+ "metadata_filter": metadata_filter,
+ "page": page,
+ "per_page": per_page,
+ "search": search,
+ "sort_by": sort_by,
+ "source": source,
+ "status": status,
+ },
+ item_list_params.ItemListParams,
+ ),
+ ),
+ model=ItemListResponse,
+ )
+
+ def delete(
+ self,
+ item_id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ id: str,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> ItemDeleteResponse:
+ """
+ Deletes a file from a managed AI Search instance and triggers a reindex.
+
+ Args:
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ if not item_id:
+ raise ValueError(f"Expected a non-empty value for `item_id` but received {item_id!r}")
+ return self._delete(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/items/{item_id}",
+ account_id=account_id,
+ name=name,
+ id=id,
+ item_id=item_id,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[ItemDeleteResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[ItemDeleteResponse], ResultWrapper[ItemDeleteResponse]),
+ )
+
+ def chunks(
+ self,
+ item_id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ id: str,
+ limit: int | Omit = omit,
+ offset: int | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> ItemChunksResponse:
+ """
+ Lists chunks for a specific item in an AI Search instance, including their text
+ content.
+
+ Args:
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ if not item_id:
+ raise ValueError(f"Expected a non-empty value for `item_id` but received {item_id!r}")
+ return self._get(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/items/{item_id}/chunks",
+ account_id=account_id,
+ name=name,
+ id=id,
+ item_id=item_id,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "limit": limit,
+ "offset": offset,
+ },
+ item_chunks_params.ItemChunksParams,
+ ),
+ post_parser=ResultWrapper[ItemChunksResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[ItemChunksResponse], ResultWrapper[ItemChunksResponse]),
+ )
+
+ def create_or_update(
+ self,
+ id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ key: str,
+ next_action: Literal["INDEX"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> ItemCreateOrUpdateResponse:
+ """
+ Creates or updates an indexed item in an AI Search instance.
+
+ Args:
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
+
+ key: Item key / filename. Must not exceed 128 characters.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ return self._put(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/items",
+ account_id=account_id,
+ name=name,
+ id=id,
+ ),
+ body=maybe_transform(
+ {
+ "key": key,
+ "next_action": next_action,
+ },
+ item_create_or_update_params.ItemCreateOrUpdateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[ItemCreateOrUpdateResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[ItemCreateOrUpdateResponse], ResultWrapper[ItemCreateOrUpdateResponse]),
+ )
+
+ def download(
+ self,
+ item_id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ id: str,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> BinaryAPIResponse:
+ """
+ Downloads the raw file content for a specific item from the managed AI Search
+ instance storage.
+
+ Args:
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ if not item_id:
+ raise ValueError(f"Expected a non-empty value for `item_id` but received {item_id!r}")
+ extra_headers = {"Accept": "application/octet-stream", **(extra_headers or {})}
+ return self._get(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/items/{item_id}/download",
+ account_id=account_id,
+ name=name,
+ id=id,
+ item_id=item_id,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=BinaryAPIResponse,
+ )
+
+ def get(
+ self,
+ item_id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ id: str,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> ItemGetResponse:
+ """
+ Retrieves a specific indexed item from an AI Search instance.
+
+ Args:
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ if not item_id:
+ raise ValueError(f"Expected a non-empty value for `item_id` but received {item_id!r}")
+ return self._get(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/items/{item_id}",
+ account_id=account_id,
+ name=name,
+ id=id,
+ item_id=item_id,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[ItemGetResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[ItemGetResponse], ResultWrapper[ItemGetResponse]),
+ )
+
+ def logs(
+ self,
+ item_id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ id: str,
+ cursor: str | Omit = omit,
+ limit: int | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> ItemLogsResponse:
+ """
+ Lists processing logs for a specific item in an AI Search instance.
+
+ Args:
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ if not item_id:
+ raise ValueError(f"Expected a non-empty value for `item_id` but received {item_id!r}")
+ return self._get(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/items/{item_id}/logs",
+ account_id=account_id,
+ name=name,
+ id=id,
+ item_id=item_id,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "cursor": cursor,
+ "limit": limit,
+ },
+ item_logs_params.ItemLogsParams,
+ ),
+ post_parser=ResultWrapper[ItemLogsResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[ItemLogsResponse], ResultWrapper[ItemLogsResponse]),
+ )
+
+ def sync(
+ self,
+ item_id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ id: str,
+ next_action: Literal["INDEX"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> ItemSyncResponse:
+ """Syncs an item to an AI Search instance index.
+
+ Args:
+ id: AI Search instance ID.
+
+ Lowercase alphanumeric, hyphens, and underscores.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ if not item_id:
+ raise ValueError(f"Expected a non-empty value for `item_id` but received {item_id!r}")
+ return self._patch(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/items/{item_id}",
+ account_id=account_id,
+ name=name,
+ id=id,
+ item_id=item_id,
+ ),
+ body=maybe_transform({"next_action": next_action}, item_sync_params.ItemSyncParams),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[ItemSyncResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[ItemSyncResponse], ResultWrapper[ItemSyncResponse]),
+ )
+
+ def upload(
+ self,
+ id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ file: item_upload_params.File,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> ItemUploadResponse:
+ """
+ Uploads a file to a managed AI Search instance via multipart/form-data (max
+ 4MB).
+
+ Args:
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ body = deepcopy_minimal(file)
+ files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
+ # It should be noted that the actual Content-Type header that will be
+ # sent to the server will contain a `boundary` parameter, e.g.
+ # multipart/form-data; boundary=---abc--
+ extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
+ return self._post(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/items",
+ account_id=account_id,
+ name=name,
+ id=id,
+ ),
+ body=maybe_transform(body, item_upload_params.ItemUploadParams),
+ files=files,
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[ItemUploadResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[ItemUploadResponse], ResultWrapper[ItemUploadResponse]),
+ )
+
+
+class AsyncItemsResource(AsyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> AsyncItemsResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncItemsResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncItemsResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return AsyncItemsResourceWithStreamingResponse(self)
+
+ def list(
+ self,
+ id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ item_id: str | Omit = omit,
+ metadata_filter: str | Omit = omit,
+ page: int | Omit = omit,
+ per_page: int | Omit = omit,
+ search: str | Omit = omit,
+ sort_by: Literal["status", "modified_at"] | Omit = omit,
+ source: str | Omit = omit,
+ status: Literal["queued", "running", "completed", "error", "skipped", "outdated"] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> AsyncPaginator[ItemListResponse, AsyncV4PagePaginationArray[ItemListResponse]]:
+ """Lists indexed items in an AI Search instance.
+
+ Args:
+ id: AI Search instance ID.
+
+ Lowercase alphanumeric, hyphens, and underscores.
+
+ item_id: Filter items by their unique ID. Returns at most one item.
+
+ metadata_filter:
+ JSON-encoded metadata filter using Vectorize filter syntax. Examples:
+ {"folder":"reports/"},
+ {"timestamp":{"$gte":1700000000000}}, {"folder":{"$in":["docs/","reports/"]}}
+
+ sort_by: Sort order for items. "status" (default) sorts by status priority then
+ last_seen_at. "modified_at" sorts by file modification time (most recent first),
+ falling back to created_at.
+
+ source: Filter items by source_id. Use "builtin" for uploaded files, or a source
+ identifier like "web-crawler:https://example.com".
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ return self._get_api_list(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/items",
+ account_id=account_id,
+ name=name,
+ id=id,
+ ),
+ page=AsyncV4PagePaginationArray[ItemListResponse],
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "item_id": item_id,
+ "metadata_filter": metadata_filter,
+ "page": page,
+ "per_page": per_page,
+ "search": search,
+ "sort_by": sort_by,
+ "source": source,
+ "status": status,
+ },
+ item_list_params.ItemListParams,
+ ),
+ ),
+ model=ItemListResponse,
+ )
+
+ async def delete(
+ self,
+ item_id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ id: str,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> ItemDeleteResponse:
+ """
+ Deletes a file from a managed AI Search instance and triggers a reindex.
+
+ Args:
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ if not item_id:
+ raise ValueError(f"Expected a non-empty value for `item_id` but received {item_id!r}")
+ return await self._delete(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/items/{item_id}",
+ account_id=account_id,
+ name=name,
+ id=id,
+ item_id=item_id,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[ItemDeleteResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[ItemDeleteResponse], ResultWrapper[ItemDeleteResponse]),
+ )
+
+ async def chunks(
+ self,
+ item_id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ id: str,
+ limit: int | Omit = omit,
+ offset: int | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> ItemChunksResponse:
+ """
+ Lists chunks for a specific item in an AI Search instance, including their text
+ content.
+
+ Args:
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ if not item_id:
+ raise ValueError(f"Expected a non-empty value for `item_id` but received {item_id!r}")
+ return await self._get(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/items/{item_id}/chunks",
+ account_id=account_id,
+ name=name,
+ id=id,
+ item_id=item_id,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=await async_maybe_transform(
+ {
+ "limit": limit,
+ "offset": offset,
+ },
+ item_chunks_params.ItemChunksParams,
+ ),
+ post_parser=ResultWrapper[ItemChunksResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[ItemChunksResponse], ResultWrapper[ItemChunksResponse]),
+ )
+
+ async def create_or_update(
+ self,
+ id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ key: str,
+ next_action: Literal["INDEX"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> ItemCreateOrUpdateResponse:
+ """
+ Creates or updates an indexed item in an AI Search instance.
+
+ Args:
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
+
+ key: Item key / filename. Must not exceed 128 characters.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ return await self._put(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/items",
+ account_id=account_id,
+ name=name,
+ id=id,
+ ),
+ body=await async_maybe_transform(
+ {
+ "key": key,
+ "next_action": next_action,
+ },
+ item_create_or_update_params.ItemCreateOrUpdateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[ItemCreateOrUpdateResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[ItemCreateOrUpdateResponse], ResultWrapper[ItemCreateOrUpdateResponse]),
+ )
+
+ async def download(
+ self,
+ item_id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ id: str,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> AsyncBinaryAPIResponse:
+ """
+ Downloads the raw file content for a specific item from the managed AI Search
+ instance storage.
+
+ Args:
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ if not item_id:
+ raise ValueError(f"Expected a non-empty value for `item_id` but received {item_id!r}")
+ extra_headers = {"Accept": "application/octet-stream", **(extra_headers or {})}
+ return await self._get(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/items/{item_id}/download",
+ account_id=account_id,
+ name=name,
+ id=id,
+ item_id=item_id,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=AsyncBinaryAPIResponse,
+ )
+
+ async def get(
+ self,
+ item_id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ id: str,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> ItemGetResponse:
+ """
+ Retrieves a specific indexed item from an AI Search instance.
+
+ Args:
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ if not item_id:
+ raise ValueError(f"Expected a non-empty value for `item_id` but received {item_id!r}")
+ return await self._get(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/items/{item_id}",
+ account_id=account_id,
+ name=name,
+ id=id,
+ item_id=item_id,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[ItemGetResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[ItemGetResponse], ResultWrapper[ItemGetResponse]),
+ )
+
+ async def logs(
+ self,
+ item_id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ id: str,
+ cursor: str | Omit = omit,
+ limit: int | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> ItemLogsResponse:
+ """
+ Lists processing logs for a specific item in an AI Search instance.
+
+ Args:
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ if not item_id:
+ raise ValueError(f"Expected a non-empty value for `item_id` but received {item_id!r}")
+ return await self._get(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/items/{item_id}/logs",
+ account_id=account_id,
+ name=name,
+ id=id,
+ item_id=item_id,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=await async_maybe_transform(
+ {
+ "cursor": cursor,
+ "limit": limit,
+ },
+ item_logs_params.ItemLogsParams,
+ ),
+ post_parser=ResultWrapper[ItemLogsResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[ItemLogsResponse], ResultWrapper[ItemLogsResponse]),
+ )
+
+ async def sync(
+ self,
+ item_id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ id: str,
+ next_action: Literal["INDEX"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> ItemSyncResponse:
+ """Syncs an item to an AI Search instance index.
+
+ Args:
+ id: AI Search instance ID.
+
+ Lowercase alphanumeric, hyphens, and underscores.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ if not item_id:
+ raise ValueError(f"Expected a non-empty value for `item_id` but received {item_id!r}")
+ return await self._patch(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/items/{item_id}",
+ account_id=account_id,
+ name=name,
+ id=id,
+ item_id=item_id,
+ ),
+ body=await async_maybe_transform({"next_action": next_action}, item_sync_params.ItemSyncParams),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[ItemSyncResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[ItemSyncResponse], ResultWrapper[ItemSyncResponse]),
+ )
+
+ async def upload(
+ self,
+ id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ file: item_upload_params.File,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> ItemUploadResponse:
+ """
+ Uploads a file to a managed AI Search instance via multipart/form-data (max
+ 4MB).
+
+ Args:
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ body = deepcopy_minimal(file)
+ files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
+ # It should be noted that the actual Content-Type header that will be
+ # sent to the server will contain a `boundary` parameter, e.g.
+ # multipart/form-data; boundary=---abc--
+ extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
+ return await self._post(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/items",
+ account_id=account_id,
+ name=name,
+ id=id,
+ ),
+ body=await async_maybe_transform(body, item_upload_params.ItemUploadParams),
+ files=files,
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[ItemUploadResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[ItemUploadResponse], ResultWrapper[ItemUploadResponse]),
+ )
+
+
+class ItemsResourceWithRawResponse:
+ def __init__(self, items: ItemsResource) -> None:
+ self._items = items
+
+ self.list = to_raw_response_wrapper(
+ items.list,
+ )
+ self.delete = to_raw_response_wrapper(
+ items.delete,
+ )
+ self.chunks = to_raw_response_wrapper(
+ items.chunks,
+ )
+ self.create_or_update = to_raw_response_wrapper(
+ items.create_or_update,
+ )
+ self.download = to_custom_raw_response_wrapper(
+ items.download,
+ BinaryAPIResponse,
+ )
+ self.get = to_raw_response_wrapper(
+ items.get,
+ )
+ self.logs = to_raw_response_wrapper(
+ items.logs,
+ )
+ self.sync = to_raw_response_wrapper(
+ items.sync,
+ )
+ self.upload = to_raw_response_wrapper(
+ items.upload,
+ )
+
+
+class AsyncItemsResourceWithRawResponse:
+ def __init__(self, items: AsyncItemsResource) -> None:
+ self._items = items
+
+ self.list = async_to_raw_response_wrapper(
+ items.list,
+ )
+ self.delete = async_to_raw_response_wrapper(
+ items.delete,
+ )
+ self.chunks = async_to_raw_response_wrapper(
+ items.chunks,
+ )
+ self.create_or_update = async_to_raw_response_wrapper(
+ items.create_or_update,
+ )
+ self.download = async_to_custom_raw_response_wrapper(
+ items.download,
+ AsyncBinaryAPIResponse,
+ )
+ self.get = async_to_raw_response_wrapper(
+ items.get,
+ )
+ self.logs = async_to_raw_response_wrapper(
+ items.logs,
+ )
+ self.sync = async_to_raw_response_wrapper(
+ items.sync,
+ )
+ self.upload = async_to_raw_response_wrapper(
+ items.upload,
+ )
+
+
+class ItemsResourceWithStreamingResponse:
+ def __init__(self, items: ItemsResource) -> None:
+ self._items = items
+
+ self.list = to_streamed_response_wrapper(
+ items.list,
+ )
+ self.delete = to_streamed_response_wrapper(
+ items.delete,
+ )
+ self.chunks = to_streamed_response_wrapper(
+ items.chunks,
+ )
+ self.create_or_update = to_streamed_response_wrapper(
+ items.create_or_update,
+ )
+ self.download = to_custom_streamed_response_wrapper(
+ items.download,
+ StreamedBinaryAPIResponse,
+ )
+ self.get = to_streamed_response_wrapper(
+ items.get,
+ )
+ self.logs = to_streamed_response_wrapper(
+ items.logs,
+ )
+ self.sync = to_streamed_response_wrapper(
+ items.sync,
+ )
+ self.upload = to_streamed_response_wrapper(
+ items.upload,
+ )
+
+
+class AsyncItemsResourceWithStreamingResponse:
+ def __init__(self, items: AsyncItemsResource) -> None:
+ self._items = items
+
+ self.list = async_to_streamed_response_wrapper(
+ items.list,
+ )
+ self.delete = async_to_streamed_response_wrapper(
+ items.delete,
+ )
+ self.chunks = async_to_streamed_response_wrapper(
+ items.chunks,
+ )
+ self.create_or_update = async_to_streamed_response_wrapper(
+ items.create_or_update,
+ )
+ self.download = async_to_custom_streamed_response_wrapper(
+ items.download,
+ AsyncStreamedBinaryAPIResponse,
+ )
+ self.get = async_to_streamed_response_wrapper(
+ items.get,
+ )
+ self.logs = async_to_streamed_response_wrapper(
+ items.logs,
+ )
+ self.sync = async_to_streamed_response_wrapper(
+ items.sync,
+ )
+ self.upload = async_to_streamed_response_wrapper(
+ items.upload,
+ )
diff --git a/src/cloudflare/resources/aisearch/namespaces/instances/jobs.py b/src/cloudflare/resources/aisearch/namespaces/instances/jobs.py
new file mode 100644
index 00000000000..a6e4af5bdbf
--- /dev/null
+++ b/src/cloudflare/resources/aisearch/namespaces/instances/jobs.py
@@ -0,0 +1,749 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Type, cast
+from typing_extensions import Literal
+
+import httpx
+
+from ....._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
+from ....._utils import path_template, maybe_transform, async_maybe_transform
+from ....._compat import cached_property
+from ....._resource import SyncAPIResource, AsyncAPIResource
+from ....._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from ....._wrappers import ResultWrapper
+from .....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray
+from ....._base_client import AsyncPaginator, make_request_options
+from .....types.aisearch.namespaces.instances import (
+ job_list_params,
+ job_logs_params,
+ job_create_params,
+ job_update_params,
+)
+from .....types.aisearch.namespaces.instances.job_get_response import JobGetResponse
+from .....types.aisearch.namespaces.instances.job_list_response import JobListResponse
+from .....types.aisearch.namespaces.instances.job_logs_response import JobLogsResponse
+from .....types.aisearch.namespaces.instances.job_create_response import JobCreateResponse
+from .....types.aisearch.namespaces.instances.job_update_response import JobUpdateResponse
+
+__all__ = ["JobsResource", "AsyncJobsResource"]
+
+
+class JobsResource(SyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> JobsResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return JobsResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> JobsResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return JobsResourceWithStreamingResponse(self)
+
+ def create(
+ self,
+ id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ description: str | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> JobCreateResponse:
+ """
+ Creates a new indexing job for an AI Search instance.
+
+ Args:
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ return self._post(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/jobs",
+ account_id=account_id,
+ name=name,
+ id=id,
+ ),
+ body=maybe_transform({"description": description}, job_create_params.JobCreateParams),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[JobCreateResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[JobCreateResponse], ResultWrapper[JobCreateResponse]),
+ )
+
+ def update(
+ self,
+ job_id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ id: str,
+ action: Literal["cancel"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> JobUpdateResponse:
+ """
+ Updates the status of an AI Search indexing job.
+
+ Args:
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ if not job_id:
+ raise ValueError(f"Expected a non-empty value for `job_id` but received {job_id!r}")
+ return self._patch(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/jobs/{job_id}",
+ account_id=account_id,
+ name=name,
+ id=id,
+ job_id=job_id,
+ ),
+ body=maybe_transform({"action": action}, job_update_params.JobUpdateParams),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[JobUpdateResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[JobUpdateResponse], ResultWrapper[JobUpdateResponse]),
+ )
+
+ def list(
+ self,
+ id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ page: int | Omit = omit,
+ per_page: int | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> SyncV4PagePaginationArray[JobListResponse]:
+ """
+ Lists indexing jobs for an AI Search instance.
+
+ Args:
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ return self._get_api_list(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/jobs",
+ account_id=account_id,
+ name=name,
+ id=id,
+ ),
+ page=SyncV4PagePaginationArray[JobListResponse],
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "page": page,
+ "per_page": per_page,
+ },
+ job_list_params.JobListParams,
+ ),
+ ),
+ model=JobListResponse,
+ )
+
+ def get(
+ self,
+ job_id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ id: str,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> JobGetResponse:
+ """
+ Retrieves details for a specific AI Search indexing job.
+
+ Args:
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ if not job_id:
+ raise ValueError(f"Expected a non-empty value for `job_id` but received {job_id!r}")
+ return self._get(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/jobs/{job_id}",
+ account_id=account_id,
+ name=name,
+ id=id,
+ job_id=job_id,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[JobGetResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[JobGetResponse], ResultWrapper[JobGetResponse]),
+ )
+
+ def logs(
+ self,
+ job_id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ id: str,
+ page: int | Omit = omit,
+ per_page: int | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> JobLogsResponse:
+ """
+ Lists log entries for an AI Search indexing job.
+
+ Args:
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ if not job_id:
+ raise ValueError(f"Expected a non-empty value for `job_id` but received {job_id!r}")
+ return self._get(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/jobs/{job_id}/logs",
+ account_id=account_id,
+ name=name,
+ id=id,
+ job_id=job_id,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "page": page,
+ "per_page": per_page,
+ },
+ job_logs_params.JobLogsParams,
+ ),
+ post_parser=ResultWrapper[JobLogsResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[JobLogsResponse], ResultWrapper[JobLogsResponse]),
+ )
+
+
+class AsyncJobsResource(AsyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> AsyncJobsResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncJobsResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncJobsResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return AsyncJobsResourceWithStreamingResponse(self)
+
+ async def create(
+ self,
+ id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ description: str | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> JobCreateResponse:
+ """
+ Creates a new indexing job for an AI Search instance.
+
+ Args:
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ return await self._post(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/jobs",
+ account_id=account_id,
+ name=name,
+ id=id,
+ ),
+ body=await async_maybe_transform({"description": description}, job_create_params.JobCreateParams),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[JobCreateResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[JobCreateResponse], ResultWrapper[JobCreateResponse]),
+ )
+
+ async def update(
+ self,
+ job_id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ id: str,
+ action: Literal["cancel"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> JobUpdateResponse:
+ """
+ Updates the status of an AI Search indexing job.
+
+ Args:
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ if not job_id:
+ raise ValueError(f"Expected a non-empty value for `job_id` but received {job_id!r}")
+ return await self._patch(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/jobs/{job_id}",
+ account_id=account_id,
+ name=name,
+ id=id,
+ job_id=job_id,
+ ),
+ body=await async_maybe_transform({"action": action}, job_update_params.JobUpdateParams),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[JobUpdateResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[JobUpdateResponse], ResultWrapper[JobUpdateResponse]),
+ )
+
+ def list(
+ self,
+ id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ page: int | Omit = omit,
+ per_page: int | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> AsyncPaginator[JobListResponse, AsyncV4PagePaginationArray[JobListResponse]]:
+ """
+ Lists indexing jobs for an AI Search instance.
+
+ Args:
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ return self._get_api_list(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/jobs",
+ account_id=account_id,
+ name=name,
+ id=id,
+ ),
+ page=AsyncV4PagePaginationArray[JobListResponse],
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "page": page,
+ "per_page": per_page,
+ },
+ job_list_params.JobListParams,
+ ),
+ ),
+ model=JobListResponse,
+ )
+
+ async def get(
+ self,
+ job_id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ id: str,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> JobGetResponse:
+ """
+ Retrieves details for a specific AI Search indexing job.
+
+ Args:
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ if not job_id:
+ raise ValueError(f"Expected a non-empty value for `job_id` but received {job_id!r}")
+ return await self._get(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/jobs/{job_id}",
+ account_id=account_id,
+ name=name,
+ id=id,
+ job_id=job_id,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[JobGetResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[JobGetResponse], ResultWrapper[JobGetResponse]),
+ )
+
+ async def logs(
+ self,
+ job_id: str,
+ *,
+ account_id: str | None = None,
+ name: str,
+ id: str,
+ page: int | Omit = omit,
+ per_page: int | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> JobLogsResponse:
+ """
+ Lists log entries for an AI Search indexing job.
+
+ Args:
+ id: AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ if not id:
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
+ if not job_id:
+ raise ValueError(f"Expected a non-empty value for `job_id` but received {job_id!r}")
+ return await self._get(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/instances/{id}/jobs/{job_id}/logs",
+ account_id=account_id,
+ name=name,
+ id=id,
+ job_id=job_id,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=await async_maybe_transform(
+ {
+ "page": page,
+ "per_page": per_page,
+ },
+ job_logs_params.JobLogsParams,
+ ),
+ post_parser=ResultWrapper[JobLogsResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[JobLogsResponse], ResultWrapper[JobLogsResponse]),
+ )
+
+
+class JobsResourceWithRawResponse:
+ def __init__(self, jobs: JobsResource) -> None:
+ self._jobs = jobs
+
+ self.create = to_raw_response_wrapper(
+ jobs.create,
+ )
+ self.update = to_raw_response_wrapper(
+ jobs.update,
+ )
+ self.list = to_raw_response_wrapper(
+ jobs.list,
+ )
+ self.get = to_raw_response_wrapper(
+ jobs.get,
+ )
+ self.logs = to_raw_response_wrapper(
+ jobs.logs,
+ )
+
+
+class AsyncJobsResourceWithRawResponse:
+ def __init__(self, jobs: AsyncJobsResource) -> None:
+ self._jobs = jobs
+
+ self.create = async_to_raw_response_wrapper(
+ jobs.create,
+ )
+ self.update = async_to_raw_response_wrapper(
+ jobs.update,
+ )
+ self.list = async_to_raw_response_wrapper(
+ jobs.list,
+ )
+ self.get = async_to_raw_response_wrapper(
+ jobs.get,
+ )
+ self.logs = async_to_raw_response_wrapper(
+ jobs.logs,
+ )
+
+
+class JobsResourceWithStreamingResponse:
+ def __init__(self, jobs: JobsResource) -> None:
+ self._jobs = jobs
+
+ self.create = to_streamed_response_wrapper(
+ jobs.create,
+ )
+ self.update = to_streamed_response_wrapper(
+ jobs.update,
+ )
+ self.list = to_streamed_response_wrapper(
+ jobs.list,
+ )
+ self.get = to_streamed_response_wrapper(
+ jobs.get,
+ )
+ self.logs = to_streamed_response_wrapper(
+ jobs.logs,
+ )
+
+
+class AsyncJobsResourceWithStreamingResponse:
+ def __init__(self, jobs: AsyncJobsResource) -> None:
+ self._jobs = jobs
+
+ self.create = async_to_streamed_response_wrapper(
+ jobs.create,
+ )
+ self.update = async_to_streamed_response_wrapper(
+ jobs.update,
+ )
+ self.list = async_to_streamed_response_wrapper(
+ jobs.list,
+ )
+ self.get = async_to_streamed_response_wrapper(
+ jobs.get,
+ )
+ self.logs = async_to_streamed_response_wrapper(
+ jobs.logs,
+ )
diff --git a/src/cloudflare/resources/aisearch/namespaces/namespaces.py b/src/cloudflare/resources/aisearch/namespaces/namespaces.py
new file mode 100644
index 00000000000..152664c1ecc
--- /dev/null
+++ b/src/cloudflare/resources/aisearch/namespaces/namespaces.py
@@ -0,0 +1,987 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Type, Iterable, Optional, cast
+from typing_extensions import Literal
+
+import httpx
+
+from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
+from ...._utils import path_template, maybe_transform, async_maybe_transform
+from ...._compat import cached_property
+from ...._resource import SyncAPIResource, AsyncAPIResource
+from ...._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from ...._wrappers import ResultWrapper
+from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray
+from ...._base_client import AsyncPaginator, make_request_options
+from ....types.aisearch import (
+ namespace_list_params,
+ namespace_create_params,
+ namespace_search_params,
+ namespace_update_params,
+ namespace_chat_completions_params,
+)
+from .instances.instances import (
+ InstancesResource,
+ AsyncInstancesResource,
+ InstancesResourceWithRawResponse,
+ AsyncInstancesResourceWithRawResponse,
+ InstancesResourceWithStreamingResponse,
+ AsyncInstancesResourceWithStreamingResponse,
+)
+from ....types.aisearch.namespace_list_response import NamespaceListResponse
+from ....types.aisearch.namespace_read_response import NamespaceReadResponse
+from ....types.aisearch.namespace_create_response import NamespaceCreateResponse
+from ....types.aisearch.namespace_search_response import NamespaceSearchResponse
+from ....types.aisearch.namespace_update_response import NamespaceUpdateResponse
+from ....types.aisearch.namespace_chat_completions_response import NamespaceChatCompletionsResponse
+
+__all__ = ["NamespacesResource", "AsyncNamespacesResource"]
+
+
+class NamespacesResource(SyncAPIResource):
+ @cached_property
+ def instances(self) -> InstancesResource:
+ return InstancesResource(self._client)
+
+ @cached_property
+ def with_raw_response(self) -> NamespacesResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return NamespacesResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> NamespacesResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return NamespacesResourceWithStreamingResponse(self)
+
+ def create(
+ self,
+ *,
+ account_id: str | None = None,
+ name: str,
+ description: Optional[str] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> NamespaceCreateResponse:
+ """
+ Create a new namespace.
+
+ Args:
+ description: Optional description for the namespace. Max 256 characters.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ return self._post(
+ path_template("/accounts/{account_id}/ai-search/namespaces", account_id=account_id),
+ body=maybe_transform(
+ {
+ "name": name,
+ "description": description,
+ },
+ namespace_create_params.NamespaceCreateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[NamespaceCreateResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[NamespaceCreateResponse], ResultWrapper[NamespaceCreateResponse]),
+ )
+
+ def update(
+ self,
+ name: str,
+ *,
+ account_id: str | None = None,
+ description: Optional[str] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> NamespaceUpdateResponse:
+ """Update namespace.
+
+ Args:
+ description: Optional description for the namespace.
+
+ Max 256 characters.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ return self._put(
+ path_template("/accounts/{account_id}/ai-search/namespaces/{name}", account_id=account_id, name=name),
+ body=maybe_transform({"description": description}, namespace_update_params.NamespaceUpdateParams),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[NamespaceUpdateResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[NamespaceUpdateResponse], ResultWrapper[NamespaceUpdateResponse]),
+ )
+
+ def list(
+ self,
+ *,
+ account_id: str | None = None,
+ page: int | Omit = omit,
+ per_page: int | Omit = omit,
+ search: str | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> SyncV4PagePaginationArray[NamespaceListResponse]:
+ """
+ List namespaces.
+
+ Args:
+ page: Page number (1-indexed).
+
+ per_page: Number of results per page.
+
+ search: Filter namespaces whose name or description contains this string
+ (case-insensitive).
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ return self._get_api_list(
+ path_template("/accounts/{account_id}/ai-search/namespaces", account_id=account_id),
+ page=SyncV4PagePaginationArray[NamespaceListResponse],
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "page": page,
+ "per_page": per_page,
+ "search": search,
+ },
+ namespace_list_params.NamespaceListParams,
+ ),
+ ),
+ model=NamespaceListResponse,
+ )
+
+ def delete(
+ self,
+ name: str,
+ *,
+ account_id: str | None = None,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> object:
+ """
+ Delete namespace.
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ return self._delete(
+ path_template("/accounts/{account_id}/ai-search/namespaces/{name}", account_id=account_id, name=name),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[object]._unwrapper,
+ ),
+ cast_to=cast(Type[object], ResultWrapper[object]),
+ )
+
+ def chat_completions(
+ self,
+ name: str,
+ *,
+ account_id: str | None = None,
+ aisearch_options: namespace_chat_completions_params.AISearchOptions,
+ messages: Iterable[namespace_chat_completions_params.Message],
+ model: Literal[
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
+ "@cf/zai-org/glm-4.7-flash",
+ "@cf/meta/llama-3.1-8b-instruct-fast",
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
+ "@cf/qwen/qwen3-30b-a3b-fp8",
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
+ "@cf/moonshotai/kimi-k2-instruct",
+ "@cf/google/gemma-3-12b-it",
+ "@cf/google/gemma-4-26b-a4b-it",
+ "@cf/moonshotai/kimi-k2.5",
+ "anthropic/claude-3-7-sonnet",
+ "anthropic/claude-sonnet-4",
+ "anthropic/claude-opus-4",
+ "anthropic/claude-3-5-haiku",
+ "cerebras/qwen-3-235b-a22b-instruct",
+ "cerebras/qwen-3-235b-a22b-thinking",
+ "cerebras/llama-3.3-70b",
+ "cerebras/llama-4-maverick-17b-128e-instruct",
+ "cerebras/llama-4-scout-17b-16e-instruct",
+ "cerebras/gpt-oss-120b",
+ "google-ai-studio/gemini-2.5-flash",
+ "google-ai-studio/gemini-2.5-pro",
+ "grok/grok-4",
+ "groq/llama-3.3-70b-versatile",
+ "groq/llama-3.1-8b-instant",
+ "openai/gpt-5",
+ "openai/gpt-5-mini",
+ "openai/gpt-5-nano",
+ "",
+ ]
+ | Omit = omit,
+ stream: bool | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> NamespaceChatCompletionsResponse:
+ """
+ Performs a chat completion request against multiple AI Search instances in
+ parallel, merging retrieved content as context for generating a response.
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ return self._post(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/chat/completions", account_id=account_id, name=name
+ ),
+ body=maybe_transform(
+ {
+ "aisearch_options": aisearch_options,
+ "messages": messages,
+ "model": model,
+ "stream": stream,
+ },
+ namespace_chat_completions_params.NamespaceChatCompletionsParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=NamespaceChatCompletionsResponse,
+ )
+
+ def read(
+ self,
+ name: str,
+ *,
+ account_id: str | None = None,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> NamespaceReadResponse:
+ """
+ Read namespace.
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ return self._get(
+ path_template("/accounts/{account_id}/ai-search/namespaces/{name}", account_id=account_id, name=name),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[NamespaceReadResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[NamespaceReadResponse], ResultWrapper[NamespaceReadResponse]),
+ )
+
+ def search(
+ self,
+ name: str,
+ *,
+ account_id: str | None = None,
+ aisearch_options: namespace_search_params.AISearchOptions,
+ messages: Iterable[namespace_search_params.Message] | Omit = omit,
+ query: str | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> NamespaceSearchResponse:
+ """Multi-Instance Search
+
+ Args:
+ query: A simple text query string.
+
+ Alternative to 'messages' — provide either this or
+ 'messages', not both.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ return self._post(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/search", account_id=account_id, name=name
+ ),
+ body=maybe_transform(
+ {
+ "aisearch_options": aisearch_options,
+ "messages": messages,
+ "query": query,
+ },
+ namespace_search_params.NamespaceSearchParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[NamespaceSearchResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[NamespaceSearchResponse], ResultWrapper[NamespaceSearchResponse]),
+ )
+
+
+class AsyncNamespacesResource(AsyncAPIResource):
+ @cached_property
+ def instances(self) -> AsyncInstancesResource:
+ return AsyncInstancesResource(self._client)
+
+ @cached_property
+ def with_raw_response(self) -> AsyncNamespacesResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncNamespacesResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncNamespacesResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return AsyncNamespacesResourceWithStreamingResponse(self)
+
+ async def create(
+ self,
+ *,
+ account_id: str | None = None,
+ name: str,
+ description: Optional[str] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> NamespaceCreateResponse:
+ """
+ Create a new namespace.
+
+ Args:
+ description: Optional description for the namespace. Max 256 characters.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ return await self._post(
+ path_template("/accounts/{account_id}/ai-search/namespaces", account_id=account_id),
+ body=await async_maybe_transform(
+ {
+ "name": name,
+ "description": description,
+ },
+ namespace_create_params.NamespaceCreateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[NamespaceCreateResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[NamespaceCreateResponse], ResultWrapper[NamespaceCreateResponse]),
+ )
+
+ async def update(
+ self,
+ name: str,
+ *,
+ account_id: str | None = None,
+ description: Optional[str] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> NamespaceUpdateResponse:
+ """Update namespace.
+
+ Args:
+ description: Optional description for the namespace.
+
+ Max 256 characters.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ return await self._put(
+ path_template("/accounts/{account_id}/ai-search/namespaces/{name}", account_id=account_id, name=name),
+ body=await async_maybe_transform(
+ {"description": description}, namespace_update_params.NamespaceUpdateParams
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[NamespaceUpdateResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[NamespaceUpdateResponse], ResultWrapper[NamespaceUpdateResponse]),
+ )
+
+ def list(
+ self,
+ *,
+ account_id: str | None = None,
+ page: int | Omit = omit,
+ per_page: int | Omit = omit,
+ search: str | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> AsyncPaginator[NamespaceListResponse, AsyncV4PagePaginationArray[NamespaceListResponse]]:
+ """
+ List namespaces.
+
+ Args:
+ page: Page number (1-indexed).
+
+ per_page: Number of results per page.
+
+ search: Filter namespaces whose name or description contains this string
+ (case-insensitive).
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ return self._get_api_list(
+ path_template("/accounts/{account_id}/ai-search/namespaces", account_id=account_id),
+ page=AsyncV4PagePaginationArray[NamespaceListResponse],
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "page": page,
+ "per_page": per_page,
+ "search": search,
+ },
+ namespace_list_params.NamespaceListParams,
+ ),
+ ),
+ model=NamespaceListResponse,
+ )
+
+ async def delete(
+ self,
+ name: str,
+ *,
+ account_id: str | None = None,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> object:
+ """
+ Delete namespace.
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ return await self._delete(
+ path_template("/accounts/{account_id}/ai-search/namespaces/{name}", account_id=account_id, name=name),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[object]._unwrapper,
+ ),
+ cast_to=cast(Type[object], ResultWrapper[object]),
+ )
+
+ async def chat_completions(
+ self,
+ name: str,
+ *,
+ account_id: str | None = None,
+ aisearch_options: namespace_chat_completions_params.AISearchOptions,
+ messages: Iterable[namespace_chat_completions_params.Message],
+ model: Literal[
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
+ "@cf/zai-org/glm-4.7-flash",
+ "@cf/meta/llama-3.1-8b-instruct-fast",
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
+ "@cf/qwen/qwen3-30b-a3b-fp8",
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
+ "@cf/moonshotai/kimi-k2-instruct",
+ "@cf/google/gemma-3-12b-it",
+ "@cf/google/gemma-4-26b-a4b-it",
+ "@cf/moonshotai/kimi-k2.5",
+ "anthropic/claude-3-7-sonnet",
+ "anthropic/claude-sonnet-4",
+ "anthropic/claude-opus-4",
+ "anthropic/claude-3-5-haiku",
+ "cerebras/qwen-3-235b-a22b-instruct",
+ "cerebras/qwen-3-235b-a22b-thinking",
+ "cerebras/llama-3.3-70b",
+ "cerebras/llama-4-maverick-17b-128e-instruct",
+ "cerebras/llama-4-scout-17b-16e-instruct",
+ "cerebras/gpt-oss-120b",
+ "google-ai-studio/gemini-2.5-flash",
+ "google-ai-studio/gemini-2.5-pro",
+ "grok/grok-4",
+ "groq/llama-3.3-70b-versatile",
+ "groq/llama-3.1-8b-instant",
+ "openai/gpt-5",
+ "openai/gpt-5-mini",
+ "openai/gpt-5-nano",
+ "",
+ ]
+ | Omit = omit,
+ stream: bool | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> NamespaceChatCompletionsResponse:
+ """
+ Performs a chat completion request against multiple AI Search instances in
+ parallel, merging retrieved content as context for generating a response.
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ return await self._post(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/chat/completions", account_id=account_id, name=name
+ ),
+ body=await async_maybe_transform(
+ {
+ "aisearch_options": aisearch_options,
+ "messages": messages,
+ "model": model,
+ "stream": stream,
+ },
+ namespace_chat_completions_params.NamespaceChatCompletionsParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=NamespaceChatCompletionsResponse,
+ )
+
+ async def read(
+ self,
+ name: str,
+ *,
+ account_id: str | None = None,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> NamespaceReadResponse:
+ """
+ Read namespace.
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ return await self._get(
+ path_template("/accounts/{account_id}/ai-search/namespaces/{name}", account_id=account_id, name=name),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[NamespaceReadResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[NamespaceReadResponse], ResultWrapper[NamespaceReadResponse]),
+ )
+
+ async def search(
+ self,
+ name: str,
+ *,
+ account_id: str | None = None,
+ aisearch_options: namespace_search_params.AISearchOptions,
+ messages: Iterable[namespace_search_params.Message] | Omit = omit,
+ query: str | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> NamespaceSearchResponse:
+ """Multi-Instance Search
+
+ Args:
+ query: A simple text query string.
+
+ Alternative to 'messages' — provide either this or
+ 'messages', not both.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ return await self._post(
+ path_template(
+ "/accounts/{account_id}/ai-search/namespaces/{name}/search", account_id=account_id, name=name
+ ),
+ body=await async_maybe_transform(
+ {
+ "aisearch_options": aisearch_options,
+ "messages": messages,
+ "query": query,
+ },
+ namespace_search_params.NamespaceSearchParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[NamespaceSearchResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[NamespaceSearchResponse], ResultWrapper[NamespaceSearchResponse]),
+ )
+
+
+class NamespacesResourceWithRawResponse:
+ def __init__(self, namespaces: NamespacesResource) -> None:
+ self._namespaces = namespaces
+
+ self.create = to_raw_response_wrapper(
+ namespaces.create,
+ )
+ self.update = to_raw_response_wrapper(
+ namespaces.update,
+ )
+ self.list = to_raw_response_wrapper(
+ namespaces.list,
+ )
+ self.delete = to_raw_response_wrapper(
+ namespaces.delete,
+ )
+ self.chat_completions = to_raw_response_wrapper(
+ namespaces.chat_completions,
+ )
+ self.read = to_raw_response_wrapper(
+ namespaces.read,
+ )
+ self.search = to_raw_response_wrapper(
+ namespaces.search,
+ )
+
+ @cached_property
+ def instances(self) -> InstancesResourceWithRawResponse:
+ return InstancesResourceWithRawResponse(self._namespaces.instances)
+
+
+class AsyncNamespacesResourceWithRawResponse:
+ def __init__(self, namespaces: AsyncNamespacesResource) -> None:
+ self._namespaces = namespaces
+
+ self.create = async_to_raw_response_wrapper(
+ namespaces.create,
+ )
+ self.update = async_to_raw_response_wrapper(
+ namespaces.update,
+ )
+ self.list = async_to_raw_response_wrapper(
+ namespaces.list,
+ )
+ self.delete = async_to_raw_response_wrapper(
+ namespaces.delete,
+ )
+ self.chat_completions = async_to_raw_response_wrapper(
+ namespaces.chat_completions,
+ )
+ self.read = async_to_raw_response_wrapper(
+ namespaces.read,
+ )
+ self.search = async_to_raw_response_wrapper(
+ namespaces.search,
+ )
+
+ @cached_property
+ def instances(self) -> AsyncInstancesResourceWithRawResponse:
+ return AsyncInstancesResourceWithRawResponse(self._namespaces.instances)
+
+
+class NamespacesResourceWithStreamingResponse:
+ def __init__(self, namespaces: NamespacesResource) -> None:
+ self._namespaces = namespaces
+
+ self.create = to_streamed_response_wrapper(
+ namespaces.create,
+ )
+ self.update = to_streamed_response_wrapper(
+ namespaces.update,
+ )
+ self.list = to_streamed_response_wrapper(
+ namespaces.list,
+ )
+ self.delete = to_streamed_response_wrapper(
+ namespaces.delete,
+ )
+ self.chat_completions = to_streamed_response_wrapper(
+ namespaces.chat_completions,
+ )
+ self.read = to_streamed_response_wrapper(
+ namespaces.read,
+ )
+ self.search = to_streamed_response_wrapper(
+ namespaces.search,
+ )
+
+ @cached_property
+ def instances(self) -> InstancesResourceWithStreamingResponse:
+ return InstancesResourceWithStreamingResponse(self._namespaces.instances)
+
+
+class AsyncNamespacesResourceWithStreamingResponse:
+ def __init__(self, namespaces: AsyncNamespacesResource) -> None:
+ self._namespaces = namespaces
+
+ self.create = async_to_streamed_response_wrapper(
+ namespaces.create,
+ )
+ self.update = async_to_streamed_response_wrapper(
+ namespaces.update,
+ )
+ self.list = async_to_streamed_response_wrapper(
+ namespaces.list,
+ )
+ self.delete = async_to_streamed_response_wrapper(
+ namespaces.delete,
+ )
+ self.chat_completions = async_to_streamed_response_wrapper(
+ namespaces.chat_completions,
+ )
+ self.read = async_to_streamed_response_wrapper(
+ namespaces.read,
+ )
+ self.search = async_to_streamed_response_wrapper(
+ namespaces.search,
+ )
+
+ @cached_property
+ def instances(self) -> AsyncInstancesResourceWithStreamingResponse:
+ return AsyncInstancesResourceWithStreamingResponse(self._namespaces.instances)
diff --git a/src/cloudflare/resources/aisearch/tokens.py b/src/cloudflare/resources/aisearch/tokens.py
index 1834a9b0c6a..d0e62908a9e 100644
--- a/src/cloudflare/resources/aisearch/tokens.py
+++ b/src/cloudflare/resources/aisearch/tokens.py
@@ -7,7 +7,7 @@
import httpx
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ..._utils import maybe_transform, async_maybe_transform
+from ..._utils import path_template, maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -23,7 +23,6 @@
from ...types.aisearch.token_list_response import TokenListResponse
from ...types.aisearch.token_read_response import TokenReadResponse
from ...types.aisearch.token_create_response import TokenCreateResponse
-from ...types.aisearch.token_delete_response import TokenDeleteResponse
from ...types.aisearch.token_update_response import TokenUpdateResponse
__all__ = ["TokensResource", "AsyncTokensResource"]
@@ -52,10 +51,11 @@ def with_streaming_response(self) -> TokensResourceWithStreamingResponse:
def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
cf_api_id: str,
cf_api_key: str,
name: str,
+ legacy: bool | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -64,7 +64,7 @@ def create(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> TokenCreateResponse:
"""
- Create new tokens.
+ Create a new token.
Args:
extra_headers: Send extra headers
@@ -75,15 +75,18 @@ def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._post(
- f"/accounts/{account_id}/ai-search/tokens",
+ path_template("/accounts/{account_id}/ai-search/tokens", account_id=account_id),
body=maybe_transform(
{
"cf_api_id": cf_api_id,
"cf_api_key": cf_api_key,
"name": name,
+ "legacy": legacy,
},
token_create_params.TokenCreateParams,
),
@@ -101,10 +104,11 @@ def update(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
cf_api_id: str,
cf_api_key: str,
name: str,
+ legacy: bool | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -113,7 +117,7 @@ def update(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> TokenUpdateResponse:
"""
- Update tokens.
+ Update token.
Args:
extra_headers: Send extra headers
@@ -124,17 +128,20 @@ def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._put(
- f"/accounts/{account_id}/ai-search/tokens/{id}",
+ path_template("/accounts/{account_id}/ai-search/tokens/{id}", account_id=account_id, id=id),
body=maybe_transform(
{
"cf_api_id": cf_api_id,
"cf_api_key": cf_api_key,
"name": name,
+ "legacy": legacy,
},
token_update_params.TokenUpdateParams,
),
@@ -151,9 +158,10 @@ def update(
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
page: int | Omit = omit,
per_page: int | Omit = omit,
+ search: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -165,6 +173,12 @@ def list(
List tokens.
Args:
+ page: Page number (1-indexed).
+
+ per_page: Number of results per page.
+
+ search: Filter tokens whose name contains this string (case-insensitive).
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -173,10 +187,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/ai-search/tokens",
+ path_template("/accounts/{account_id}/ai-search/tokens", account_id=account_id),
page=SyncV4PagePaginationArray[TokenListResponse],
options=make_request_options(
extra_headers=extra_headers,
@@ -187,6 +203,7 @@ def list(
{
"page": page,
"per_page": per_page,
+ "search": search,
},
token_list_params.TokenListParams,
),
@@ -198,16 +215,16 @@ def delete(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> TokenDeleteResponse:
+ ) -> object:
"""
- Delete tokens.
+ Delete token.
Args:
extra_headers: Send extra headers
@@ -218,27 +235,29 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._delete(
- f"/accounts/{account_id}/ai-search/tokens/{id}",
+ path_template("/accounts/{account_id}/ai-search/tokens/{id}", account_id=account_id, id=id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[TokenDeleteResponse]._unwrapper,
+ post_parser=ResultWrapper[object]._unwrapper,
),
- cast_to=cast(Type[TokenDeleteResponse], ResultWrapper[TokenDeleteResponse]),
+ cast_to=cast(Type[object], ResultWrapper[object]),
)
def read(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -247,7 +266,7 @@ def read(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> TokenReadResponse:
"""
- Read tokens.
+ Read token.
Args:
extra_headers: Send extra headers
@@ -258,12 +277,14 @@ def read(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._get(
- f"/accounts/{account_id}/ai-search/tokens/{id}",
+ path_template("/accounts/{account_id}/ai-search/tokens/{id}", account_id=account_id, id=id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -298,10 +319,11 @@ def with_streaming_response(self) -> AsyncTokensResourceWithStreamingResponse:
async def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
cf_api_id: str,
cf_api_key: str,
name: str,
+ legacy: bool | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -310,7 +332,7 @@ async def create(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> TokenCreateResponse:
"""
- Create new tokens.
+ Create a new token.
Args:
extra_headers: Send extra headers
@@ -321,15 +343,18 @@ async def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._post(
- f"/accounts/{account_id}/ai-search/tokens",
+ path_template("/accounts/{account_id}/ai-search/tokens", account_id=account_id),
body=await async_maybe_transform(
{
"cf_api_id": cf_api_id,
"cf_api_key": cf_api_key,
"name": name,
+ "legacy": legacy,
},
token_create_params.TokenCreateParams,
),
@@ -347,10 +372,11 @@ async def update(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
cf_api_id: str,
cf_api_key: str,
name: str,
+ legacy: bool | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -359,7 +385,7 @@ async def update(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> TokenUpdateResponse:
"""
- Update tokens.
+ Update token.
Args:
extra_headers: Send extra headers
@@ -370,17 +396,20 @@ async def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return await self._put(
- f"/accounts/{account_id}/ai-search/tokens/{id}",
+ path_template("/accounts/{account_id}/ai-search/tokens/{id}", account_id=account_id, id=id),
body=await async_maybe_transform(
{
"cf_api_id": cf_api_id,
"cf_api_key": cf_api_key,
"name": name,
+ "legacy": legacy,
},
token_update_params.TokenUpdateParams,
),
@@ -397,9 +426,10 @@ async def update(
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
page: int | Omit = omit,
per_page: int | Omit = omit,
+ search: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -411,6 +441,12 @@ def list(
List tokens.
Args:
+ page: Page number (1-indexed).
+
+ per_page: Number of results per page.
+
+ search: Filter tokens whose name contains this string (case-insensitive).
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -419,10 +455,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/ai-search/tokens",
+ path_template("/accounts/{account_id}/ai-search/tokens", account_id=account_id),
page=AsyncV4PagePaginationArray[TokenListResponse],
options=make_request_options(
extra_headers=extra_headers,
@@ -433,6 +471,7 @@ def list(
{
"page": page,
"per_page": per_page,
+ "search": search,
},
token_list_params.TokenListParams,
),
@@ -444,16 +483,16 @@ async def delete(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> TokenDeleteResponse:
+ ) -> object:
"""
- Delete tokens.
+ Delete token.
Args:
extra_headers: Send extra headers
@@ -464,27 +503,29 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return await self._delete(
- f"/accounts/{account_id}/ai-search/tokens/{id}",
+ path_template("/accounts/{account_id}/ai-search/tokens/{id}", account_id=account_id, id=id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[TokenDeleteResponse]._unwrapper,
+ post_parser=ResultWrapper[object]._unwrapper,
),
- cast_to=cast(Type[TokenDeleteResponse], ResultWrapper[TokenDeleteResponse]),
+ cast_to=cast(Type[object], ResultWrapper[object]),
)
async def read(
self,
id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -493,7 +534,7 @@ async def read(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> TokenReadResponse:
"""
- Read tokens.
+ Read token.
Args:
extra_headers: Send extra headers
@@ -504,12 +545,14 @@ async def read(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return await self._get(
- f"/accounts/{account_id}/ai-search/tokens/{id}",
+ path_template("/accounts/{account_id}/ai-search/tokens/{id}", account_id=account_id, id=id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/alerting/api.md b/src/cloudflare/resources/alerting/api.md
new file mode 100644
index 00000000000..6c8ac0c1b0e
--- /dev/null
+++ b/src/cloudflare/resources/alerting/api.md
@@ -0,0 +1,125 @@
+# Alerting
+
+## AvailableAlerts
+
+Types:
+
+```python
+from cloudflare.types.alerting import AvailableAlertListResponse
+```
+
+Methods:
+
+- client.alerting.available_alerts.list(\*, account_id) -> Optional[AvailableAlertListResponse]
+
+## Destinations
+
+### Eligible
+
+Types:
+
+```python
+from cloudflare.types.alerting.destinations import EligibleGetResponse
+```
+
+Methods:
+
+- client.alerting.destinations.eligible.get(\*, account_id) -> Optional[EligibleGetResponse]
+
+### Pagerduty
+
+Types:
+
+```python
+from cloudflare.types.alerting.destinations import (
+ Pagerduty,
+ PagerdutyCreateResponse,
+ PagerdutyDeleteResponse,
+ PagerdutyLinkResponse,
+)
+```
+
+Methods:
+
+- client.alerting.destinations.pagerduty.create(\*, account_id) -> Optional[PagerdutyCreateResponse]
+- client.alerting.destinations.pagerduty.delete(\*, account_id) -> PagerdutyDeleteResponse
+- client.alerting.destinations.pagerduty.get(\*, account_id) -> SyncSinglePage[Pagerduty]
+- client.alerting.destinations.pagerduty.link(token_id, \*, account_id) -> Optional[PagerdutyLinkResponse]
+
+### Webhooks
+
+Types:
+
+```python
+from cloudflare.types.alerting.destinations import (
+ Webhooks,
+ WebhookCreateResponse,
+ WebhookUpdateResponse,
+ WebhookDeleteResponse,
+)
+```
+
+Methods:
+
+- client.alerting.destinations.webhooks.create(\*, account_id, \*\*params) -> Optional[WebhookCreateResponse]
+- client.alerting.destinations.webhooks.update(webhook_id, \*, account_id, \*\*params) -> Optional[WebhookUpdateResponse]
+- client.alerting.destinations.webhooks.list(\*, account_id) -> SyncSinglePage[Webhooks]
+- client.alerting.destinations.webhooks.delete(webhook_id, \*, account_id) -> WebhookDeleteResponse
+- client.alerting.destinations.webhooks.get(webhook_id, \*, account_id) -> Optional[Webhooks]
+
+## History
+
+Types:
+
+```python
+from cloudflare.types.alerting import History
+```
+
+Methods:
+
+- client.alerting.history.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[History]
+
+## Policies
+
+Types:
+
+```python
+from cloudflare.types.alerting import (
+ Mechanism,
+ Policy,
+ PolicyFilter,
+ PolicyCreateResponse,
+ PolicyUpdateResponse,
+ PolicyDeleteResponse,
+)
+```
+
+Methods:
+
+- client.alerting.policies.create(\*, account_id, \*\*params) -> Optional[PolicyCreateResponse]
+- client.alerting.policies.update(policy_id, \*, account_id, \*\*params) -> Optional[PolicyUpdateResponse]
+- client.alerting.policies.list(\*, account_id) -> SyncSinglePage[Policy]
+- client.alerting.policies.delete(policy_id, \*, account_id) -> PolicyDeleteResponse
+- client.alerting.policies.get(policy_id, \*, account_id) -> Optional[Policy]
+
+## Silences
+
+Types:
+
+```python
+from cloudflare.types.alerting import (
+ SilenceCreateResponse,
+ SilenceUpdateResponse,
+ SilenceListResponse,
+ SilenceDeleteResponse,
+ SilenceGetResponse,
+)
+```
+
+Methods:
+
+- client.alerting.silences.create(\*, account_id, \*\*params) -> SilenceCreateResponse
+- client.alerting.silences.update(\*, account_id, \*\*params) -> SyncSinglePage[SilenceUpdateResponse]
+- client.alerting.silences.list(\*, account_id) -> SyncSinglePage[SilenceListResponse]
+- client.alerting.silences.delete(silence_id, \*, account_id) -> SilenceDeleteResponse
+- client.alerting.silences.get(silence_id, \*, account_id) -> Optional[SilenceGetResponse]
diff --git a/src/cloudflare/resources/alerting/available_alerts.py b/src/cloudflare/resources/alerting/available_alerts.py
index 1286d27f1e6..d22e4276984 100644
--- a/src/cloudflare/resources/alerting/available_alerts.py
+++ b/src/cloudflare/resources/alerting/available_alerts.py
@@ -7,6 +7,7 @@
import httpx
from ..._types import Body, Query, Headers, NotGiven, not_given
+from ..._utils import path_template
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -45,7 +46,7 @@ def with_streaming_response(self) -> AvailableAlertsResourceWithStreamingRespons
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -67,10 +68,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get(
- f"/accounts/{account_id}/alerting/v3/available_alerts",
+ path_template("/accounts/{account_id}/alerting/v3/available_alerts", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -105,7 +108,7 @@ def with_streaming_response(self) -> AsyncAvailableAlertsResourceWithStreamingRe
async def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -127,10 +130,12 @@ async def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._get(
- f"/accounts/{account_id}/alerting/v3/available_alerts",
+ path_template("/accounts/{account_id}/alerting/v3/available_alerts", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/alerting/destinations/eligible.py b/src/cloudflare/resources/alerting/destinations/eligible.py
index 76a61c05f51..e558be8c41b 100644
--- a/src/cloudflare/resources/alerting/destinations/eligible.py
+++ b/src/cloudflare/resources/alerting/destinations/eligible.py
@@ -7,6 +7,7 @@
import httpx
from ...._types import Body, Query, Headers, NotGiven, not_given
+from ...._utils import path_template
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -45,7 +46,7 @@ def with_streaming_response(self) -> EligibleResourceWithStreamingResponse:
def get(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -67,10 +68,12 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get(
- f"/accounts/{account_id}/alerting/v3/destinations/eligible",
+ path_template("/accounts/{account_id}/alerting/v3/destinations/eligible", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -105,7 +108,7 @@ def with_streaming_response(self) -> AsyncEligibleResourceWithStreamingResponse:
async def get(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -127,10 +130,12 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._get(
- f"/accounts/{account_id}/alerting/v3/destinations/eligible",
+ path_template("/accounts/{account_id}/alerting/v3/destinations/eligible", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/alerting/destinations/pagerduty.py b/src/cloudflare/resources/alerting/destinations/pagerduty.py
index 223dfead7a8..5b3f7ee970d 100644
--- a/src/cloudflare/resources/alerting/destinations/pagerduty.py
+++ b/src/cloudflare/resources/alerting/destinations/pagerduty.py
@@ -7,6 +7,7 @@
import httpx
from ...._types import Body, Query, Headers, NotGiven, not_given
+from ...._utils import path_template
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -49,7 +50,7 @@ def with_streaming_response(self) -> PagerdutyResourceWithStreamingResponse:
def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -71,10 +72,12 @@ def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._post(
- f"/accounts/{account_id}/alerting/v3/destinations/pagerduty/connect",
+ path_template("/accounts/{account_id}/alerting/v3/destinations/pagerduty/connect", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -88,7 +91,7 @@ def create(
def delete(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -110,10 +113,12 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._delete(
- f"/accounts/{account_id}/alerting/v3/destinations/pagerduty",
+ path_template("/accounts/{account_id}/alerting/v3/destinations/pagerduty", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -123,7 +128,7 @@ def delete(
def get(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -145,10 +150,12 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/alerting/v3/destinations/pagerduty",
+ path_template("/accounts/{account_id}/alerting/v3/destinations/pagerduty", account_id=account_id),
page=SyncSinglePage[Pagerduty],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -160,7 +167,7 @@ def link(
self,
token_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -184,12 +191,18 @@ def link(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not token_id:
raise ValueError(f"Expected a non-empty value for `token_id` but received {token_id!r}")
return self._get(
- f"/accounts/{account_id}/alerting/v3/destinations/pagerduty/connect/{token_id}",
+ path_template(
+ "/accounts/{account_id}/alerting/v3/destinations/pagerduty/connect/{token_id}",
+ account_id=account_id,
+ token_id=token_id,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -224,7 +237,7 @@ def with_streaming_response(self) -> AsyncPagerdutyResourceWithStreamingResponse
async def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -246,10 +259,12 @@ async def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._post(
- f"/accounts/{account_id}/alerting/v3/destinations/pagerduty/connect",
+ path_template("/accounts/{account_id}/alerting/v3/destinations/pagerduty/connect", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -263,7 +278,7 @@ async def create(
async def delete(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -285,10 +300,12 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._delete(
- f"/accounts/{account_id}/alerting/v3/destinations/pagerduty",
+ path_template("/accounts/{account_id}/alerting/v3/destinations/pagerduty", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -298,7 +315,7 @@ async def delete(
def get(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -320,10 +337,12 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/alerting/v3/destinations/pagerduty",
+ path_template("/accounts/{account_id}/alerting/v3/destinations/pagerduty", account_id=account_id),
page=AsyncSinglePage[Pagerduty],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -335,7 +354,7 @@ async def link(
self,
token_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -359,12 +378,18 @@ async def link(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not token_id:
raise ValueError(f"Expected a non-empty value for `token_id` but received {token_id!r}")
return await self._get(
- f"/accounts/{account_id}/alerting/v3/destinations/pagerduty/connect/{token_id}",
+ path_template(
+ "/accounts/{account_id}/alerting/v3/destinations/pagerduty/connect/{token_id}",
+ account_id=account_id,
+ token_id=token_id,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/alerting/destinations/webhooks.py b/src/cloudflare/resources/alerting/destinations/webhooks.py
index 9a83705a4fd..e17a3c8f40c 100644
--- a/src/cloudflare/resources/alerting/destinations/webhooks.py
+++ b/src/cloudflare/resources/alerting/destinations/webhooks.py
@@ -7,7 +7,7 @@
import httpx
from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ...._utils import maybe_transform, async_maybe_transform
+from ...._utils import path_template, maybe_transform, async_maybe_transform
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -51,7 +51,7 @@ def with_streaming_response(self) -> WebhooksResourceWithStreamingResponse:
def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
name: str,
url: str,
secret: str | Omit = omit,
@@ -85,10 +85,12 @@ def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._post(
- f"/accounts/{account_id}/alerting/v3/destinations/webhooks",
+ path_template("/accounts/{account_id}/alerting/v3/destinations/webhooks", account_id=account_id),
body=maybe_transform(
{
"name": name,
@@ -111,7 +113,7 @@ def update(
self,
webhook_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
name: str,
url: str,
secret: str | Omit = omit,
@@ -147,12 +149,18 @@ def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not webhook_id:
raise ValueError(f"Expected a non-empty value for `webhook_id` but received {webhook_id!r}")
return self._put(
- f"/accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}",
+ path_template(
+ "/accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}",
+ account_id=account_id,
+ webhook_id=webhook_id,
+ ),
body=maybe_transform(
{
"name": name,
@@ -174,7 +182,7 @@ def update(
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -196,10 +204,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/alerting/v3/destinations/webhooks",
+ path_template("/accounts/{account_id}/alerting/v3/destinations/webhooks", account_id=account_id),
page=SyncSinglePage[Webhooks],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -211,7 +221,7 @@ def delete(
self,
webhook_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -235,12 +245,18 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not webhook_id:
raise ValueError(f"Expected a non-empty value for `webhook_id` but received {webhook_id!r}")
return self._delete(
- f"/accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}",
+ path_template(
+ "/accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}",
+ account_id=account_id,
+ webhook_id=webhook_id,
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -251,7 +267,7 @@ def get(
self,
webhook_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -275,12 +291,18 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not webhook_id:
raise ValueError(f"Expected a non-empty value for `webhook_id` but received {webhook_id!r}")
return self._get(
- f"/accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}",
+ path_template(
+ "/accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}",
+ account_id=account_id,
+ webhook_id=webhook_id,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -315,7 +337,7 @@ def with_streaming_response(self) -> AsyncWebhooksResourceWithStreamingResponse:
async def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
name: str,
url: str,
secret: str | Omit = omit,
@@ -349,10 +371,12 @@ async def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._post(
- f"/accounts/{account_id}/alerting/v3/destinations/webhooks",
+ path_template("/accounts/{account_id}/alerting/v3/destinations/webhooks", account_id=account_id),
body=await async_maybe_transform(
{
"name": name,
@@ -375,7 +399,7 @@ async def update(
self,
webhook_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
name: str,
url: str,
secret: str | Omit = omit,
@@ -411,12 +435,18 @@ async def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not webhook_id:
raise ValueError(f"Expected a non-empty value for `webhook_id` but received {webhook_id!r}")
return await self._put(
- f"/accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}",
+ path_template(
+ "/accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}",
+ account_id=account_id,
+ webhook_id=webhook_id,
+ ),
body=await async_maybe_transform(
{
"name": name,
@@ -438,7 +468,7 @@ async def update(
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -460,10 +490,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/alerting/v3/destinations/webhooks",
+ path_template("/accounts/{account_id}/alerting/v3/destinations/webhooks", account_id=account_id),
page=AsyncSinglePage[Webhooks],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -475,7 +507,7 @@ async def delete(
self,
webhook_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -499,12 +531,18 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not webhook_id:
raise ValueError(f"Expected a non-empty value for `webhook_id` but received {webhook_id!r}")
return await self._delete(
- f"/accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}",
+ path_template(
+ "/accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}",
+ account_id=account_id,
+ webhook_id=webhook_id,
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -515,7 +553,7 @@ async def get(
self,
webhook_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -539,12 +577,18 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not webhook_id:
raise ValueError(f"Expected a non-empty value for `webhook_id` but received {webhook_id!r}")
return await self._get(
- f"/accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}",
+ path_template(
+ "/accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}",
+ account_id=account_id,
+ webhook_id=webhook_id,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/alerting/history.py b/src/cloudflare/resources/alerting/history.py
index 8eee416174e..a62916b993d 100644
--- a/src/cloudflare/resources/alerting/history.py
+++ b/src/cloudflare/resources/alerting/history.py
@@ -8,7 +8,7 @@
import httpx
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ..._utils import maybe_transform
+from ..._utils import path_template, maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -48,7 +48,7 @@ def with_streaming_response(self) -> HistoryResourceWithStreamingResponse:
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
before: Union[str, datetime] | Omit = omit,
page: float | Omit = omit,
per_page: float | Omit = omit,
@@ -87,10 +87,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/alerting/v3/history",
+ path_template("/accounts/{account_id}/alerting/v3/history", account_id=account_id),
page=SyncV4PagePaginationArray[History],
options=make_request_options(
extra_headers=extra_headers,
@@ -134,7 +136,7 @@ def with_streaming_response(self) -> AsyncHistoryResourceWithStreamingResponse:
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
before: Union[str, datetime] | Omit = omit,
page: float | Omit = omit,
per_page: float | Omit = omit,
@@ -173,10 +175,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/alerting/v3/history",
+ path_template("/accounts/{account_id}/alerting/v3/history", account_id=account_id),
page=AsyncV4PagePaginationArray[History],
options=make_request_options(
extra_headers=extra_headers,
diff --git a/src/cloudflare/resources/alerting/policies.py b/src/cloudflare/resources/alerting/policies.py
index 8f8115ecd60..28e50d93869 100644
--- a/src/cloudflare/resources/alerting/policies.py
+++ b/src/cloudflare/resources/alerting/policies.py
@@ -8,7 +8,7 @@
import httpx
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ..._utils import maybe_transform, async_maybe_transform
+from ..._utils import path_template, maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -54,7 +54,7 @@ def with_streaming_response(self) -> PoliciesResourceWithStreamingResponse:
def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
alert_type: Literal[
"abuse_report_alert",
"access_custom_certificate_expiration_type",
@@ -72,6 +72,7 @@ def create(
"clickhouse_alert_fw_anomaly",
"clickhouse_alert_fw_ent_anomaly",
"cloudforce_one_request_notification",
+ "cni_maintenance_notification",
"custom_analytics",
"custom_bot_detection_alert",
"custom_ssl_certificate_event_type",
@@ -172,10 +173,12 @@ def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._post(
- f"/accounts/{account_id}/alerting/v3/policies",
+ path_template("/accounts/{account_id}/alerting/v3/policies", account_id=account_id),
body=maybe_transform(
{
"alert_type": alert_type,
@@ -202,7 +205,7 @@ def update(
self,
policy_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
alert_interval: str | Omit = omit,
alert_type: Literal[
"abuse_report_alert",
@@ -221,6 +224,7 @@ def update(
"clickhouse_alert_fw_anomaly",
"clickhouse_alert_fw_ent_anomaly",
"cloudforce_one_request_notification",
+ "cni_maintenance_notification",
"custom_analytics",
"custom_bot_detection_alert",
"custom_ssl_certificate_event_type",
@@ -323,12 +327,16 @@ def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not policy_id:
raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}")
return self._put(
- f"/accounts/{account_id}/alerting/v3/policies/{policy_id}",
+ path_template(
+ "/accounts/{account_id}/alerting/v3/policies/{policy_id}", account_id=account_id, policy_id=policy_id
+ ),
body=maybe_transform(
{
"alert_interval": alert_interval,
@@ -354,7 +362,7 @@ def update(
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -376,10 +384,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/alerting/v3/policies",
+ path_template("/accounts/{account_id}/alerting/v3/policies", account_id=account_id),
page=SyncSinglePage[Policy],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -391,7 +401,7 @@ def delete(
self,
policy_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -415,12 +425,16 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not policy_id:
raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}")
return self._delete(
- f"/accounts/{account_id}/alerting/v3/policies/{policy_id}",
+ path_template(
+ "/accounts/{account_id}/alerting/v3/policies/{policy_id}", account_id=account_id, policy_id=policy_id
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -431,7 +445,7 @@ def get(
self,
policy_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -455,12 +469,16 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not policy_id:
raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}")
return self._get(
- f"/accounts/{account_id}/alerting/v3/policies/{policy_id}",
+ path_template(
+ "/accounts/{account_id}/alerting/v3/policies/{policy_id}", account_id=account_id, policy_id=policy_id
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -495,7 +513,7 @@ def with_streaming_response(self) -> AsyncPoliciesResourceWithStreamingResponse:
async def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
alert_type: Literal[
"abuse_report_alert",
"access_custom_certificate_expiration_type",
@@ -513,6 +531,7 @@ async def create(
"clickhouse_alert_fw_anomaly",
"clickhouse_alert_fw_ent_anomaly",
"cloudforce_one_request_notification",
+ "cni_maintenance_notification",
"custom_analytics",
"custom_bot_detection_alert",
"custom_ssl_certificate_event_type",
@@ -613,10 +632,12 @@ async def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._post(
- f"/accounts/{account_id}/alerting/v3/policies",
+ path_template("/accounts/{account_id}/alerting/v3/policies", account_id=account_id),
body=await async_maybe_transform(
{
"alert_type": alert_type,
@@ -643,7 +664,7 @@ async def update(
self,
policy_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
alert_interval: str | Omit = omit,
alert_type: Literal[
"abuse_report_alert",
@@ -662,6 +683,7 @@ async def update(
"clickhouse_alert_fw_anomaly",
"clickhouse_alert_fw_ent_anomaly",
"cloudforce_one_request_notification",
+ "cni_maintenance_notification",
"custom_analytics",
"custom_bot_detection_alert",
"custom_ssl_certificate_event_type",
@@ -764,12 +786,16 @@ async def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not policy_id:
raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}")
return await self._put(
- f"/accounts/{account_id}/alerting/v3/policies/{policy_id}",
+ path_template(
+ "/accounts/{account_id}/alerting/v3/policies/{policy_id}", account_id=account_id, policy_id=policy_id
+ ),
body=await async_maybe_transform(
{
"alert_interval": alert_interval,
@@ -795,7 +821,7 @@ async def update(
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -817,10 +843,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/alerting/v3/policies",
+ path_template("/accounts/{account_id}/alerting/v3/policies", account_id=account_id),
page=AsyncSinglePage[Policy],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -832,7 +860,7 @@ async def delete(
self,
policy_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -856,12 +884,16 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not policy_id:
raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}")
return await self._delete(
- f"/accounts/{account_id}/alerting/v3/policies/{policy_id}",
+ path_template(
+ "/accounts/{account_id}/alerting/v3/policies/{policy_id}", account_id=account_id, policy_id=policy_id
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -872,7 +904,7 @@ async def get(
self,
policy_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -896,12 +928,16 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not policy_id:
raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}")
return await self._get(
- f"/accounts/{account_id}/alerting/v3/policies/{policy_id}",
+ path_template(
+ "/accounts/{account_id}/alerting/v3/policies/{policy_id}", account_id=account_id, policy_id=policy_id
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/alerting/silences.py b/src/cloudflare/resources/alerting/silences.py
index a024012b058..34f364ab0a4 100644
--- a/src/cloudflare/resources/alerting/silences.py
+++ b/src/cloudflare/resources/alerting/silences.py
@@ -7,7 +7,7 @@
import httpx
from ..._types import Body, Query, Headers, NotGiven, not_given
-from ..._utils import maybe_transform, async_maybe_transform
+from ..._utils import path_template, maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -52,7 +52,7 @@ def with_streaming_response(self) -> SilencesResourceWithStreamingResponse:
def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
body: Iterable[silence_create_params.Body],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -75,10 +75,12 @@ def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._post(
- f"/accounts/{account_id}/alerting/v3/silences",
+ path_template("/accounts/{account_id}/alerting/v3/silences", account_id=account_id),
body=maybe_transform(body, Iterable[silence_create_params.Body]),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -89,7 +91,7 @@ def create(
def update(
self,
*,
- account_id: str,
+ account_id: str | None = None,
body: Iterable[silence_update_params.Body],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -112,10 +114,12 @@ def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/alerting/v3/silences",
+ path_template("/accounts/{account_id}/alerting/v3/silences", account_id=account_id),
page=SyncSinglePage[SilenceUpdateResponse],
body=maybe_transform(body, Iterable[silence_update_params.Body]),
options=make_request_options(
@@ -128,7 +132,7 @@ def update(
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -150,10 +154,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/alerting/v3/silences",
+ path_template("/accounts/{account_id}/alerting/v3/silences", account_id=account_id),
page=SyncSinglePage[SilenceListResponse],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -165,7 +171,7 @@ def delete(
self,
silence_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -189,12 +195,16 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not silence_id:
raise ValueError(f"Expected a non-empty value for `silence_id` but received {silence_id!r}")
return self._delete(
- f"/accounts/{account_id}/alerting/v3/silences/{silence_id}",
+ path_template(
+ "/accounts/{account_id}/alerting/v3/silences/{silence_id}", account_id=account_id, silence_id=silence_id
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -205,7 +215,7 @@ def get(
self,
silence_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -229,12 +239,16 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not silence_id:
raise ValueError(f"Expected a non-empty value for `silence_id` but received {silence_id!r}")
return self._get(
- f"/accounts/{account_id}/alerting/v3/silences/{silence_id}",
+ path_template(
+ "/accounts/{account_id}/alerting/v3/silences/{silence_id}", account_id=account_id, silence_id=silence_id
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -269,7 +283,7 @@ def with_streaming_response(self) -> AsyncSilencesResourceWithStreamingResponse:
async def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
body: Iterable[silence_create_params.Body],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -292,10 +306,12 @@ async def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._post(
- f"/accounts/{account_id}/alerting/v3/silences",
+ path_template("/accounts/{account_id}/alerting/v3/silences", account_id=account_id),
body=await async_maybe_transform(body, Iterable[silence_create_params.Body]),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -306,7 +322,7 @@ async def create(
def update(
self,
*,
- account_id: str,
+ account_id: str | None = None,
body: Iterable[silence_update_params.Body],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -329,10 +345,12 @@ def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/alerting/v3/silences",
+ path_template("/accounts/{account_id}/alerting/v3/silences", account_id=account_id),
page=AsyncSinglePage[SilenceUpdateResponse],
body=maybe_transform(body, Iterable[silence_update_params.Body]),
options=make_request_options(
@@ -345,7 +363,7 @@ def update(
def list(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -367,10 +385,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/alerting/v3/silences",
+ path_template("/accounts/{account_id}/alerting/v3/silences", account_id=account_id),
page=AsyncSinglePage[SilenceListResponse],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -382,7 +402,7 @@ async def delete(
self,
silence_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -406,12 +426,16 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not silence_id:
raise ValueError(f"Expected a non-empty value for `silence_id` but received {silence_id!r}")
return await self._delete(
- f"/accounts/{account_id}/alerting/v3/silences/{silence_id}",
+ path_template(
+ "/accounts/{account_id}/alerting/v3/silences/{silence_id}", account_id=account_id, silence_id=silence_id
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -422,7 +446,7 @@ async def get(
self,
silence_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -446,12 +470,16 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not silence_id:
raise ValueError(f"Expected a non-empty value for `silence_id` but received {silence_id!r}")
return await self._get(
- f"/accounts/{account_id}/alerting/v3/silences/{silence_id}",
+ path_template(
+ "/accounts/{account_id}/alerting/v3/silences/{silence_id}", account_id=account_id, silence_id=silence_id
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/api_gateway/__init__.py b/src/cloudflare/resources/api_gateway/__init__.py
index c93926a6412..2b6b0d96ed3 100644
--- a/src/cloudflare/resources/api_gateway/__init__.py
+++ b/src/cloudflare/resources/api_gateway/__init__.py
@@ -1,5 +1,13 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+from .labels import (
+ LabelsResource,
+ AsyncLabelsResource,
+ LabelsResourceWithRawResponse,
+ AsyncLabelsResourceWithRawResponse,
+ LabelsResourceWithStreamingResponse,
+ AsyncLabelsResourceWithStreamingResponse,
+)
from .schemas import (
SchemasResource,
AsyncSchemasResource,
@@ -78,6 +86,12 @@
"AsyncDiscoveryResourceWithRawResponse",
"DiscoveryResourceWithStreamingResponse",
"AsyncDiscoveryResourceWithStreamingResponse",
+ "LabelsResource",
+ "AsyncLabelsResource",
+ "LabelsResourceWithRawResponse",
+ "AsyncLabelsResourceWithRawResponse",
+ "LabelsResourceWithStreamingResponse",
+ "AsyncLabelsResourceWithStreamingResponse",
"OperationsResource",
"AsyncOperationsResource",
"OperationsResourceWithRawResponse",
diff --git a/src/cloudflare/resources/api_gateway/api.md b/src/cloudflare/resources/api_gateway/api.md
new file mode 100644
index 00000000000..6634bf894b0
--- /dev/null
+++ b/src/cloudflare/resources/api_gateway/api.md
@@ -0,0 +1,270 @@
+# APIGateway
+
+## Configurations
+
+Types:
+
+```python
+from cloudflare.types.api_gateway import Configuration
+```
+
+Methods:
+
+- client.api_gateway.configurations.update(\*, zone_id, \*\*params) -> Configuration
+- client.api_gateway.configurations.get(\*, zone_id, \*\*params) -> Configuration
+
+## Discovery
+
+Types:
+
+```python
+from cloudflare.types.api_gateway import DiscoveryOperation, DiscoveryGetResponse
+```
+
+Methods:
+
+- client.api_gateway.discovery.get(\*, zone_id) -> DiscoveryGetResponse
+
+### Operations
+
+Types:
+
+```python
+from cloudflare.types.api_gateway.discovery import OperationBulkEditResponse, OperationEditResponse
+```
+
+Methods:
+
+- client.api_gateway.discovery.operations.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[DiscoveryOperation]
+- client.api_gateway.discovery.operations.bulk_edit(\*, zone_id, \*\*params) -> OperationBulkEditResponse
+- client.api_gateway.discovery.operations.edit(operation_id, \*, zone_id, \*\*params) -> OperationEditResponse
+
+## Labels
+
+Types:
+
+```python
+from cloudflare.types.api_gateway import LabelListResponse
+```
+
+Methods:
+
+- client.api_gateway.labels.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[LabelListResponse]
+
+### User
+
+Types:
+
+```python
+from cloudflare.types.api_gateway.labels import (
+ UserUpdateResponse,
+ UserDeleteResponse,
+ UserBulkCreateResponse,
+ UserBulkDeleteResponse,
+ UserEditResponse,
+ UserGetResponse,
+)
+```
+
+Methods:
+
+- client.api_gateway.labels.user.update(name, \*, zone_id, \*\*params) -> UserUpdateResponse
+- client.api_gateway.labels.user.delete(name, \*, zone_id) -> UserDeleteResponse
+- client.api_gateway.labels.user.bulk_create(\*, zone_id, \*\*params) -> SyncSinglePage[UserBulkCreateResponse]
+- client.api_gateway.labels.user.bulk_delete(\*, zone_id) -> SyncSinglePage[UserBulkDeleteResponse]
+- client.api_gateway.labels.user.edit(name, \*, zone_id, \*\*params) -> UserEditResponse
+- client.api_gateway.labels.user.get(name, \*, zone_id, \*\*params) -> UserGetResponse
+
+#### Resources
+
+##### Operation
+
+Types:
+
+```python
+from cloudflare.types.api_gateway.labels.user.resources import OperationUpdateResponse
+```
+
+Methods:
+
+- client.api_gateway.labels.user.resources.operation.update(name, \*, zone_id, \*\*params) -> OperationUpdateResponse
+
+### Managed
+
+Types:
+
+```python
+from cloudflare.types.api_gateway.labels import ManagedGetResponse
+```
+
+Methods:
+
+- client.api_gateway.labels.managed.get(name, \*, zone_id, \*\*params) -> ManagedGetResponse
+
+#### Resources
+
+##### Operation
+
+Types:
+
+```python
+from cloudflare.types.api_gateway.labels.managed.resources import OperationUpdateResponse
+```
+
+Methods:
+
+- client.api_gateway.labels.managed.resources.operation.update(name, \*, zone_id, \*\*params) -> OperationUpdateResponse
+
+## Operations
+
+Types:
+
+```python
+from cloudflare.types.api_gateway import (
+ APIShield,
+ OperationCreateResponse,
+ OperationListResponse,
+ OperationDeleteResponse,
+ OperationBulkCreateResponse,
+ OperationBulkDeleteResponse,
+ OperationGetResponse,
+)
+```
+
+Methods:
+
+- client.api_gateway.operations.create(\*, zone_id, \*\*params) -> OperationCreateResponse
+- client.api_gateway.operations.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[OperationListResponse]
+- client.api_gateway.operations.delete(operation_id, \*, zone_id) -> OperationDeleteResponse
+- client.api_gateway.operations.bulk_create(\*, zone_id, \*\*params) -> SyncSinglePage[OperationBulkCreateResponse]
+- client.api_gateway.operations.bulk_delete(\*, zone_id) -> OperationBulkDeleteResponse
+- client.api_gateway.operations.get(operation_id, \*, zone_id, \*\*params) -> OperationGetResponse
+
+### Labels
+
+Types:
+
+```python
+from cloudflare.types.api_gateway.operations import (
+ LabelCreateResponse,
+ LabelUpdateResponse,
+ LabelDeleteResponse,
+ LabelBulkCreateResponse,
+ LabelBulkDeleteResponse,
+ LabelBulkUpdateResponse,
+)
+```
+
+Methods:
+
+- client.api_gateway.operations.labels.create(operation_id, \*, zone_id, \*\*params) -> LabelCreateResponse
+- client.api_gateway.operations.labels.update(operation_id, \*, zone_id, \*\*params) -> LabelUpdateResponse
+- client.api_gateway.operations.labels.delete(operation_id, \*, zone_id) -> LabelDeleteResponse
+- client.api_gateway.operations.labels.bulk_create(\*, zone_id, \*\*params) -> SyncSinglePage[LabelBulkCreateResponse]
+- client.api_gateway.operations.labels.bulk_delete(\*, zone_id) -> SyncSinglePage[LabelBulkDeleteResponse]
+- client.api_gateway.operations.labels.bulk_update(\*, zone_id, \*\*params) -> SyncSinglePage[LabelBulkUpdateResponse]
+
+### SchemaValidation
+
+Types:
+
+```python
+from cloudflare.types.api_gateway.operations import (
+ SettingsMultipleRequest,
+ SchemaValidationUpdateResponse,
+ SchemaValidationGetResponse,
+)
+```
+
+Methods:
+
+- client.api_gateway.operations.schema_validation.update(operation_id, \*, zone_id, \*\*params) -> SchemaValidationUpdateResponse
+- client.api_gateway.operations.schema_validation.edit(\*, zone_id, \*\*params) -> SettingsMultipleRequest
+- client.api_gateway.operations.schema_validation.get(operation_id, \*, zone_id) -> SchemaValidationGetResponse
+
+## Schemas
+
+Types:
+
+```python
+from cloudflare.types.api_gateway import SchemaListResponse
+```
+
+Methods:
+
+- client.api_gateway.schemas.list(\*, zone_id, \*\*params) -> SchemaListResponse
+
+## Settings
+
+Types:
+
+```python
+from cloudflare.types.api_gateway import Settings
+```
+
+### SchemaValidation
+
+Methods:
+
+- client.api_gateway.settings.schema_validation.update(\*, zone_id, \*\*params) -> Settings
+- client.api_gateway.settings.schema_validation.edit(\*, zone_id, \*\*params) -> Settings
+- client.api_gateway.settings.schema_validation.get(\*, zone_id) -> Settings
+
+## UserSchemas
+
+Types:
+
+```python
+from cloudflare.types.api_gateway import (
+ Message,
+ OldPublicSchema,
+ UserSchemaCreateResponse,
+ UserSchemaDeleteResponse,
+)
+```
+
+Methods:
+
+- client.api_gateway.user_schemas.create(\*, zone_id, \*\*params) -> UserSchemaCreateResponse
+- client.api_gateway.user_schemas.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[OldPublicSchema]
+- client.api_gateway.user_schemas.delete(schema_id, \*, zone_id) -> UserSchemaDeleteResponse
+- client.api_gateway.user_schemas.edit(schema_id, \*, zone_id, \*\*params) -> OldPublicSchema
+- client.api_gateway.user_schemas.get(schema_id, \*, zone_id, \*\*params) -> OldPublicSchema
+
+### Operations
+
+Types:
+
+```python
+from cloudflare.types.api_gateway.user_schemas import OperationListResponse
+```
+
+Methods:
+
+- client.api_gateway.user_schemas.operations.list(schema_id, \*, zone_id, \*\*params) -> SyncV4PagePaginationArray[OperationListResponse]
+
+### Hosts
+
+Types:
+
+```python
+from cloudflare.types.api_gateway.user_schemas import HostListResponse
+```
+
+Methods:
+
+- client.api_gateway.user_schemas.hosts.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[HostListResponse]
+
+## ExpressionTemplate
+
+### Fallthrough
+
+Types:
+
+```python
+from cloudflare.types.api_gateway.expression_template import FallthroughCreateResponse
+```
+
+Methods:
+
+- client.api_gateway.expression_template.fallthrough.create(\*, zone_id, \*\*params) -> FallthroughCreateResponse
diff --git a/src/cloudflare/resources/api_gateway/api_gateway.py b/src/cloudflare/resources/api_gateway/api_gateway.py
index 70917610f7d..5da73ba77b0 100644
--- a/src/cloudflare/resources/api_gateway/api_gateway.py
+++ b/src/cloudflare/resources/api_gateway/api_gateway.py
@@ -12,6 +12,14 @@
)
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
+from .labels.labels import (
+ LabelsResource,
+ AsyncLabelsResource,
+ LabelsResourceWithRawResponse,
+ AsyncLabelsResourceWithRawResponse,
+ LabelsResourceWithStreamingResponse,
+ AsyncLabelsResourceWithStreamingResponse,
+)
from .configurations import (
ConfigurationsResource,
AsyncConfigurationsResource,
@@ -73,6 +81,10 @@ def configurations(self) -> ConfigurationsResource:
def discovery(self) -> DiscoveryResource:
return DiscoveryResource(self._client)
+ @cached_property
+ def labels(self) -> LabelsResource:
+ return LabelsResource(self._client)
+
@cached_property
def operations(self) -> OperationsResource:
return OperationsResource(self._client)
@@ -122,6 +134,10 @@ def configurations(self) -> AsyncConfigurationsResource:
def discovery(self) -> AsyncDiscoveryResource:
return AsyncDiscoveryResource(self._client)
+ @cached_property
+ def labels(self) -> AsyncLabelsResource:
+ return AsyncLabelsResource(self._client)
+
@cached_property
def operations(self) -> AsyncOperationsResource:
return AsyncOperationsResource(self._client)
@@ -174,6 +190,10 @@ def configurations(self) -> ConfigurationsResourceWithRawResponse:
def discovery(self) -> DiscoveryResourceWithRawResponse:
return DiscoveryResourceWithRawResponse(self._api_gateway.discovery)
+ @cached_property
+ def labels(self) -> LabelsResourceWithRawResponse:
+ return LabelsResourceWithRawResponse(self._api_gateway.labels)
+
@cached_property
def operations(self) -> OperationsResourceWithRawResponse:
return OperationsResourceWithRawResponse(self._api_gateway.operations)
@@ -207,6 +227,10 @@ def configurations(self) -> AsyncConfigurationsResourceWithRawResponse:
def discovery(self) -> AsyncDiscoveryResourceWithRawResponse:
return AsyncDiscoveryResourceWithRawResponse(self._api_gateway.discovery)
+ @cached_property
+ def labels(self) -> AsyncLabelsResourceWithRawResponse:
+ return AsyncLabelsResourceWithRawResponse(self._api_gateway.labels)
+
@cached_property
def operations(self) -> AsyncOperationsResourceWithRawResponse:
return AsyncOperationsResourceWithRawResponse(self._api_gateway.operations)
@@ -240,6 +264,10 @@ def configurations(self) -> ConfigurationsResourceWithStreamingResponse:
def discovery(self) -> DiscoveryResourceWithStreamingResponse:
return DiscoveryResourceWithStreamingResponse(self._api_gateway.discovery)
+ @cached_property
+ def labels(self) -> LabelsResourceWithStreamingResponse:
+ return LabelsResourceWithStreamingResponse(self._api_gateway.labels)
+
@cached_property
def operations(self) -> OperationsResourceWithStreamingResponse:
return OperationsResourceWithStreamingResponse(self._api_gateway.operations)
@@ -273,6 +301,10 @@ def configurations(self) -> AsyncConfigurationsResourceWithStreamingResponse:
def discovery(self) -> AsyncDiscoveryResourceWithStreamingResponse:
return AsyncDiscoveryResourceWithStreamingResponse(self._api_gateway.discovery)
+ @cached_property
+ def labels(self) -> AsyncLabelsResourceWithStreamingResponse:
+ return AsyncLabelsResourceWithStreamingResponse(self._api_gateway.labels)
+
@cached_property
def operations(self) -> AsyncOperationsResourceWithStreamingResponse:
return AsyncOperationsResourceWithStreamingResponse(self._api_gateway.operations)
diff --git a/src/cloudflare/resources/api_gateway/configurations.py b/src/cloudflare/resources/api_gateway/configurations.py
index 96cebe13223..c79d9f3fc16 100644
--- a/src/cloudflare/resources/api_gateway/configurations.py
+++ b/src/cloudflare/resources/api_gateway/configurations.py
@@ -7,7 +7,7 @@
import httpx
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ..._utils import maybe_transform, async_maybe_transform
+from ..._utils import path_template, maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -47,7 +47,7 @@ def with_streaming_response(self) -> ConfigurationsResourceWithStreamingResponse
def update(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
auth_id_characteristics: Iterable[configuration_update_params.AuthIDCharacteristic],
normalize: bool | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -57,8 +57,10 @@ def update(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> Configuration:
- """
- Update configuration properties
+ """Updates API Shield configuration settings for a zone.
+
+ Can modify validation
+ strictness, enforcement mode, and other global settings.
Args:
zone_id: Identifier.
@@ -73,10 +75,12 @@ def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return self._put(
- f"/zones/{zone_id}/api_gateway/configuration",
+ path_template("/zones/{zone_id}/api_gateway/configuration", zone_id=zone_id),
body=maybe_transform(
{"auth_id_characteristics": auth_id_characteristics},
configuration_update_params.ConfigurationUpdateParams,
@@ -95,7 +99,7 @@ def update(
def get(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
normalize: bool | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -105,7 +109,8 @@ def get(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> Configuration:
"""
- Retrieve information about specific configuration properties
+ Gets the current API Shield configuration settings for a zone, including
+ validation behavior and enforcement mode.
Args:
zone_id: Identifier.
@@ -120,10 +125,12 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return self._get(
- f"/zones/{zone_id}/api_gateway/configuration",
+ path_template("/zones/{zone_id}/api_gateway/configuration", zone_id=zone_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -159,7 +166,7 @@ def with_streaming_response(self) -> AsyncConfigurationsResourceWithStreamingRes
async def update(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
auth_id_characteristics: Iterable[configuration_update_params.AuthIDCharacteristic],
normalize: bool | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -169,8 +176,10 @@ async def update(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> Configuration:
- """
- Update configuration properties
+ """Updates API Shield configuration settings for a zone.
+
+ Can modify validation
+ strictness, enforcement mode, and other global settings.
Args:
zone_id: Identifier.
@@ -185,10 +194,12 @@ async def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return await self._put(
- f"/zones/{zone_id}/api_gateway/configuration",
+ path_template("/zones/{zone_id}/api_gateway/configuration", zone_id=zone_id),
body=await async_maybe_transform(
{"auth_id_characteristics": auth_id_characteristics},
configuration_update_params.ConfigurationUpdateParams,
@@ -209,7 +220,7 @@ async def update(
async def get(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
normalize: bool | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -219,7 +230,8 @@ async def get(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> Configuration:
"""
- Retrieve information about specific configuration properties
+ Gets the current API Shield configuration settings for a zone, including
+ validation behavior and enforcement mode.
Args:
zone_id: Identifier.
@@ -234,10 +246,12 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return await self._get(
- f"/zones/{zone_id}/api_gateway/configuration",
+ path_template("/zones/{zone_id}/api_gateway/configuration", zone_id=zone_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/api_gateway/discovery/discovery.py b/src/cloudflare/resources/api_gateway/discovery/discovery.py
index a465c6fc4a9..4e20f1bc08e 100644
--- a/src/cloudflare/resources/api_gateway/discovery/discovery.py
+++ b/src/cloudflare/resources/api_gateway/discovery/discovery.py
@@ -7,6 +7,7 @@
import httpx
from ...._types import Body, Query, Headers, NotGiven, not_given
+from ...._utils import path_template
from ...._compat import cached_property
from .operations import (
OperationsResource,
@@ -57,7 +58,7 @@ def with_streaming_response(self) -> DiscoveryResourceWithStreamingResponse:
def get(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -80,10 +81,12 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return self._get(
- f"/zones/{zone_id}/api_gateway/discovery",
+ path_template("/zones/{zone_id}/api_gateway/discovery", zone_id=zone_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -122,7 +125,7 @@ def with_streaming_response(self) -> AsyncDiscoveryResourceWithStreamingResponse
async def get(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -145,10 +148,12 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return await self._get(
- f"/zones/{zone_id}/api_gateway/discovery",
+ path_template("/zones/{zone_id}/api_gateway/discovery", zone_id=zone_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/api_gateway/discovery/operations.py b/src/cloudflare/resources/api_gateway/discovery/operations.py
index 76aeb31fde9..f7f224726c4 100644
--- a/src/cloudflare/resources/api_gateway/discovery/operations.py
+++ b/src/cloudflare/resources/api_gateway/discovery/operations.py
@@ -8,7 +8,7 @@
import httpx
from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
-from ...._utils import maybe_transform, async_maybe_transform
+from ...._utils import path_template, maybe_transform, async_maybe_transform
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -51,7 +51,7 @@ def with_streaming_response(self) -> OperationsResourceWithStreamingResponse:
def list(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
diff: bool | Omit = omit,
direction: Literal["asc", "desc"] | Omit = omit,
endpoint: str | Omit = omit,
@@ -117,10 +117,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return self._get_api_list(
- f"/zones/{zone_id}/api_gateway/discovery/operations",
+ path_template("/zones/{zone_id}/api_gateway/discovery/operations", zone_id=zone_id),
page=SyncV4PagePaginationArray[DiscoveryOperation],
options=make_request_options(
extra_headers=extra_headers,
@@ -149,7 +151,7 @@ def list(
def bulk_edit(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
body: Dict[str, operation_bulk_edit_params.Body],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -172,10 +174,12 @@ def bulk_edit(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return self._patch(
- f"/zones/{zone_id}/api_gateway/discovery/operations",
+ path_template("/zones/{zone_id}/api_gateway/discovery/operations", zone_id=zone_id),
body=maybe_transform(body, operation_bulk_edit_params.OperationBulkEditParams),
options=make_request_options(
extra_headers=extra_headers,
@@ -191,7 +195,7 @@ def edit(
self,
operation_id: str,
*,
- zone_id: str,
+ zone_id: str | None = None,
state: Literal["review", "ignored"] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -221,12 +225,18 @@ def edit(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not operation_id:
raise ValueError(f"Expected a non-empty value for `operation_id` but received {operation_id!r}")
return self._patch(
- f"/zones/{zone_id}/api_gateway/discovery/operations/{operation_id}",
+ path_template(
+ "/zones/{zone_id}/api_gateway/discovery/operations/{operation_id}",
+ zone_id=zone_id,
+ operation_id=operation_id,
+ ),
body=maybe_transform({"state": state}, operation_edit_params.OperationEditParams),
options=make_request_options(
extra_headers=extra_headers,
@@ -262,7 +272,7 @@ def with_streaming_response(self) -> AsyncOperationsResourceWithStreamingRespons
def list(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
diff: bool | Omit = omit,
direction: Literal["asc", "desc"] | Omit = omit,
endpoint: str | Omit = omit,
@@ -328,10 +338,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return self._get_api_list(
- f"/zones/{zone_id}/api_gateway/discovery/operations",
+ path_template("/zones/{zone_id}/api_gateway/discovery/operations", zone_id=zone_id),
page=AsyncV4PagePaginationArray[DiscoveryOperation],
options=make_request_options(
extra_headers=extra_headers,
@@ -360,7 +372,7 @@ def list(
async def bulk_edit(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
body: Dict[str, operation_bulk_edit_params.Body],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -383,10 +395,12 @@ async def bulk_edit(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return await self._patch(
- f"/zones/{zone_id}/api_gateway/discovery/operations",
+ path_template("/zones/{zone_id}/api_gateway/discovery/operations", zone_id=zone_id),
body=await async_maybe_transform(body, operation_bulk_edit_params.OperationBulkEditParams),
options=make_request_options(
extra_headers=extra_headers,
@@ -402,7 +416,7 @@ async def edit(
self,
operation_id: str,
*,
- zone_id: str,
+ zone_id: str | None = None,
state: Literal["review", "ignored"] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -432,12 +446,18 @@ async def edit(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not operation_id:
raise ValueError(f"Expected a non-empty value for `operation_id` but received {operation_id!r}")
return await self._patch(
- f"/zones/{zone_id}/api_gateway/discovery/operations/{operation_id}",
+ path_template(
+ "/zones/{zone_id}/api_gateway/discovery/operations/{operation_id}",
+ zone_id=zone_id,
+ operation_id=operation_id,
+ ),
body=await async_maybe_transform({"state": state}, operation_edit_params.OperationEditParams),
options=make_request_options(
extra_headers=extra_headers,
diff --git a/src/cloudflare/resources/api_gateway/expression_template/fallthrough.py b/src/cloudflare/resources/api_gateway/expression_template/fallthrough.py
index 1434470cfad..ad850206763 100644
--- a/src/cloudflare/resources/api_gateway/expression_template/fallthrough.py
+++ b/src/cloudflare/resources/api_gateway/expression_template/fallthrough.py
@@ -7,7 +7,7 @@
import httpx
from ...._types import Body, Query, Headers, NotGiven, SequenceNotStr, not_given
-from ...._utils import maybe_transform, async_maybe_transform
+from ...._utils import path_template, maybe_transform, async_maybe_transform
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -47,7 +47,7 @@ def with_streaming_response(self) -> FallthroughResourceWithStreamingResponse:
def create(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
hosts: SequenceNotStr[str],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -56,8 +56,10 @@ def create(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> FallthroughCreateResponse:
- """
- Generate fallthrough WAF expression template from a set of API hosts
+ """Creates an expression template fallthrough rule for API Shield.
+
+ Used for
+ configuring default behavior when no other expression templates match.
Args:
zone_id: Identifier.
@@ -72,10 +74,12 @@ def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return self._post(
- f"/zones/{zone_id}/api_gateway/expression-template/fallthrough",
+ path_template("/zones/{zone_id}/api_gateway/expression-template/fallthrough", zone_id=zone_id),
body=maybe_transform({"hosts": hosts}, fallthrough_create_params.FallthroughCreateParams),
options=make_request_options(
extra_headers=extra_headers,
@@ -111,7 +115,7 @@ def with_streaming_response(self) -> AsyncFallthroughResourceWithStreamingRespon
async def create(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
hosts: SequenceNotStr[str],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -120,8 +124,10 @@ async def create(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> FallthroughCreateResponse:
- """
- Generate fallthrough WAF expression template from a set of API hosts
+ """Creates an expression template fallthrough rule for API Shield.
+
+ Used for
+ configuring default behavior when no other expression templates match.
Args:
zone_id: Identifier.
@@ -136,10 +142,12 @@ async def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return await self._post(
- f"/zones/{zone_id}/api_gateway/expression-template/fallthrough",
+ path_template("/zones/{zone_id}/api_gateway/expression-template/fallthrough", zone_id=zone_id),
body=await async_maybe_transform({"hosts": hosts}, fallthrough_create_params.FallthroughCreateParams),
options=make_request_options(
extra_headers=extra_headers,
diff --git a/src/cloudflare/resources/api_gateway/labels/__init__.py b/src/cloudflare/resources/api_gateway/labels/__init__.py
new file mode 100644
index 00000000000..95f9b9debcd
--- /dev/null
+++ b/src/cloudflare/resources/api_gateway/labels/__init__.py
@@ -0,0 +1,47 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from .user import (
+ UserResource,
+ AsyncUserResource,
+ UserResourceWithRawResponse,
+ AsyncUserResourceWithRawResponse,
+ UserResourceWithStreamingResponse,
+ AsyncUserResourceWithStreamingResponse,
+)
+from .labels import (
+ LabelsResource,
+ AsyncLabelsResource,
+ LabelsResourceWithRawResponse,
+ AsyncLabelsResourceWithRawResponse,
+ LabelsResourceWithStreamingResponse,
+ AsyncLabelsResourceWithStreamingResponse,
+)
+from .managed import (
+ ManagedResource,
+ AsyncManagedResource,
+ ManagedResourceWithRawResponse,
+ AsyncManagedResourceWithRawResponse,
+ ManagedResourceWithStreamingResponse,
+ AsyncManagedResourceWithStreamingResponse,
+)
+
+__all__ = [
+ "UserResource",
+ "AsyncUserResource",
+ "UserResourceWithRawResponse",
+ "AsyncUserResourceWithRawResponse",
+ "UserResourceWithStreamingResponse",
+ "AsyncUserResourceWithStreamingResponse",
+ "ManagedResource",
+ "AsyncManagedResource",
+ "ManagedResourceWithRawResponse",
+ "AsyncManagedResourceWithRawResponse",
+ "ManagedResourceWithStreamingResponse",
+ "AsyncManagedResourceWithStreamingResponse",
+ "LabelsResource",
+ "AsyncLabelsResource",
+ "LabelsResourceWithRawResponse",
+ "AsyncLabelsResourceWithRawResponse",
+ "LabelsResourceWithStreamingResponse",
+ "AsyncLabelsResourceWithStreamingResponse",
+]
diff --git a/src/cloudflare/resources/api_gateway/labels/labels.py b/src/cloudflare/resources/api_gateway/labels/labels.py
new file mode 100644
index 00000000000..0072827b371
--- /dev/null
+++ b/src/cloudflare/resources/api_gateway/labels/labels.py
@@ -0,0 +1,316 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing_extensions import Literal
+
+import httpx
+
+from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
+from ...._utils import path_template, maybe_transform
+from .user.user import (
+ UserResource,
+ AsyncUserResource,
+ UserResourceWithRawResponse,
+ AsyncUserResourceWithRawResponse,
+ UserResourceWithStreamingResponse,
+ AsyncUserResourceWithStreamingResponse,
+)
+from ...._compat import cached_property
+from ...._resource import SyncAPIResource, AsyncAPIResource
+from ...._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray
+from ...._base_client import AsyncPaginator, make_request_options
+from .managed.managed import (
+ ManagedResource,
+ AsyncManagedResource,
+ ManagedResourceWithRawResponse,
+ AsyncManagedResourceWithRawResponse,
+ ManagedResourceWithStreamingResponse,
+ AsyncManagedResourceWithStreamingResponse,
+)
+from ....types.api_gateway import label_list_params
+from ....types.api_gateway.label_list_response import LabelListResponse
+
+__all__ = ["LabelsResource", "AsyncLabelsResource"]
+
+
+class LabelsResource(SyncAPIResource):
+ @cached_property
+ def user(self) -> UserResource:
+ return UserResource(self._client)
+
+ @cached_property
+ def managed(self) -> ManagedResource:
+ return ManagedResource(self._client)
+
+ @cached_property
+ def with_raw_response(self) -> LabelsResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return LabelsResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> LabelsResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return LabelsResourceWithStreamingResponse(self)
+
+ def list(
+ self,
+ *,
+ zone_id: str | None = None,
+ direction: Literal["asc", "desc"] | Omit = omit,
+ filter: str | Omit = omit,
+ order: Literal["name", "description", "created_at", "last_updated", "mapped_resources.operations"]
+ | Omit = omit,
+ page: int | Omit = omit,
+ per_page: int | Omit = omit,
+ source: Literal["user", "managed"] | Omit = omit,
+ with_mapped_resource_counts: bool | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> SyncV4PagePaginationArray[LabelListResponse]:
+ """
+ Retrieve all labels
+
+ Args:
+ zone_id: Identifier.
+
+ direction: Direction to order results.
+
+ filter: Filter for labels where the name or description matches using substring match
+
+ order: Field to order by
+
+ page: Page number of paginated results.
+
+ per_page: Maximum number of results per page.
+
+ source: Filter for labels with source
+
+ with_mapped_resource_counts: Include `mapped_resources` for each label
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ return self._get_api_list(
+ path_template("/zones/{zone_id}/api_gateway/labels", zone_id=zone_id),
+ page=SyncV4PagePaginationArray[LabelListResponse],
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "direction": direction,
+ "filter": filter,
+ "order": order,
+ "page": page,
+ "per_page": per_page,
+ "source": source,
+ "with_mapped_resource_counts": with_mapped_resource_counts,
+ },
+ label_list_params.LabelListParams,
+ ),
+ ),
+ model=LabelListResponse,
+ )
+
+
+class AsyncLabelsResource(AsyncAPIResource):
+ @cached_property
+ def user(self) -> AsyncUserResource:
+ return AsyncUserResource(self._client)
+
+ @cached_property
+ def managed(self) -> AsyncManagedResource:
+ return AsyncManagedResource(self._client)
+
+ @cached_property
+ def with_raw_response(self) -> AsyncLabelsResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncLabelsResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncLabelsResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return AsyncLabelsResourceWithStreamingResponse(self)
+
+ def list(
+ self,
+ *,
+ zone_id: str | None = None,
+ direction: Literal["asc", "desc"] | Omit = omit,
+ filter: str | Omit = omit,
+ order: Literal["name", "description", "created_at", "last_updated", "mapped_resources.operations"]
+ | Omit = omit,
+ page: int | Omit = omit,
+ per_page: int | Omit = omit,
+ source: Literal["user", "managed"] | Omit = omit,
+ with_mapped_resource_counts: bool | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> AsyncPaginator[LabelListResponse, AsyncV4PagePaginationArray[LabelListResponse]]:
+ """
+ Retrieve all labels
+
+ Args:
+ zone_id: Identifier.
+
+ direction: Direction to order results.
+
+ filter: Filter for labels where the name or description matches using substring match
+
+ order: Field to order by
+
+ page: Page number of paginated results.
+
+ per_page: Maximum number of results per page.
+
+ source: Filter for labels with source
+
+ with_mapped_resource_counts: Include `mapped_resources` for each label
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ return self._get_api_list(
+ path_template("/zones/{zone_id}/api_gateway/labels", zone_id=zone_id),
+ page=AsyncV4PagePaginationArray[LabelListResponse],
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "direction": direction,
+ "filter": filter,
+ "order": order,
+ "page": page,
+ "per_page": per_page,
+ "source": source,
+ "with_mapped_resource_counts": with_mapped_resource_counts,
+ },
+ label_list_params.LabelListParams,
+ ),
+ ),
+ model=LabelListResponse,
+ )
+
+
+class LabelsResourceWithRawResponse:
+ def __init__(self, labels: LabelsResource) -> None:
+ self._labels = labels
+
+ self.list = to_raw_response_wrapper(
+ labels.list,
+ )
+
+ @cached_property
+ def user(self) -> UserResourceWithRawResponse:
+ return UserResourceWithRawResponse(self._labels.user)
+
+ @cached_property
+ def managed(self) -> ManagedResourceWithRawResponse:
+ return ManagedResourceWithRawResponse(self._labels.managed)
+
+
+class AsyncLabelsResourceWithRawResponse:
+ def __init__(self, labels: AsyncLabelsResource) -> None:
+ self._labels = labels
+
+ self.list = async_to_raw_response_wrapper(
+ labels.list,
+ )
+
+ @cached_property
+ def user(self) -> AsyncUserResourceWithRawResponse:
+ return AsyncUserResourceWithRawResponse(self._labels.user)
+
+ @cached_property
+ def managed(self) -> AsyncManagedResourceWithRawResponse:
+ return AsyncManagedResourceWithRawResponse(self._labels.managed)
+
+
+class LabelsResourceWithStreamingResponse:
+ def __init__(self, labels: LabelsResource) -> None:
+ self._labels = labels
+
+ self.list = to_streamed_response_wrapper(
+ labels.list,
+ )
+
+ @cached_property
+ def user(self) -> UserResourceWithStreamingResponse:
+ return UserResourceWithStreamingResponse(self._labels.user)
+
+ @cached_property
+ def managed(self) -> ManagedResourceWithStreamingResponse:
+ return ManagedResourceWithStreamingResponse(self._labels.managed)
+
+
+class AsyncLabelsResourceWithStreamingResponse:
+ def __init__(self, labels: AsyncLabelsResource) -> None:
+ self._labels = labels
+
+ self.list = async_to_streamed_response_wrapper(
+ labels.list,
+ )
+
+ @cached_property
+ def user(self) -> AsyncUserResourceWithStreamingResponse:
+ return AsyncUserResourceWithStreamingResponse(self._labels.user)
+
+ @cached_property
+ def managed(self) -> AsyncManagedResourceWithStreamingResponse:
+ return AsyncManagedResourceWithStreamingResponse(self._labels.managed)
diff --git a/src/cloudflare/resources/api_gateway/labels/managed/__init__.py b/src/cloudflare/resources/api_gateway/labels/managed/__init__.py
new file mode 100644
index 00000000000..5bd9c6fa3b7
--- /dev/null
+++ b/src/cloudflare/resources/api_gateway/labels/managed/__init__.py
@@ -0,0 +1,33 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from .managed import (
+ ManagedResource,
+ AsyncManagedResource,
+ ManagedResourceWithRawResponse,
+ AsyncManagedResourceWithRawResponse,
+ ManagedResourceWithStreamingResponse,
+ AsyncManagedResourceWithStreamingResponse,
+)
+from .resources import (
+ ResourcesResource,
+ AsyncResourcesResource,
+ ResourcesResourceWithRawResponse,
+ AsyncResourcesResourceWithRawResponse,
+ ResourcesResourceWithStreamingResponse,
+ AsyncResourcesResourceWithStreamingResponse,
+)
+
+__all__ = [
+ "ResourcesResource",
+ "AsyncResourcesResource",
+ "ResourcesResourceWithRawResponse",
+ "AsyncResourcesResourceWithRawResponse",
+ "ResourcesResourceWithStreamingResponse",
+ "AsyncResourcesResourceWithStreamingResponse",
+ "ManagedResource",
+ "AsyncManagedResource",
+ "ManagedResourceWithRawResponse",
+ "AsyncManagedResourceWithRawResponse",
+ "ManagedResourceWithStreamingResponse",
+ "AsyncManagedResourceWithStreamingResponse",
+]
diff --git a/src/cloudflare/resources/api_gateway/labels/managed/managed.py b/src/cloudflare/resources/api_gateway/labels/managed/managed.py
new file mode 100644
index 00000000000..9a1c9a7dc32
--- /dev/null
+++ b/src/cloudflare/resources/api_gateway/labels/managed/managed.py
@@ -0,0 +1,238 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Type, cast
+
+import httpx
+
+from ....._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
+from ....._utils import path_template, maybe_transform, async_maybe_transform
+from ....._compat import cached_property
+from ....._resource import SyncAPIResource, AsyncAPIResource
+from ....._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from ....._wrappers import ResultWrapper
+from ....._base_client import make_request_options
+from .resources.resources import (
+ ResourcesResource,
+ AsyncResourcesResource,
+ ResourcesResourceWithRawResponse,
+ AsyncResourcesResourceWithRawResponse,
+ ResourcesResourceWithStreamingResponse,
+ AsyncResourcesResourceWithStreamingResponse,
+)
+from .....types.api_gateway.labels import managed_get_params
+from .....types.api_gateway.labels.managed_get_response import ManagedGetResponse
+
+__all__ = ["ManagedResource", "AsyncManagedResource"]
+
+
+class ManagedResource(SyncAPIResource):
+ @cached_property
+ def resources(self) -> ResourcesResource:
+ return ResourcesResource(self._client)
+
+ @cached_property
+ def with_raw_response(self) -> ManagedResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return ManagedResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> ManagedResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return ManagedResourceWithStreamingResponse(self)
+
+ def get(
+ self,
+ name: str,
+ *,
+ zone_id: str | None = None,
+ with_mapped_resource_counts: bool | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> ManagedGetResponse:
+ """
+ Retrieve managed label
+
+ Args:
+ zone_id: Identifier.
+
+ name: The name of the label
+
+ with_mapped_resource_counts: Include `mapped_resources` for each label
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ return self._get(
+ path_template("/zones/{zone_id}/api_gateway/labels/managed/{name}", zone_id=zone_id, name=name),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {"with_mapped_resource_counts": with_mapped_resource_counts}, managed_get_params.ManagedGetParams
+ ),
+ post_parser=ResultWrapper[ManagedGetResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[ManagedGetResponse], ResultWrapper[ManagedGetResponse]),
+ )
+
+
+class AsyncManagedResource(AsyncAPIResource):
+ @cached_property
+ def resources(self) -> AsyncResourcesResource:
+ return AsyncResourcesResource(self._client)
+
+ @cached_property
+ def with_raw_response(self) -> AsyncManagedResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncManagedResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncManagedResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return AsyncManagedResourceWithStreamingResponse(self)
+
+ async def get(
+ self,
+ name: str,
+ *,
+ zone_id: str | None = None,
+ with_mapped_resource_counts: bool | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> ManagedGetResponse:
+ """
+ Retrieve managed label
+
+ Args:
+ zone_id: Identifier.
+
+ name: The name of the label
+
+ with_mapped_resource_counts: Include `mapped_resources` for each label
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ return await self._get(
+ path_template("/zones/{zone_id}/api_gateway/labels/managed/{name}", zone_id=zone_id, name=name),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=await async_maybe_transform(
+ {"with_mapped_resource_counts": with_mapped_resource_counts}, managed_get_params.ManagedGetParams
+ ),
+ post_parser=ResultWrapper[ManagedGetResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[ManagedGetResponse], ResultWrapper[ManagedGetResponse]),
+ )
+
+
+class ManagedResourceWithRawResponse:
+ def __init__(self, managed: ManagedResource) -> None:
+ self._managed = managed
+
+ self.get = to_raw_response_wrapper(
+ managed.get,
+ )
+
+ @cached_property
+ def resources(self) -> ResourcesResourceWithRawResponse:
+ return ResourcesResourceWithRawResponse(self._managed.resources)
+
+
+class AsyncManagedResourceWithRawResponse:
+ def __init__(self, managed: AsyncManagedResource) -> None:
+ self._managed = managed
+
+ self.get = async_to_raw_response_wrapper(
+ managed.get,
+ )
+
+ @cached_property
+ def resources(self) -> AsyncResourcesResourceWithRawResponse:
+ return AsyncResourcesResourceWithRawResponse(self._managed.resources)
+
+
+class ManagedResourceWithStreamingResponse:
+ def __init__(self, managed: ManagedResource) -> None:
+ self._managed = managed
+
+ self.get = to_streamed_response_wrapper(
+ managed.get,
+ )
+
+ @cached_property
+ def resources(self) -> ResourcesResourceWithStreamingResponse:
+ return ResourcesResourceWithStreamingResponse(self._managed.resources)
+
+
+class AsyncManagedResourceWithStreamingResponse:
+ def __init__(self, managed: AsyncManagedResource) -> None:
+ self._managed = managed
+
+ self.get = async_to_streamed_response_wrapper(
+ managed.get,
+ )
+
+ @cached_property
+ def resources(self) -> AsyncResourcesResourceWithStreamingResponse:
+ return AsyncResourcesResourceWithStreamingResponse(self._managed.resources)
diff --git a/src/cloudflare/resources/api_gateway/labels/managed/resources/__init__.py b/src/cloudflare/resources/api_gateway/labels/managed/resources/__init__.py
new file mode 100644
index 00000000000..b30c92d0f74
--- /dev/null
+++ b/src/cloudflare/resources/api_gateway/labels/managed/resources/__init__.py
@@ -0,0 +1,33 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from .operation import (
+ OperationResource,
+ AsyncOperationResource,
+ OperationResourceWithRawResponse,
+ AsyncOperationResourceWithRawResponse,
+ OperationResourceWithStreamingResponse,
+ AsyncOperationResourceWithStreamingResponse,
+)
+from .resources import (
+ ResourcesResource,
+ AsyncResourcesResource,
+ ResourcesResourceWithRawResponse,
+ AsyncResourcesResourceWithRawResponse,
+ ResourcesResourceWithStreamingResponse,
+ AsyncResourcesResourceWithStreamingResponse,
+)
+
+__all__ = [
+ "OperationResource",
+ "AsyncOperationResource",
+ "OperationResourceWithRawResponse",
+ "AsyncOperationResourceWithRawResponse",
+ "OperationResourceWithStreamingResponse",
+ "AsyncOperationResourceWithStreamingResponse",
+ "ResourcesResource",
+ "AsyncResourcesResource",
+ "ResourcesResourceWithRawResponse",
+ "AsyncResourcesResourceWithRawResponse",
+ "ResourcesResourceWithStreamingResponse",
+ "AsyncResourcesResourceWithStreamingResponse",
+]
diff --git a/src/cloudflare/resources/api_gateway/labels/managed/resources/operation.py b/src/cloudflare/resources/api_gateway/labels/managed/resources/operation.py
new file mode 100644
index 00000000000..632bc9392db
--- /dev/null
+++ b/src/cloudflare/resources/api_gateway/labels/managed/resources/operation.py
@@ -0,0 +1,206 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Type, cast
+
+import httpx
+
+from ......_types import Body, Query, Headers, NotGiven, not_given
+from ......_utils import path_template, maybe_transform, async_maybe_transform
+from ......_compat import cached_property
+from ......_resource import SyncAPIResource, AsyncAPIResource
+from ......_response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from ......_wrappers import ResultWrapper
+from ......_base_client import make_request_options
+from ......types.api_gateway.labels.managed.resources import operation_update_params
+from ......types.api_gateway.labels.managed.resources.operation_update_response import OperationUpdateResponse
+
+__all__ = ["OperationResource", "AsyncOperationResource"]
+
+
+class OperationResource(SyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> OperationResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return OperationResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> OperationResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return OperationResourceWithStreamingResponse(self)
+
+ def update(
+ self,
+ name: str,
+ *,
+ zone_id: str | None = None,
+ selector: operation_update_params.Selector,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> OperationUpdateResponse:
+ """
+ Replace all operations(s) attached to a managed label
+
+ Args:
+ zone_id: Identifier.
+
+ name: The name of the label
+
+ selector: Operation IDs selector
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ return self._put(
+ path_template(
+ "/zones/{zone_id}/api_gateway/labels/managed/{name}/resources/operation", zone_id=zone_id, name=name
+ ),
+ body=maybe_transform({"selector": selector}, operation_update_params.OperationUpdateParams),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[OperationUpdateResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[OperationUpdateResponse], ResultWrapper[OperationUpdateResponse]),
+ )
+
+
+class AsyncOperationResource(AsyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> AsyncOperationResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncOperationResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncOperationResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return AsyncOperationResourceWithStreamingResponse(self)
+
+ async def update(
+ self,
+ name: str,
+ *,
+ zone_id: str | None = None,
+ selector: operation_update_params.Selector,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> OperationUpdateResponse:
+ """
+ Replace all operations(s) attached to a managed label
+
+ Args:
+ zone_id: Identifier.
+
+ name: The name of the label
+
+ selector: Operation IDs selector
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ return await self._put(
+ path_template(
+ "/zones/{zone_id}/api_gateway/labels/managed/{name}/resources/operation", zone_id=zone_id, name=name
+ ),
+ body=await async_maybe_transform({"selector": selector}, operation_update_params.OperationUpdateParams),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[OperationUpdateResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[OperationUpdateResponse], ResultWrapper[OperationUpdateResponse]),
+ )
+
+
+class OperationResourceWithRawResponse:
+ def __init__(self, operation: OperationResource) -> None:
+ self._operation = operation
+
+ self.update = to_raw_response_wrapper(
+ operation.update,
+ )
+
+
+class AsyncOperationResourceWithRawResponse:
+ def __init__(self, operation: AsyncOperationResource) -> None:
+ self._operation = operation
+
+ self.update = async_to_raw_response_wrapper(
+ operation.update,
+ )
+
+
+class OperationResourceWithStreamingResponse:
+ def __init__(self, operation: OperationResource) -> None:
+ self._operation = operation
+
+ self.update = to_streamed_response_wrapper(
+ operation.update,
+ )
+
+
+class AsyncOperationResourceWithStreamingResponse:
+ def __init__(self, operation: AsyncOperationResource) -> None:
+ self._operation = operation
+
+ self.update = async_to_streamed_response_wrapper(
+ operation.update,
+ )
diff --git a/src/cloudflare/resources/api_gateway/labels/managed/resources/resources.py b/src/cloudflare/resources/api_gateway/labels/managed/resources/resources.py
new file mode 100644
index 00000000000..5db031c863d
--- /dev/null
+++ b/src/cloudflare/resources/api_gateway/labels/managed/resources/resources.py
@@ -0,0 +1,102 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from .operation import (
+ OperationResource,
+ AsyncOperationResource,
+ OperationResourceWithRawResponse,
+ AsyncOperationResourceWithRawResponse,
+ OperationResourceWithStreamingResponse,
+ AsyncOperationResourceWithStreamingResponse,
+)
+from ......_compat import cached_property
+from ......_resource import SyncAPIResource, AsyncAPIResource
+
+__all__ = ["ResourcesResource", "AsyncResourcesResource"]
+
+
+class ResourcesResource(SyncAPIResource):
+ @cached_property
+ def operation(self) -> OperationResource:
+ return OperationResource(self._client)
+
+ @cached_property
+ def with_raw_response(self) -> ResourcesResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return ResourcesResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> ResourcesResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return ResourcesResourceWithStreamingResponse(self)
+
+
+class AsyncResourcesResource(AsyncAPIResource):
+ @cached_property
+ def operation(self) -> AsyncOperationResource:
+ return AsyncOperationResource(self._client)
+
+ @cached_property
+ def with_raw_response(self) -> AsyncResourcesResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncResourcesResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncResourcesResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return AsyncResourcesResourceWithStreamingResponse(self)
+
+
+class ResourcesResourceWithRawResponse:
+ def __init__(self, resources: ResourcesResource) -> None:
+ self._resources = resources
+
+ @cached_property
+ def operation(self) -> OperationResourceWithRawResponse:
+ return OperationResourceWithRawResponse(self._resources.operation)
+
+
+class AsyncResourcesResourceWithRawResponse:
+ def __init__(self, resources: AsyncResourcesResource) -> None:
+ self._resources = resources
+
+ @cached_property
+ def operation(self) -> AsyncOperationResourceWithRawResponse:
+ return AsyncOperationResourceWithRawResponse(self._resources.operation)
+
+
+class ResourcesResourceWithStreamingResponse:
+ def __init__(self, resources: ResourcesResource) -> None:
+ self._resources = resources
+
+ @cached_property
+ def operation(self) -> OperationResourceWithStreamingResponse:
+ return OperationResourceWithStreamingResponse(self._resources.operation)
+
+
+class AsyncResourcesResourceWithStreamingResponse:
+ def __init__(self, resources: AsyncResourcesResource) -> None:
+ self._resources = resources
+
+ @cached_property
+ def operation(self) -> AsyncOperationResourceWithStreamingResponse:
+ return AsyncOperationResourceWithStreamingResponse(self._resources.operation)
diff --git a/src/cloudflare/resources/api_gateway/labels/user/__init__.py b/src/cloudflare/resources/api_gateway/labels/user/__init__.py
new file mode 100644
index 00000000000..16d4f7dce35
--- /dev/null
+++ b/src/cloudflare/resources/api_gateway/labels/user/__init__.py
@@ -0,0 +1,33 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from .user import (
+ UserResource,
+ AsyncUserResource,
+ UserResourceWithRawResponse,
+ AsyncUserResourceWithRawResponse,
+ UserResourceWithStreamingResponse,
+ AsyncUserResourceWithStreamingResponse,
+)
+from .resources import (
+ ResourcesResource,
+ AsyncResourcesResource,
+ ResourcesResourceWithRawResponse,
+ AsyncResourcesResourceWithRawResponse,
+ ResourcesResourceWithStreamingResponse,
+ AsyncResourcesResourceWithStreamingResponse,
+)
+
+__all__ = [
+ "ResourcesResource",
+ "AsyncResourcesResource",
+ "ResourcesResourceWithRawResponse",
+ "AsyncResourcesResourceWithRawResponse",
+ "ResourcesResourceWithStreamingResponse",
+ "AsyncResourcesResourceWithStreamingResponse",
+ "UserResource",
+ "AsyncUserResource",
+ "UserResourceWithRawResponse",
+ "AsyncUserResourceWithRawResponse",
+ "UserResourceWithStreamingResponse",
+ "AsyncUserResourceWithStreamingResponse",
+]
diff --git a/src/cloudflare/resources/api_gateway/labels/user/resources/__init__.py b/src/cloudflare/resources/api_gateway/labels/user/resources/__init__.py
new file mode 100644
index 00000000000..b30c92d0f74
--- /dev/null
+++ b/src/cloudflare/resources/api_gateway/labels/user/resources/__init__.py
@@ -0,0 +1,33 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from .operation import (
+ OperationResource,
+ AsyncOperationResource,
+ OperationResourceWithRawResponse,
+ AsyncOperationResourceWithRawResponse,
+ OperationResourceWithStreamingResponse,
+ AsyncOperationResourceWithStreamingResponse,
+)
+from .resources import (
+ ResourcesResource,
+ AsyncResourcesResource,
+ ResourcesResourceWithRawResponse,
+ AsyncResourcesResourceWithRawResponse,
+ ResourcesResourceWithStreamingResponse,
+ AsyncResourcesResourceWithStreamingResponse,
+)
+
+__all__ = [
+ "OperationResource",
+ "AsyncOperationResource",
+ "OperationResourceWithRawResponse",
+ "AsyncOperationResourceWithRawResponse",
+ "OperationResourceWithStreamingResponse",
+ "AsyncOperationResourceWithStreamingResponse",
+ "ResourcesResource",
+ "AsyncResourcesResource",
+ "ResourcesResourceWithRawResponse",
+ "AsyncResourcesResourceWithRawResponse",
+ "ResourcesResourceWithStreamingResponse",
+ "AsyncResourcesResourceWithStreamingResponse",
+]
diff --git a/src/cloudflare/resources/api_gateway/labels/user/resources/operation.py b/src/cloudflare/resources/api_gateway/labels/user/resources/operation.py
new file mode 100644
index 00000000000..dc4cbc01ea5
--- /dev/null
+++ b/src/cloudflare/resources/api_gateway/labels/user/resources/operation.py
@@ -0,0 +1,206 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Type, cast
+
+import httpx
+
+from ......_types import Body, Query, Headers, NotGiven, not_given
+from ......_utils import path_template, maybe_transform, async_maybe_transform
+from ......_compat import cached_property
+from ......_resource import SyncAPIResource, AsyncAPIResource
+from ......_response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from ......_wrappers import ResultWrapper
+from ......_base_client import make_request_options
+from ......types.api_gateway.labels.user.resources import operation_update_params
+from ......types.api_gateway.labels.user.resources.operation_update_response import OperationUpdateResponse
+
+__all__ = ["OperationResource", "AsyncOperationResource"]
+
+
+class OperationResource(SyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> OperationResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return OperationResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> OperationResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return OperationResourceWithStreamingResponse(self)
+
+ def update(
+ self,
+ name: str,
+ *,
+ zone_id: str | None = None,
+ selector: operation_update_params.Selector,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> OperationUpdateResponse:
+ """
+ Replace all operations(s) attached to a user label
+
+ Args:
+ zone_id: Identifier.
+
+ name: The name of the label
+
+ selector: Operation IDs selector
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ return self._put(
+ path_template(
+ "/zones/{zone_id}/api_gateway/labels/user/{name}/resources/operation", zone_id=zone_id, name=name
+ ),
+ body=maybe_transform({"selector": selector}, operation_update_params.OperationUpdateParams),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[OperationUpdateResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[OperationUpdateResponse], ResultWrapper[OperationUpdateResponse]),
+ )
+
+
+class AsyncOperationResource(AsyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> AsyncOperationResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncOperationResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncOperationResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return AsyncOperationResourceWithStreamingResponse(self)
+
+ async def update(
+ self,
+ name: str,
+ *,
+ zone_id: str | None = None,
+ selector: operation_update_params.Selector,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> OperationUpdateResponse:
+ """
+ Replace all operations(s) attached to a user label
+
+ Args:
+ zone_id: Identifier.
+
+ name: The name of the label
+
+ selector: Operation IDs selector
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ return await self._put(
+ path_template(
+ "/zones/{zone_id}/api_gateway/labels/user/{name}/resources/operation", zone_id=zone_id, name=name
+ ),
+ body=await async_maybe_transform({"selector": selector}, operation_update_params.OperationUpdateParams),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[OperationUpdateResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[OperationUpdateResponse], ResultWrapper[OperationUpdateResponse]),
+ )
+
+
+class OperationResourceWithRawResponse:
+ def __init__(self, operation: OperationResource) -> None:
+ self._operation = operation
+
+ self.update = to_raw_response_wrapper(
+ operation.update,
+ )
+
+
+class AsyncOperationResourceWithRawResponse:
+ def __init__(self, operation: AsyncOperationResource) -> None:
+ self._operation = operation
+
+ self.update = async_to_raw_response_wrapper(
+ operation.update,
+ )
+
+
+class OperationResourceWithStreamingResponse:
+ def __init__(self, operation: OperationResource) -> None:
+ self._operation = operation
+
+ self.update = to_streamed_response_wrapper(
+ operation.update,
+ )
+
+
+class AsyncOperationResourceWithStreamingResponse:
+ def __init__(self, operation: AsyncOperationResource) -> None:
+ self._operation = operation
+
+ self.update = async_to_streamed_response_wrapper(
+ operation.update,
+ )
diff --git a/src/cloudflare/resources/api_gateway/labels/user/resources/resources.py b/src/cloudflare/resources/api_gateway/labels/user/resources/resources.py
new file mode 100644
index 00000000000..5db031c863d
--- /dev/null
+++ b/src/cloudflare/resources/api_gateway/labels/user/resources/resources.py
@@ -0,0 +1,102 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from .operation import (
+ OperationResource,
+ AsyncOperationResource,
+ OperationResourceWithRawResponse,
+ AsyncOperationResourceWithRawResponse,
+ OperationResourceWithStreamingResponse,
+ AsyncOperationResourceWithStreamingResponse,
+)
+from ......_compat import cached_property
+from ......_resource import SyncAPIResource, AsyncAPIResource
+
+__all__ = ["ResourcesResource", "AsyncResourcesResource"]
+
+
+class ResourcesResource(SyncAPIResource):
+ @cached_property
+ def operation(self) -> OperationResource:
+ return OperationResource(self._client)
+
+ @cached_property
+ def with_raw_response(self) -> ResourcesResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return ResourcesResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> ResourcesResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return ResourcesResourceWithStreamingResponse(self)
+
+
+class AsyncResourcesResource(AsyncAPIResource):
+ @cached_property
+ def operation(self) -> AsyncOperationResource:
+ return AsyncOperationResource(self._client)
+
+ @cached_property
+ def with_raw_response(self) -> AsyncResourcesResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncResourcesResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncResourcesResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return AsyncResourcesResourceWithStreamingResponse(self)
+
+
+class ResourcesResourceWithRawResponse:
+ def __init__(self, resources: ResourcesResource) -> None:
+ self._resources = resources
+
+ @cached_property
+ def operation(self) -> OperationResourceWithRawResponse:
+ return OperationResourceWithRawResponse(self._resources.operation)
+
+
+class AsyncResourcesResourceWithRawResponse:
+ def __init__(self, resources: AsyncResourcesResource) -> None:
+ self._resources = resources
+
+ @cached_property
+ def operation(self) -> AsyncOperationResourceWithRawResponse:
+ return AsyncOperationResourceWithRawResponse(self._resources.operation)
+
+
+class ResourcesResourceWithStreamingResponse:
+ def __init__(self, resources: ResourcesResource) -> None:
+ self._resources = resources
+
+ @cached_property
+ def operation(self) -> OperationResourceWithStreamingResponse:
+ return OperationResourceWithStreamingResponse(self._resources.operation)
+
+
+class AsyncResourcesResourceWithStreamingResponse:
+ def __init__(self, resources: AsyncResourcesResource) -> None:
+ self._resources = resources
+
+ @cached_property
+ def operation(self) -> AsyncOperationResourceWithStreamingResponse:
+ return AsyncOperationResourceWithStreamingResponse(self._resources.operation)
diff --git a/src/cloudflare/resources/api_gateway/labels/user/user.py b/src/cloudflare/resources/api_gateway/labels/user/user.py
new file mode 100644
index 00000000000..ac3693f85f4
--- /dev/null
+++ b/src/cloudflare/resources/api_gateway/labels/user/user.py
@@ -0,0 +1,792 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Type, Iterable, cast
+
+import httpx
+
+from ....._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
+from ....._utils import path_template, maybe_transform, async_maybe_transform
+from ....._compat import cached_property
+from ....._resource import SyncAPIResource, AsyncAPIResource
+from ....._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from ....._wrappers import ResultWrapper
+from .....pagination import SyncSinglePage, AsyncSinglePage
+from ....._base_client import AsyncPaginator, make_request_options
+from .resources.resources import (
+ ResourcesResource,
+ AsyncResourcesResource,
+ ResourcesResourceWithRawResponse,
+ AsyncResourcesResourceWithRawResponse,
+ ResourcesResourceWithStreamingResponse,
+ AsyncResourcesResourceWithStreamingResponse,
+)
+from .....types.api_gateway.labels import user_get_params, user_edit_params, user_update_params, user_bulk_create_params
+from .....types.api_gateway.labels.user_get_response import UserGetResponse
+from .....types.api_gateway.labels.user_edit_response import UserEditResponse
+from .....types.api_gateway.labels.user_delete_response import UserDeleteResponse
+from .....types.api_gateway.labels.user_update_response import UserUpdateResponse
+from .....types.api_gateway.labels.user_bulk_create_response import UserBulkCreateResponse
+from .....types.api_gateway.labels.user_bulk_delete_response import UserBulkDeleteResponse
+
+__all__ = ["UserResource", "AsyncUserResource"]
+
+
+class UserResource(SyncAPIResource):
+ @cached_property
+ def resources(self) -> ResourcesResource:
+ return ResourcesResource(self._client)
+
+ @cached_property
+ def with_raw_response(self) -> UserResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return UserResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> UserResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return UserResourceWithStreamingResponse(self)
+
+ def update(
+ self,
+ name: str,
+ *,
+ zone_id: str | None = None,
+ description: str | Omit = omit,
+ metadata: object | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> UserUpdateResponse:
+ """
+ Update all fields on a label
+
+ Args:
+ zone_id: Identifier.
+
+ name: The name of the label
+
+ description: The description of the label
+
+ metadata: Metadata for the label
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ return self._put(
+ path_template("/zones/{zone_id}/api_gateway/labels/user/{name}", zone_id=zone_id, name=name),
+ body=maybe_transform(
+ {
+ "description": description,
+ "metadata": metadata,
+ },
+ user_update_params.UserUpdateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[UserUpdateResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[UserUpdateResponse], ResultWrapper[UserUpdateResponse]),
+ )
+
+ def delete(
+ self,
+ name: str,
+ *,
+ zone_id: str | None = None,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> UserDeleteResponse:
+ """
+ Delete user label
+
+ Args:
+ zone_id: Identifier.
+
+ name: The name of the label
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ return self._delete(
+ path_template("/zones/{zone_id}/api_gateway/labels/user/{name}", zone_id=zone_id, name=name),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[UserDeleteResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[UserDeleteResponse], ResultWrapper[UserDeleteResponse]),
+ )
+
+ def bulk_create(
+ self,
+ *,
+ zone_id: str | None = None,
+ body: Iterable[user_bulk_create_params.Body],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> SyncSinglePage[UserBulkCreateResponse]:
+ """
+ Create user labels
+
+ Args:
+ zone_id: Identifier.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ return self._get_api_list(
+ path_template("/zones/{zone_id}/api_gateway/labels/user", zone_id=zone_id),
+ page=SyncSinglePage[UserBulkCreateResponse],
+ body=maybe_transform(body, Iterable[user_bulk_create_params.Body]),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ model=UserBulkCreateResponse,
+ method="post",
+ )
+
+ def bulk_delete(
+ self,
+ *,
+ zone_id: str | None = None,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> SyncSinglePage[UserBulkDeleteResponse]:
+ """
+ Delete user labels
+
+ Args:
+ zone_id: Identifier.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ return self._get_api_list(
+ path_template("/zones/{zone_id}/api_gateway/labels/user", zone_id=zone_id),
+ page=SyncSinglePage[UserBulkDeleteResponse],
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ model=UserBulkDeleteResponse,
+ method="delete",
+ )
+
+ def edit(
+ self,
+ name: str,
+ *,
+ zone_id: str | None = None,
+ description: str | Omit = omit,
+ metadata: object | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> UserEditResponse:
+ """
+ Update certain fields on a label
+
+ Args:
+ zone_id: Identifier.
+
+ name: The name of the label
+
+ description: The description of the label
+
+ metadata: Metadata for the label
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ return self._patch(
+ path_template("/zones/{zone_id}/api_gateway/labels/user/{name}", zone_id=zone_id, name=name),
+ body=maybe_transform(
+ {
+ "description": description,
+ "metadata": metadata,
+ },
+ user_edit_params.UserEditParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[UserEditResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[UserEditResponse], ResultWrapper[UserEditResponse]),
+ )
+
+ def get(
+ self,
+ name: str,
+ *,
+ zone_id: str | None = None,
+ with_mapped_resource_counts: bool | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> UserGetResponse:
+ """
+ Retrieve user label
+
+ Args:
+ zone_id: Identifier.
+
+ name: The name of the label
+
+ with_mapped_resource_counts: Include `mapped_resources` for each label
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ return self._get(
+ path_template("/zones/{zone_id}/api_gateway/labels/user/{name}", zone_id=zone_id, name=name),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {"with_mapped_resource_counts": with_mapped_resource_counts}, user_get_params.UserGetParams
+ ),
+ post_parser=ResultWrapper[UserGetResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[UserGetResponse], ResultWrapper[UserGetResponse]),
+ )
+
+
+class AsyncUserResource(AsyncAPIResource):
+ @cached_property
+ def resources(self) -> AsyncResourcesResource:
+ return AsyncResourcesResource(self._client)
+
+ @cached_property
+ def with_raw_response(self) -> AsyncUserResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncUserResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncUserResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return AsyncUserResourceWithStreamingResponse(self)
+
+ async def update(
+ self,
+ name: str,
+ *,
+ zone_id: str | None = None,
+ description: str | Omit = omit,
+ metadata: object | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> UserUpdateResponse:
+ """
+ Update all fields on a label
+
+ Args:
+ zone_id: Identifier.
+
+ name: The name of the label
+
+ description: The description of the label
+
+ metadata: Metadata for the label
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ return await self._put(
+ path_template("/zones/{zone_id}/api_gateway/labels/user/{name}", zone_id=zone_id, name=name),
+ body=await async_maybe_transform(
+ {
+ "description": description,
+ "metadata": metadata,
+ },
+ user_update_params.UserUpdateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[UserUpdateResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[UserUpdateResponse], ResultWrapper[UserUpdateResponse]),
+ )
+
+ async def delete(
+ self,
+ name: str,
+ *,
+ zone_id: str | None = None,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> UserDeleteResponse:
+ """
+ Delete user label
+
+ Args:
+ zone_id: Identifier.
+
+ name: The name of the label
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ return await self._delete(
+ path_template("/zones/{zone_id}/api_gateway/labels/user/{name}", zone_id=zone_id, name=name),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[UserDeleteResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[UserDeleteResponse], ResultWrapper[UserDeleteResponse]),
+ )
+
+ def bulk_create(
+ self,
+ *,
+ zone_id: str | None = None,
+ body: Iterable[user_bulk_create_params.Body],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> AsyncPaginator[UserBulkCreateResponse, AsyncSinglePage[UserBulkCreateResponse]]:
+ """
+ Create user labels
+
+ Args:
+ zone_id: Identifier.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ return self._get_api_list(
+ path_template("/zones/{zone_id}/api_gateway/labels/user", zone_id=zone_id),
+ page=AsyncSinglePage[UserBulkCreateResponse],
+ body=maybe_transform(body, Iterable[user_bulk_create_params.Body]),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ model=UserBulkCreateResponse,
+ method="post",
+ )
+
+ def bulk_delete(
+ self,
+ *,
+ zone_id: str | None = None,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> AsyncPaginator[UserBulkDeleteResponse, AsyncSinglePage[UserBulkDeleteResponse]]:
+ """
+ Delete user labels
+
+ Args:
+ zone_id: Identifier.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ return self._get_api_list(
+ path_template("/zones/{zone_id}/api_gateway/labels/user", zone_id=zone_id),
+ page=AsyncSinglePage[UserBulkDeleteResponse],
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ model=UserBulkDeleteResponse,
+ method="delete",
+ )
+
+ async def edit(
+ self,
+ name: str,
+ *,
+ zone_id: str | None = None,
+ description: str | Omit = omit,
+ metadata: object | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> UserEditResponse:
+ """
+ Update certain fields on a label
+
+ Args:
+ zone_id: Identifier.
+
+ name: The name of the label
+
+ description: The description of the label
+
+ metadata: Metadata for the label
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ return await self._patch(
+ path_template("/zones/{zone_id}/api_gateway/labels/user/{name}", zone_id=zone_id, name=name),
+ body=await async_maybe_transform(
+ {
+ "description": description,
+ "metadata": metadata,
+ },
+ user_edit_params.UserEditParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[UserEditResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[UserEditResponse], ResultWrapper[UserEditResponse]),
+ )
+
+ async def get(
+ self,
+ name: str,
+ *,
+ zone_id: str | None = None,
+ with_mapped_resource_counts: bool | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> UserGetResponse:
+ """
+ Retrieve user label
+
+ Args:
+ zone_id: Identifier.
+
+ name: The name of the label
+
+ with_mapped_resource_counts: Include `mapped_resources` for each label
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not name:
+ raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
+ return await self._get(
+ path_template("/zones/{zone_id}/api_gateway/labels/user/{name}", zone_id=zone_id, name=name),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=await async_maybe_transform(
+ {"with_mapped_resource_counts": with_mapped_resource_counts}, user_get_params.UserGetParams
+ ),
+ post_parser=ResultWrapper[UserGetResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[UserGetResponse], ResultWrapper[UserGetResponse]),
+ )
+
+
+class UserResourceWithRawResponse:
+ def __init__(self, user: UserResource) -> None:
+ self._user = user
+
+ self.update = to_raw_response_wrapper(
+ user.update,
+ )
+ self.delete = to_raw_response_wrapper(
+ user.delete,
+ )
+ self.bulk_create = to_raw_response_wrapper(
+ user.bulk_create,
+ )
+ self.bulk_delete = to_raw_response_wrapper(
+ user.bulk_delete,
+ )
+ self.edit = to_raw_response_wrapper(
+ user.edit,
+ )
+ self.get = to_raw_response_wrapper(
+ user.get,
+ )
+
+ @cached_property
+ def resources(self) -> ResourcesResourceWithRawResponse:
+ return ResourcesResourceWithRawResponse(self._user.resources)
+
+
+class AsyncUserResourceWithRawResponse:
+ def __init__(self, user: AsyncUserResource) -> None:
+ self._user = user
+
+ self.update = async_to_raw_response_wrapper(
+ user.update,
+ )
+ self.delete = async_to_raw_response_wrapper(
+ user.delete,
+ )
+ self.bulk_create = async_to_raw_response_wrapper(
+ user.bulk_create,
+ )
+ self.bulk_delete = async_to_raw_response_wrapper(
+ user.bulk_delete,
+ )
+ self.edit = async_to_raw_response_wrapper(
+ user.edit,
+ )
+ self.get = async_to_raw_response_wrapper(
+ user.get,
+ )
+
+ @cached_property
+ def resources(self) -> AsyncResourcesResourceWithRawResponse:
+ return AsyncResourcesResourceWithRawResponse(self._user.resources)
+
+
+class UserResourceWithStreamingResponse:
+ def __init__(self, user: UserResource) -> None:
+ self._user = user
+
+ self.update = to_streamed_response_wrapper(
+ user.update,
+ )
+ self.delete = to_streamed_response_wrapper(
+ user.delete,
+ )
+ self.bulk_create = to_streamed_response_wrapper(
+ user.bulk_create,
+ )
+ self.bulk_delete = to_streamed_response_wrapper(
+ user.bulk_delete,
+ )
+ self.edit = to_streamed_response_wrapper(
+ user.edit,
+ )
+ self.get = to_streamed_response_wrapper(
+ user.get,
+ )
+
+ @cached_property
+ def resources(self) -> ResourcesResourceWithStreamingResponse:
+ return ResourcesResourceWithStreamingResponse(self._user.resources)
+
+
+class AsyncUserResourceWithStreamingResponse:
+ def __init__(self, user: AsyncUserResource) -> None:
+ self._user = user
+
+ self.update = async_to_streamed_response_wrapper(
+ user.update,
+ )
+ self.delete = async_to_streamed_response_wrapper(
+ user.delete,
+ )
+ self.bulk_create = async_to_streamed_response_wrapper(
+ user.bulk_create,
+ )
+ self.bulk_delete = async_to_streamed_response_wrapper(
+ user.bulk_delete,
+ )
+ self.edit = async_to_streamed_response_wrapper(
+ user.edit,
+ )
+ self.get = async_to_streamed_response_wrapper(
+ user.get,
+ )
+
+ @cached_property
+ def resources(self) -> AsyncResourcesResourceWithStreamingResponse:
+ return AsyncResourcesResourceWithStreamingResponse(self._user.resources)
diff --git a/src/cloudflare/resources/api_gateway/operations/__init__.py b/src/cloudflare/resources/api_gateway/operations/__init__.py
index d50a9df3f11..158055f28a9 100644
--- a/src/cloudflare/resources/api_gateway/operations/__init__.py
+++ b/src/cloudflare/resources/api_gateway/operations/__init__.py
@@ -1,5 +1,13 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+from .labels import (
+ LabelsResource,
+ AsyncLabelsResource,
+ LabelsResourceWithRawResponse,
+ AsyncLabelsResourceWithRawResponse,
+ LabelsResourceWithStreamingResponse,
+ AsyncLabelsResourceWithStreamingResponse,
+)
from .operations import (
OperationsResource,
AsyncOperationsResource,
@@ -18,6 +26,12 @@
)
__all__ = [
+ "LabelsResource",
+ "AsyncLabelsResource",
+ "LabelsResourceWithRawResponse",
+ "AsyncLabelsResourceWithRawResponse",
+ "LabelsResourceWithStreamingResponse",
+ "AsyncLabelsResourceWithStreamingResponse",
"SchemaValidationResource",
"AsyncSchemaValidationResource",
"SchemaValidationResourceWithRawResponse",
diff --git a/src/cloudflare/resources/api_gateway/operations/labels.py b/src/cloudflare/resources/api_gateway/operations/labels.py
new file mode 100644
index 00000000000..9191bf97b8b
--- /dev/null
+++ b/src/cloudflare/resources/api_gateway/operations/labels.py
@@ -0,0 +1,823 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Type, cast
+
+import httpx
+
+from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
+from ...._utils import path_template, maybe_transform, async_maybe_transform
+from ...._compat import cached_property
+from ...._resource import SyncAPIResource, AsyncAPIResource
+from ...._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from ...._wrappers import ResultWrapper
+from ....pagination import SyncSinglePage, AsyncSinglePage
+from ...._base_client import AsyncPaginator, make_request_options
+from ....types.api_gateway.operations import (
+ label_create_params,
+ label_update_params,
+ label_bulk_create_params,
+ label_bulk_update_params,
+)
+from ....types.api_gateway.operations.label_create_response import LabelCreateResponse
+from ....types.api_gateway.operations.label_delete_response import LabelDeleteResponse
+from ....types.api_gateway.operations.label_update_response import LabelUpdateResponse
+from ....types.api_gateway.operations.label_bulk_create_response import LabelBulkCreateResponse
+from ....types.api_gateway.operations.label_bulk_delete_response import LabelBulkDeleteResponse
+from ....types.api_gateway.operations.label_bulk_update_response import LabelBulkUpdateResponse
+
+__all__ = ["LabelsResource", "AsyncLabelsResource"]
+
+
+class LabelsResource(SyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> LabelsResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return LabelsResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> LabelsResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return LabelsResourceWithStreamingResponse(self)
+
+ def create(
+ self,
+ operation_id: str,
+ *,
+ zone_id: str | None = None,
+ managed: SequenceNotStr[str] | Omit = omit,
+ user: SequenceNotStr[str] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> LabelCreateResponse:
+ """
+ Attach label(s) on an operation in endpoint management
+
+ Args:
+ zone_id: Identifier.
+
+ operation_id: UUID.
+
+ managed: List of managed label names.
+
+ user: List of user label names.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not operation_id:
+ raise ValueError(f"Expected a non-empty value for `operation_id` but received {operation_id!r}")
+ return self._post(
+ path_template(
+ "/zones/{zone_id}/api_gateway/operations/{operation_id}/labels",
+ zone_id=zone_id,
+ operation_id=operation_id,
+ ),
+ body=maybe_transform(
+ {
+ "managed": managed,
+ "user": user,
+ },
+ label_create_params.LabelCreateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[LabelCreateResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[LabelCreateResponse], ResultWrapper[LabelCreateResponse]),
+ )
+
+ def update(
+ self,
+ operation_id: str,
+ *,
+ zone_id: str | None = None,
+ managed: SequenceNotStr[str] | Omit = omit,
+ user: SequenceNotStr[str] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> LabelUpdateResponse:
+ """
+ Replace label(s) on an operation in endpoint management
+
+ Args:
+ zone_id: Identifier.
+
+ operation_id: UUID.
+
+ managed: List of managed label names. Omitting this property or passing an empty array
+ will result in all managed labels being removed from the operation
+
+ user: List of user label names. Omitting this property or passing an empty array will
+ result in all user labels being removed from the operation
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not operation_id:
+ raise ValueError(f"Expected a non-empty value for `operation_id` but received {operation_id!r}")
+ return self._put(
+ path_template(
+ "/zones/{zone_id}/api_gateway/operations/{operation_id}/labels",
+ zone_id=zone_id,
+ operation_id=operation_id,
+ ),
+ body=maybe_transform(
+ {
+ "managed": managed,
+ "user": user,
+ },
+ label_update_params.LabelUpdateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[LabelUpdateResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[LabelUpdateResponse], ResultWrapper[LabelUpdateResponse]),
+ )
+
+ def delete(
+ self,
+ operation_id: str,
+ *,
+ zone_id: str | None = None,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> LabelDeleteResponse:
+ """
+ Remove label(s) on an operation in endpoint management
+
+ Args:
+ zone_id: Identifier.
+
+ operation_id: UUID.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not operation_id:
+ raise ValueError(f"Expected a non-empty value for `operation_id` but received {operation_id!r}")
+ return self._delete(
+ path_template(
+ "/zones/{zone_id}/api_gateway/operations/{operation_id}/labels",
+ zone_id=zone_id,
+ operation_id=operation_id,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[LabelDeleteResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[LabelDeleteResponse], ResultWrapper[LabelDeleteResponse]),
+ )
+
+ def bulk_create(
+ self,
+ *,
+ zone_id: str | None = None,
+ selector: label_bulk_create_params.Selector,
+ managed: label_bulk_create_params.Managed | Omit = omit,
+ user: label_bulk_create_params.User | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> SyncSinglePage[LabelBulkCreateResponse]:
+ """
+ Bulk attach label(s) on operation(s) in endpoint management
+
+ Args:
+ zone_id: Identifier.
+
+ selector: Operation IDs selector
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ return self._get_api_list(
+ path_template("/zones/{zone_id}/api_gateway/operations/labels", zone_id=zone_id),
+ page=SyncSinglePage[LabelBulkCreateResponse],
+ body=maybe_transform(
+ {
+ "selector": selector,
+ "managed": managed,
+ "user": user,
+ },
+ label_bulk_create_params.LabelBulkCreateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ model=LabelBulkCreateResponse,
+ method="post",
+ )
+
+ def bulk_delete(
+ self,
+ *,
+ zone_id: str | None = None,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> SyncSinglePage[LabelBulkDeleteResponse]:
+ """
+ Bulk remove label(s) on operation(s) in endpoint management
+
+ Args:
+ zone_id: Identifier.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ return self._get_api_list(
+ path_template("/zones/{zone_id}/api_gateway/operations/labels", zone_id=zone_id),
+ page=SyncSinglePage[LabelBulkDeleteResponse],
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ model=LabelBulkDeleteResponse,
+ method="delete",
+ )
+
+ def bulk_update(
+ self,
+ *,
+ zone_id: str | None = None,
+ managed: label_bulk_update_params.Managed,
+ selector: label_bulk_update_params.Selector,
+ user: label_bulk_update_params.User,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> SyncSinglePage[LabelBulkUpdateResponse]:
+ """
+ Bulk replace label(s) on operation(s) in endpoint management
+
+ Args:
+ zone_id: Identifier.
+
+ managed: Managed labels to replace for all affected operations
+
+ selector: Operation IDs selector
+
+ user: User labels to replace for all affected operations
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ return self._get_api_list(
+ path_template("/zones/{zone_id}/api_gateway/operations/labels", zone_id=zone_id),
+ page=SyncSinglePage[LabelBulkUpdateResponse],
+ body=maybe_transform(
+ {
+ "managed": managed,
+ "selector": selector,
+ "user": user,
+ },
+ label_bulk_update_params.LabelBulkUpdateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ model=LabelBulkUpdateResponse,
+ method="put",
+ )
+
+
+class AsyncLabelsResource(AsyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> AsyncLabelsResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncLabelsResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncLabelsResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return AsyncLabelsResourceWithStreamingResponse(self)
+
+ async def create(
+ self,
+ operation_id: str,
+ *,
+ zone_id: str | None = None,
+ managed: SequenceNotStr[str] | Omit = omit,
+ user: SequenceNotStr[str] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> LabelCreateResponse:
+ """
+ Attach label(s) on an operation in endpoint management
+
+ Args:
+ zone_id: Identifier.
+
+ operation_id: UUID.
+
+ managed: List of managed label names.
+
+ user: List of user label names.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not operation_id:
+ raise ValueError(f"Expected a non-empty value for `operation_id` but received {operation_id!r}")
+ return await self._post(
+ path_template(
+ "/zones/{zone_id}/api_gateway/operations/{operation_id}/labels",
+ zone_id=zone_id,
+ operation_id=operation_id,
+ ),
+ body=await async_maybe_transform(
+ {
+ "managed": managed,
+ "user": user,
+ },
+ label_create_params.LabelCreateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[LabelCreateResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[LabelCreateResponse], ResultWrapper[LabelCreateResponse]),
+ )
+
+ async def update(
+ self,
+ operation_id: str,
+ *,
+ zone_id: str | None = None,
+ managed: SequenceNotStr[str] | Omit = omit,
+ user: SequenceNotStr[str] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> LabelUpdateResponse:
+ """
+ Replace label(s) on an operation in endpoint management
+
+ Args:
+ zone_id: Identifier.
+
+ operation_id: UUID.
+
+ managed: List of managed label names. Omitting this property or passing an empty array
+ will result in all managed labels being removed from the operation
+
+ user: List of user label names. Omitting this property or passing an empty array will
+ result in all user labels being removed from the operation
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not operation_id:
+ raise ValueError(f"Expected a non-empty value for `operation_id` but received {operation_id!r}")
+ return await self._put(
+ path_template(
+ "/zones/{zone_id}/api_gateway/operations/{operation_id}/labels",
+ zone_id=zone_id,
+ operation_id=operation_id,
+ ),
+ body=await async_maybe_transform(
+ {
+ "managed": managed,
+ "user": user,
+ },
+ label_update_params.LabelUpdateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[LabelUpdateResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[LabelUpdateResponse], ResultWrapper[LabelUpdateResponse]),
+ )
+
+ async def delete(
+ self,
+ operation_id: str,
+ *,
+ zone_id: str | None = None,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> LabelDeleteResponse:
+ """
+ Remove label(s) on an operation in endpoint management
+
+ Args:
+ zone_id: Identifier.
+
+ operation_id: UUID.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not operation_id:
+ raise ValueError(f"Expected a non-empty value for `operation_id` but received {operation_id!r}")
+ return await self._delete(
+ path_template(
+ "/zones/{zone_id}/api_gateway/operations/{operation_id}/labels",
+ zone_id=zone_id,
+ operation_id=operation_id,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[LabelDeleteResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[LabelDeleteResponse], ResultWrapper[LabelDeleteResponse]),
+ )
+
+ def bulk_create(
+ self,
+ *,
+ zone_id: str | None = None,
+ selector: label_bulk_create_params.Selector,
+ managed: label_bulk_create_params.Managed | Omit = omit,
+ user: label_bulk_create_params.User | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> AsyncPaginator[LabelBulkCreateResponse, AsyncSinglePage[LabelBulkCreateResponse]]:
+ """
+ Bulk attach label(s) on operation(s) in endpoint management
+
+ Args:
+ zone_id: Identifier.
+
+ selector: Operation IDs selector
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ return self._get_api_list(
+ path_template("/zones/{zone_id}/api_gateway/operations/labels", zone_id=zone_id),
+ page=AsyncSinglePage[LabelBulkCreateResponse],
+ body=maybe_transform(
+ {
+ "selector": selector,
+ "managed": managed,
+ "user": user,
+ },
+ label_bulk_create_params.LabelBulkCreateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ model=LabelBulkCreateResponse,
+ method="post",
+ )
+
+ def bulk_delete(
+ self,
+ *,
+ zone_id: str | None = None,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> AsyncPaginator[LabelBulkDeleteResponse, AsyncSinglePage[LabelBulkDeleteResponse]]:
+ """
+ Bulk remove label(s) on operation(s) in endpoint management
+
+ Args:
+ zone_id: Identifier.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ return self._get_api_list(
+ path_template("/zones/{zone_id}/api_gateway/operations/labels", zone_id=zone_id),
+ page=AsyncSinglePage[LabelBulkDeleteResponse],
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ model=LabelBulkDeleteResponse,
+ method="delete",
+ )
+
+ def bulk_update(
+ self,
+ *,
+ zone_id: str | None = None,
+ managed: label_bulk_update_params.Managed,
+ selector: label_bulk_update_params.Selector,
+ user: label_bulk_update_params.User,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> AsyncPaginator[LabelBulkUpdateResponse, AsyncSinglePage[LabelBulkUpdateResponse]]:
+ """
+ Bulk replace label(s) on operation(s) in endpoint management
+
+ Args:
+ zone_id: Identifier.
+
+ managed: Managed labels to replace for all affected operations
+
+ selector: Operation IDs selector
+
+ user: User labels to replace for all affected operations
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ return self._get_api_list(
+ path_template("/zones/{zone_id}/api_gateway/operations/labels", zone_id=zone_id),
+ page=AsyncSinglePage[LabelBulkUpdateResponse],
+ body=maybe_transform(
+ {
+ "managed": managed,
+ "selector": selector,
+ "user": user,
+ },
+ label_bulk_update_params.LabelBulkUpdateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ model=LabelBulkUpdateResponse,
+ method="put",
+ )
+
+
+class LabelsResourceWithRawResponse:
+ def __init__(self, labels: LabelsResource) -> None:
+ self._labels = labels
+
+ self.create = to_raw_response_wrapper(
+ labels.create,
+ )
+ self.update = to_raw_response_wrapper(
+ labels.update,
+ )
+ self.delete = to_raw_response_wrapper(
+ labels.delete,
+ )
+ self.bulk_create = to_raw_response_wrapper(
+ labels.bulk_create,
+ )
+ self.bulk_delete = to_raw_response_wrapper(
+ labels.bulk_delete,
+ )
+ self.bulk_update = to_raw_response_wrapper(
+ labels.bulk_update,
+ )
+
+
+class AsyncLabelsResourceWithRawResponse:
+ def __init__(self, labels: AsyncLabelsResource) -> None:
+ self._labels = labels
+
+ self.create = async_to_raw_response_wrapper(
+ labels.create,
+ )
+ self.update = async_to_raw_response_wrapper(
+ labels.update,
+ )
+ self.delete = async_to_raw_response_wrapper(
+ labels.delete,
+ )
+ self.bulk_create = async_to_raw_response_wrapper(
+ labels.bulk_create,
+ )
+ self.bulk_delete = async_to_raw_response_wrapper(
+ labels.bulk_delete,
+ )
+ self.bulk_update = async_to_raw_response_wrapper(
+ labels.bulk_update,
+ )
+
+
+class LabelsResourceWithStreamingResponse:
+ def __init__(self, labels: LabelsResource) -> None:
+ self._labels = labels
+
+ self.create = to_streamed_response_wrapper(
+ labels.create,
+ )
+ self.update = to_streamed_response_wrapper(
+ labels.update,
+ )
+ self.delete = to_streamed_response_wrapper(
+ labels.delete,
+ )
+ self.bulk_create = to_streamed_response_wrapper(
+ labels.bulk_create,
+ )
+ self.bulk_delete = to_streamed_response_wrapper(
+ labels.bulk_delete,
+ )
+ self.bulk_update = to_streamed_response_wrapper(
+ labels.bulk_update,
+ )
+
+
+class AsyncLabelsResourceWithStreamingResponse:
+ def __init__(self, labels: AsyncLabelsResource) -> None:
+ self._labels = labels
+
+ self.create = async_to_streamed_response_wrapper(
+ labels.create,
+ )
+ self.update = async_to_streamed_response_wrapper(
+ labels.update,
+ )
+ self.delete = async_to_streamed_response_wrapper(
+ labels.delete,
+ )
+ self.bulk_create = async_to_streamed_response_wrapper(
+ labels.bulk_create,
+ )
+ self.bulk_delete = async_to_streamed_response_wrapper(
+ labels.bulk_delete,
+ )
+ self.bulk_update = async_to_streamed_response_wrapper(
+ labels.bulk_update,
+ )
diff --git a/src/cloudflare/resources/api_gateway/operations/operations.py b/src/cloudflare/resources/api_gateway/operations/operations.py
index 1a6038c3688..9b90cb22f15 100644
--- a/src/cloudflare/resources/api_gateway/operations/operations.py
+++ b/src/cloudflare/resources/api_gateway/operations/operations.py
@@ -7,8 +7,16 @@
import httpx
+from .labels import (
+ LabelsResource,
+ AsyncLabelsResource,
+ LabelsResourceWithRawResponse,
+ AsyncLabelsResourceWithRawResponse,
+ LabelsResourceWithStreamingResponse,
+ AsyncLabelsResourceWithStreamingResponse,
+)
from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
-from ...._utils import maybe_transform, async_maybe_transform
+from ...._utils import path_template, maybe_transform, async_maybe_transform
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -45,6 +53,10 @@
class OperationsResource(SyncAPIResource):
+ @cached_property
+ def labels(self) -> LabelsResource:
+ return LabelsResource(self._client)
+
@cached_property
def schema_validation(self) -> SchemaValidationResource:
return SchemaValidationResource(self._client)
@@ -71,7 +83,7 @@ def with_streaming_response(self) -> OperationsResourceWithStreamingResponse:
def create(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
endpoint: str,
host: str,
method: Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"],
@@ -110,10 +122,12 @@ def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return self._post(
- f"/zones/{zone_id}/api_gateway/operations/item",
+ path_template("/zones/{zone_id}/api_gateway/operations/item", zone_id=zone_id),
body=maybe_transform(
{
"endpoint": endpoint,
@@ -135,7 +149,7 @@ def create(
def list(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
direction: Literal["asc", "desc"] | Omit = omit,
endpoint: str | Omit = omit,
feature: List[Literal["thresholds", "parameter_schemas", "schema_info"]] | Omit = omit,
@@ -152,7 +166,8 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncV4PagePaginationArray[OperationListResponse]:
"""
- Retrieve information about all operations on a zone
+ Lists all API operations tracked by API Shield for a zone with pagination.
+ Returns operation details including method, path, and feature configurations.
Args:
zone_id: Identifier.
@@ -184,10 +199,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return self._get_api_list(
- f"/zones/{zone_id}/api_gateway/operations",
+ path_template("/zones/{zone_id}/api_gateway/operations", zone_id=zone_id),
page=SyncV4PagePaginationArray[OperationListResponse],
options=make_request_options(
extra_headers=extra_headers,
@@ -215,7 +232,7 @@ def delete(
self,
operation_id: str,
*,
- zone_id: str,
+ zone_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -223,8 +240,10 @@ def delete(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> OperationDeleteResponse:
- """
- Delete an operation
+ """Removes a single API operation from API Shield endpoint management.
+
+ The
+ operation will no longer be tracked or protected by API Shield rules.
Args:
zone_id: Identifier.
@@ -239,12 +258,16 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not operation_id:
raise ValueError(f"Expected a non-empty value for `operation_id` but received {operation_id!r}")
return self._delete(
- f"/zones/{zone_id}/api_gateway/operations/{operation_id}",
+ path_template(
+ "/zones/{zone_id}/api_gateway/operations/{operation_id}", zone_id=zone_id, operation_id=operation_id
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -254,7 +277,7 @@ def delete(
def bulk_create(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
body: Iterable[operation_bulk_create_params.Body],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -282,10 +305,12 @@ def bulk_create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return self._get_api_list(
- f"/zones/{zone_id}/api_gateway/operations",
+ path_template("/zones/{zone_id}/api_gateway/operations", zone_id=zone_id),
page=SyncSinglePage[OperationBulkCreateResponse],
body=maybe_transform(body, Iterable[operation_bulk_create_params.Body]),
options=make_request_options(
@@ -298,7 +323,7 @@ def bulk_create(
def bulk_delete(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -307,7 +332,8 @@ def bulk_delete(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> OperationBulkDeleteResponse:
"""
- Delete multiple operations
+ Bulk removes multiple API operations from API Shield endpoint management in a
+ single request. Efficient for cleaning up unused endpoints.
Args:
zone_id: Identifier.
@@ -320,10 +346,12 @@ def bulk_delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return self._delete(
- f"/zones/{zone_id}/api_gateway/operations",
+ path_template("/zones/{zone_id}/api_gateway/operations", zone_id=zone_id),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -334,7 +362,7 @@ def get(
self,
operation_id: str,
*,
- zone_id: str,
+ zone_id: str | None = None,
feature: List[Literal["thresholds", "parameter_schemas", "schema_info"]] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -344,7 +372,8 @@ def get(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> OperationGetResponse:
"""
- Retrieve information about an operation
+ Gets detailed information about a specific API operation in API Shield,
+ including its schema validation settings and traffic statistics.
Args:
zone_id: Identifier.
@@ -363,12 +392,16 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not operation_id:
raise ValueError(f"Expected a non-empty value for `operation_id` but received {operation_id!r}")
return self._get(
- f"/zones/{zone_id}/api_gateway/operations/{operation_id}",
+ path_template(
+ "/zones/{zone_id}/api_gateway/operations/{operation_id}", zone_id=zone_id, operation_id=operation_id
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -382,6 +415,10 @@ def get(
class AsyncOperationsResource(AsyncAPIResource):
+ @cached_property
+ def labels(self) -> AsyncLabelsResource:
+ return AsyncLabelsResource(self._client)
+
@cached_property
def schema_validation(self) -> AsyncSchemaValidationResource:
return AsyncSchemaValidationResource(self._client)
@@ -408,7 +445,7 @@ def with_streaming_response(self) -> AsyncOperationsResourceWithStreamingRespons
async def create(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
endpoint: str,
host: str,
method: Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"],
@@ -447,10 +484,12 @@ async def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return await self._post(
- f"/zones/{zone_id}/api_gateway/operations/item",
+ path_template("/zones/{zone_id}/api_gateway/operations/item", zone_id=zone_id),
body=await async_maybe_transform(
{
"endpoint": endpoint,
@@ -472,7 +511,7 @@ async def create(
def list(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
direction: Literal["asc", "desc"] | Omit = omit,
endpoint: str | Omit = omit,
feature: List[Literal["thresholds", "parameter_schemas", "schema_info"]] | Omit = omit,
@@ -489,7 +528,8 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[OperationListResponse, AsyncV4PagePaginationArray[OperationListResponse]]:
"""
- Retrieve information about all operations on a zone
+ Lists all API operations tracked by API Shield for a zone with pagination.
+ Returns operation details including method, path, and feature configurations.
Args:
zone_id: Identifier.
@@ -521,10 +561,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return self._get_api_list(
- f"/zones/{zone_id}/api_gateway/operations",
+ path_template("/zones/{zone_id}/api_gateway/operations", zone_id=zone_id),
page=AsyncV4PagePaginationArray[OperationListResponse],
options=make_request_options(
extra_headers=extra_headers,
@@ -552,7 +594,7 @@ async def delete(
self,
operation_id: str,
*,
- zone_id: str,
+ zone_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -560,8 +602,10 @@ async def delete(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> OperationDeleteResponse:
- """
- Delete an operation
+ """Removes a single API operation from API Shield endpoint management.
+
+ The
+ operation will no longer be tracked or protected by API Shield rules.
Args:
zone_id: Identifier.
@@ -576,12 +620,16 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not operation_id:
raise ValueError(f"Expected a non-empty value for `operation_id` but received {operation_id!r}")
return await self._delete(
- f"/zones/{zone_id}/api_gateway/operations/{operation_id}",
+ path_template(
+ "/zones/{zone_id}/api_gateway/operations/{operation_id}", zone_id=zone_id, operation_id=operation_id
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -591,7 +639,7 @@ async def delete(
def bulk_create(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
body: Iterable[operation_bulk_create_params.Body],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -619,10 +667,12 @@ def bulk_create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return self._get_api_list(
- f"/zones/{zone_id}/api_gateway/operations",
+ path_template("/zones/{zone_id}/api_gateway/operations", zone_id=zone_id),
page=AsyncSinglePage[OperationBulkCreateResponse],
body=maybe_transform(body, Iterable[operation_bulk_create_params.Body]),
options=make_request_options(
@@ -635,7 +685,7 @@ def bulk_create(
async def bulk_delete(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -644,7 +694,8 @@ async def bulk_delete(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> OperationBulkDeleteResponse:
"""
- Delete multiple operations
+ Bulk removes multiple API operations from API Shield endpoint management in a
+ single request. Efficient for cleaning up unused endpoints.
Args:
zone_id: Identifier.
@@ -657,10 +708,12 @@ async def bulk_delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return await self._delete(
- f"/zones/{zone_id}/api_gateway/operations",
+ path_template("/zones/{zone_id}/api_gateway/operations", zone_id=zone_id),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -671,7 +724,7 @@ async def get(
self,
operation_id: str,
*,
- zone_id: str,
+ zone_id: str | None = None,
feature: List[Literal["thresholds", "parameter_schemas", "schema_info"]] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -681,7 +734,8 @@ async def get(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> OperationGetResponse:
"""
- Retrieve information about an operation
+ Gets detailed information about a specific API operation in API Shield,
+ including its schema validation settings and traffic statistics.
Args:
zone_id: Identifier.
@@ -700,12 +754,16 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not operation_id:
raise ValueError(f"Expected a non-empty value for `operation_id` but received {operation_id!r}")
return await self._get(
- f"/zones/{zone_id}/api_gateway/operations/{operation_id}",
+ path_template(
+ "/zones/{zone_id}/api_gateway/operations/{operation_id}", zone_id=zone_id, operation_id=operation_id
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -741,6 +799,10 @@ def __init__(self, operations: OperationsResource) -> None:
operations.get,
)
+ @cached_property
+ def labels(self) -> LabelsResourceWithRawResponse:
+ return LabelsResourceWithRawResponse(self._operations.labels)
+
@cached_property
def schema_validation(self) -> SchemaValidationResourceWithRawResponse:
return SchemaValidationResourceWithRawResponse(self._operations.schema_validation)
@@ -769,6 +831,10 @@ def __init__(self, operations: AsyncOperationsResource) -> None:
operations.get,
)
+ @cached_property
+ def labels(self) -> AsyncLabelsResourceWithRawResponse:
+ return AsyncLabelsResourceWithRawResponse(self._operations.labels)
+
@cached_property
def schema_validation(self) -> AsyncSchemaValidationResourceWithRawResponse:
return AsyncSchemaValidationResourceWithRawResponse(self._operations.schema_validation)
@@ -797,6 +863,10 @@ def __init__(self, operations: OperationsResource) -> None:
operations.get,
)
+ @cached_property
+ def labels(self) -> LabelsResourceWithStreamingResponse:
+ return LabelsResourceWithStreamingResponse(self._operations.labels)
+
@cached_property
def schema_validation(self) -> SchemaValidationResourceWithStreamingResponse:
return SchemaValidationResourceWithStreamingResponse(self._operations.schema_validation)
@@ -825,6 +895,10 @@ def __init__(self, operations: AsyncOperationsResource) -> None:
operations.get,
)
+ @cached_property
+ def labels(self) -> AsyncLabelsResourceWithStreamingResponse:
+ return AsyncLabelsResourceWithStreamingResponse(self._operations.labels)
+
@cached_property
def schema_validation(self) -> AsyncSchemaValidationResourceWithStreamingResponse:
return AsyncSchemaValidationResourceWithStreamingResponse(self._operations.schema_validation)
diff --git a/src/cloudflare/resources/api_gateway/operations/schema_validation.py b/src/cloudflare/resources/api_gateway/operations/schema_validation.py
index 5b526d920a8..dd93f97c5e6 100644
--- a/src/cloudflare/resources/api_gateway/operations/schema_validation.py
+++ b/src/cloudflare/resources/api_gateway/operations/schema_validation.py
@@ -9,7 +9,7 @@
import httpx
from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ...._utils import maybe_transform, async_maybe_transform
+from ...._utils import path_template, maybe_transform, async_maybe_transform
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -60,7 +60,7 @@ def update(
self,
operation_id: str,
*,
- zone_id: str,
+ zone_id: str | None = None,
mitigation_action: Optional[Literal["log", "block", "none"]] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -94,12 +94,18 @@ def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not operation_id:
raise ValueError(f"Expected a non-empty value for `operation_id` but received {operation_id!r}")
return self._put(
- f"/zones/{zone_id}/api_gateway/operations/{operation_id}/schema_validation",
+ path_template(
+ "/zones/{zone_id}/api_gateway/operations/{operation_id}/schema_validation",
+ zone_id=zone_id,
+ operation_id=operation_id,
+ ),
body=maybe_transform(
{"mitigation_action": mitigation_action}, schema_validation_update_params.SchemaValidationUpdateParams
),
@@ -115,7 +121,7 @@ def update(
def edit(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
settings_multiple_request: SettingsMultipleRequestParam,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -138,10 +144,12 @@ def edit(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return self._patch(
- f"/zones/{zone_id}/api_gateway/operations/schema_validation",
+ path_template("/zones/{zone_id}/api_gateway/operations/schema_validation", zone_id=zone_id),
body=maybe_transform(settings_multiple_request, schema_validation_edit_params.SchemaValidationEditParams),
options=make_request_options(
extra_headers=extra_headers,
@@ -160,7 +168,7 @@ def get(
self,
operation_id: str,
*,
- zone_id: str,
+ zone_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -184,12 +192,18 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not operation_id:
raise ValueError(f"Expected a non-empty value for `operation_id` but received {operation_id!r}")
return self._get(
- f"/zones/{zone_id}/api_gateway/operations/{operation_id}/schema_validation",
+ path_template(
+ "/zones/{zone_id}/api_gateway/operations/{operation_id}/schema_validation",
+ zone_id=zone_id,
+ operation_id=operation_id,
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -224,7 +238,7 @@ async def update(
self,
operation_id: str,
*,
- zone_id: str,
+ zone_id: str | None = None,
mitigation_action: Optional[Literal["log", "block", "none"]] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -258,12 +272,18 @@ async def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not operation_id:
raise ValueError(f"Expected a non-empty value for `operation_id` but received {operation_id!r}")
return await self._put(
- f"/zones/{zone_id}/api_gateway/operations/{operation_id}/schema_validation",
+ path_template(
+ "/zones/{zone_id}/api_gateway/operations/{operation_id}/schema_validation",
+ zone_id=zone_id,
+ operation_id=operation_id,
+ ),
body=await async_maybe_transform(
{"mitigation_action": mitigation_action}, schema_validation_update_params.SchemaValidationUpdateParams
),
@@ -279,7 +299,7 @@ async def update(
async def edit(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
settings_multiple_request: SettingsMultipleRequestParam,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -302,10 +322,12 @@ async def edit(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return await self._patch(
- f"/zones/{zone_id}/api_gateway/operations/schema_validation",
+ path_template("/zones/{zone_id}/api_gateway/operations/schema_validation", zone_id=zone_id),
body=await async_maybe_transform(
settings_multiple_request, schema_validation_edit_params.SchemaValidationEditParams
),
@@ -326,7 +348,7 @@ async def get(
self,
operation_id: str,
*,
- zone_id: str,
+ zone_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -350,12 +372,18 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not operation_id:
raise ValueError(f"Expected a non-empty value for `operation_id` but received {operation_id!r}")
return await self._get(
- f"/zones/{zone_id}/api_gateway/operations/{operation_id}/schema_validation",
+ path_template(
+ "/zones/{zone_id}/api_gateway/operations/{operation_id}/schema_validation",
+ zone_id=zone_id,
+ operation_id=operation_id,
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
diff --git a/src/cloudflare/resources/api_gateway/schemas.py b/src/cloudflare/resources/api_gateway/schemas.py
index 2559e6e21c2..aa754506f6d 100644
--- a/src/cloudflare/resources/api_gateway/schemas.py
+++ b/src/cloudflare/resources/api_gateway/schemas.py
@@ -8,7 +8,7 @@
import httpx
from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
-from ..._utils import maybe_transform, async_maybe_transform
+from ..._utils import path_template, maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -48,7 +48,7 @@ def with_streaming_response(self) -> SchemasResourceWithStreamingResponse:
def list(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
feature: List[Literal["thresholds", "parameter_schemas", "schema_info"]] | Omit = omit,
host: SequenceNotStr[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -78,10 +78,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return self._get(
- f"/zones/{zone_id}/api_gateway/schemas",
+ path_template("/zones/{zone_id}/api_gateway/schemas", zone_id=zone_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -123,7 +125,7 @@ def with_streaming_response(self) -> AsyncSchemasResourceWithStreamingResponse:
async def list(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
feature: List[Literal["thresholds", "parameter_schemas", "schema_info"]] | Omit = omit,
host: SequenceNotStr[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -153,10 +155,12 @@ async def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return await self._get(
- f"/zones/{zone_id}/api_gateway/schemas",
+ path_template("/zones/{zone_id}/api_gateway/schemas", zone_id=zone_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/api_gateway/settings/schema_validation.py b/src/cloudflare/resources/api_gateway/settings/schema_validation.py
index edc6f969c00..0f2995bbc91 100644
--- a/src/cloudflare/resources/api_gateway/settings/schema_validation.py
+++ b/src/cloudflare/resources/api_gateway/settings/schema_validation.py
@@ -9,7 +9,7 @@
import httpx
from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ...._utils import maybe_transform, async_maybe_transform
+from ...._utils import path_template, maybe_transform, async_maybe_transform
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -51,7 +51,7 @@ def with_streaming_response(self) -> SchemaValidationResourceWithStreamingRespon
def update(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
validation_default_mitigation_action: Literal["none", "log", "block"],
validation_override_mitigation_action: Optional[Literal["none", "disable_override"]] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -93,10 +93,12 @@ def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return self._put(
- f"/zones/{zone_id}/api_gateway/settings/schema_validation",
+ path_template("/zones/{zone_id}/api_gateway/settings/schema_validation", zone_id=zone_id),
body=maybe_transform(
{
"validation_default_mitigation_action": validation_default_mitigation_action,
@@ -116,7 +118,7 @@ def update(
def edit(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
validation_default_mitigation_action: Optional[Literal["none", "log", "block"]] | Omit = omit,
validation_override_mitigation_action: Optional[Literal["none", "disable_override"]] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -159,10 +161,12 @@ def edit(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return self._patch(
- f"/zones/{zone_id}/api_gateway/settings/schema_validation",
+ path_template("/zones/{zone_id}/api_gateway/settings/schema_validation", zone_id=zone_id),
body=maybe_transform(
{
"validation_default_mitigation_action": validation_default_mitigation_action,
@@ -182,7 +186,7 @@ def edit(
def get(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -204,10 +208,12 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return self._get(
- f"/zones/{zone_id}/api_gateway/settings/schema_validation",
+ path_template("/zones/{zone_id}/api_gateway/settings/schema_validation", zone_id=zone_id),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -241,7 +247,7 @@ def with_streaming_response(self) -> AsyncSchemaValidationResourceWithStreamingR
async def update(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
validation_default_mitigation_action: Literal["none", "log", "block"],
validation_override_mitigation_action: Optional[Literal["none", "disable_override"]] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -283,10 +289,12 @@ async def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return await self._put(
- f"/zones/{zone_id}/api_gateway/settings/schema_validation",
+ path_template("/zones/{zone_id}/api_gateway/settings/schema_validation", zone_id=zone_id),
body=await async_maybe_transform(
{
"validation_default_mitigation_action": validation_default_mitigation_action,
@@ -306,7 +314,7 @@ async def update(
async def edit(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
validation_default_mitigation_action: Optional[Literal["none", "log", "block"]] | Omit = omit,
validation_override_mitigation_action: Optional[Literal["none", "disable_override"]] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -349,10 +357,12 @@ async def edit(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return await self._patch(
- f"/zones/{zone_id}/api_gateway/settings/schema_validation",
+ path_template("/zones/{zone_id}/api_gateway/settings/schema_validation", zone_id=zone_id),
body=await async_maybe_transform(
{
"validation_default_mitigation_action": validation_default_mitigation_action,
@@ -372,7 +382,7 @@ async def edit(
async def get(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -394,10 +404,12 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return await self._get(
- f"/zones/{zone_id}/api_gateway/settings/schema_validation",
+ path_template("/zones/{zone_id}/api_gateway/settings/schema_validation", zone_id=zone_id),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
diff --git a/src/cloudflare/resources/api_gateway/user_schemas/hosts.py b/src/cloudflare/resources/api_gateway/user_schemas/hosts.py
index 01861b64473..f3b2531c3d2 100644
--- a/src/cloudflare/resources/api_gateway/user_schemas/hosts.py
+++ b/src/cloudflare/resources/api_gateway/user_schemas/hosts.py
@@ -7,7 +7,7 @@
import httpx
from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ...._utils import maybe_transform
+from ...._utils import path_template, maybe_transform
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -50,7 +50,7 @@ def with_streaming_response(self) -> HostsResourceWithStreamingResponse:
def list(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
page: int | Omit = omit,
per_page: int | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -60,8 +60,10 @@ def list(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncV4PagePaginationArray[HostListResponse]:
- """
- Retrieve schema hosts in a zone
+ """Lists all unique hosts found in uploaded OpenAPI schemas for the zone.
+
+ Useful
+ for understanding which domains have schema coverage.
Args:
zone_id: Identifier.
@@ -78,10 +80,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return self._get_api_list(
- f"/zones/{zone_id}/api_gateway/user_schemas/hosts",
+ path_template("/zones/{zone_id}/api_gateway/user_schemas/hosts", zone_id=zone_id),
page=SyncV4PagePaginationArray[HostListResponse],
options=make_request_options(
extra_headers=extra_headers,
@@ -126,7 +130,7 @@ def with_streaming_response(self) -> AsyncHostsResourceWithStreamingResponse:
def list(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
page: int | Omit = omit,
per_page: int | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -136,8 +140,10 @@ def list(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[HostListResponse, AsyncV4PagePaginationArray[HostListResponse]]:
- """
- Retrieve schema hosts in a zone
+ """Lists all unique hosts found in uploaded OpenAPI schemas for the zone.
+
+ Useful
+ for understanding which domains have schema coverage.
Args:
zone_id: Identifier.
@@ -154,10 +160,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return self._get_api_list(
- f"/zones/{zone_id}/api_gateway/user_schemas/hosts",
+ path_template("/zones/{zone_id}/api_gateway/user_schemas/hosts", zone_id=zone_id),
page=AsyncV4PagePaginationArray[HostListResponse],
options=make_request_options(
extra_headers=extra_headers,
diff --git a/src/cloudflare/resources/api_gateway/user_schemas/operations.py b/src/cloudflare/resources/api_gateway/user_schemas/operations.py
index d5a04f5f875..59d6e6cce79 100644
--- a/src/cloudflare/resources/api_gateway/user_schemas/operations.py
+++ b/src/cloudflare/resources/api_gateway/user_schemas/operations.py
@@ -9,7 +9,7 @@
import httpx
from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
-from ...._utils import maybe_transform
+from ...._utils import path_template, maybe_transform
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -53,7 +53,7 @@ def list(
self,
schema_id: str,
*,
- zone_id: str,
+ zone_id: str | None = None,
endpoint: str | Omit = omit,
feature: List[Literal["thresholds", "parameter_schemas", "schema_info"]] | Omit = omit,
host: SequenceNotStr[str] | Omit = omit,
@@ -103,12 +103,16 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not schema_id:
raise ValueError(f"Expected a non-empty value for `schema_id` but received {schema_id!r}")
return self._get_api_list(
- f"/zones/{zone_id}/api_gateway/user_schemas/{schema_id}/operations",
+ path_template(
+ "/zones/{zone_id}/api_gateway/user_schemas/{schema_id}/operations", zone_id=zone_id, schema_id=schema_id
+ ),
page=SyncV4PagePaginationArray[OperationListResponse],
options=make_request_options(
extra_headers=extra_headers,
@@ -159,7 +163,7 @@ def list(
self,
schema_id: str,
*,
- zone_id: str,
+ zone_id: str | None = None,
endpoint: str | Omit = omit,
feature: List[Literal["thresholds", "parameter_schemas", "schema_info"]] | Omit = omit,
host: SequenceNotStr[str] | Omit = omit,
@@ -209,12 +213,16 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not schema_id:
raise ValueError(f"Expected a non-empty value for `schema_id` but received {schema_id!r}")
return self._get_api_list(
- f"/zones/{zone_id}/api_gateway/user_schemas/{schema_id}/operations",
+ path_template(
+ "/zones/{zone_id}/api_gateway/user_schemas/{schema_id}/operations", zone_id=zone_id, schema_id=schema_id
+ ),
page=AsyncV4PagePaginationArray[OperationListResponse],
options=make_request_options(
extra_headers=extra_headers,
diff --git a/src/cloudflare/resources/api_gateway/user_schemas/user_schemas.py b/src/cloudflare/resources/api_gateway/user_schemas/user_schemas.py
index e7d9626a705..946cdc27aba 100644
--- a/src/cloudflare/resources/api_gateway/user_schemas/user_schemas.py
+++ b/src/cloudflare/resources/api_gateway/user_schemas/user_schemas.py
@@ -17,7 +17,7 @@
AsyncHostsResourceWithStreamingResponse,
)
from ...._types import Body, Omit, Query, Headers, NotGiven, FileTypes, omit, not_given
-from ...._utils import extract_files, maybe_transform, deepcopy_minimal, async_maybe_transform
+from ...._utils import extract_files, path_template, maybe_transform, deepcopy_minimal, async_maybe_transform
from ...._compat import cached_property
from .operations import (
OperationsResource,
@@ -84,7 +84,7 @@ def with_streaming_response(self) -> UserSchemasResourceWithStreamingResponse:
def create(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
file: FileTypes,
kind: Literal["openapi_v3"],
name: str | Omit = omit,
@@ -118,6 +118,8 @@ def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
body = deepcopy_minimal(
@@ -134,7 +136,7 @@ def create(
# multipart/form-data; boundary=---abc--
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
return self._post(
- f"/zones/{zone_id}/api_gateway/user_schemas",
+ path_template("/zones/{zone_id}/api_gateway/user_schemas", zone_id=zone_id),
body=maybe_transform(body, user_schema_create_params.UserSchemaCreateParams),
files=files,
options=make_request_options(
@@ -153,7 +155,7 @@ def create(
def list(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
omit_source: bool | Omit = omit,
page: int | Omit = omit,
per_page: int | Omit = omit,
@@ -166,7 +168,8 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncV4PagePaginationArray[OldPublicSchema]:
"""
- Retrieve information about all schemas on a zone
+ Lists all OpenAPI schemas uploaded to API Shield for the zone, including their
+ validation status and associated operations.
Args:
zone_id: Identifier.
@@ -187,10 +190,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return self._get_api_list(
- f"/zones/{zone_id}/api_gateway/user_schemas",
+ path_template("/zones/{zone_id}/api_gateway/user_schemas", zone_id=zone_id),
page=SyncV4PagePaginationArray[OldPublicSchema],
options=make_request_options(
extra_headers=extra_headers,
@@ -217,7 +222,7 @@ def delete(
self,
schema_id: str,
*,
- zone_id: str,
+ zone_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -225,8 +230,10 @@ def delete(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> UserSchemaDeleteResponse:
- """
- Delete a schema
+ """Permanently removes an uploaded OpenAPI schema from API Shield schema
+ validation.
+
+ Operations using this schema will lose their validation rules.
Args:
zone_id: Identifier.
@@ -239,12 +246,16 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not schema_id:
raise ValueError(f"Expected a non-empty value for `schema_id` but received {schema_id!r}")
return self._delete(
- f"/zones/{zone_id}/api_gateway/user_schemas/{schema_id}",
+ path_template(
+ "/zones/{zone_id}/api_gateway/user_schemas/{schema_id}", zone_id=zone_id, schema_id=schema_id
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -258,7 +269,7 @@ def edit(
self,
schema_id: str,
*,
- zone_id: str,
+ zone_id: str | None = None,
validation_enabled: Literal[True] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -267,8 +278,10 @@ def edit(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> OldPublicSchema:
- """
- Enable validation for a schema
+ """Activates schema validation for an uploaded OpenAPI schema.
+
+ Requests to matching
+ endpoints will be validated against the schema definitions.
Args:
zone_id: Identifier.
@@ -283,12 +296,16 @@ def edit(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not schema_id:
raise ValueError(f"Expected a non-empty value for `schema_id` but received {schema_id!r}")
return self._patch(
- f"/zones/{zone_id}/api_gateway/user_schemas/{schema_id}",
+ path_template(
+ "/zones/{zone_id}/api_gateway/user_schemas/{schema_id}", zone_id=zone_id, schema_id=schema_id
+ ),
body=maybe_transform(
{"validation_enabled": validation_enabled}, user_schema_edit_params.UserSchemaEditParams
),
@@ -309,7 +326,7 @@ def get(
self,
schema_id: str,
*,
- zone_id: str,
+ zone_id: str | None = None,
omit_source: bool | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -319,7 +336,8 @@ def get(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> OldPublicSchema:
"""
- Retrieve information about a specific schema on a zone
+ Gets detailed information about a specific uploaded OpenAPI schema, including
+ its contents and validation configuration.
Args:
zone_id: Identifier.
@@ -334,12 +352,16 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not schema_id:
raise ValueError(f"Expected a non-empty value for `schema_id` but received {schema_id!r}")
return self._get(
- f"/zones/{zone_id}/api_gateway/user_schemas/{schema_id}",
+ path_template(
+ "/zones/{zone_id}/api_gateway/user_schemas/{schema_id}", zone_id=zone_id, schema_id=schema_id
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -386,7 +408,7 @@ def with_streaming_response(self) -> AsyncUserSchemasResourceWithStreamingRespon
async def create(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
file: FileTypes,
kind: Literal["openapi_v3"],
name: str | Omit = omit,
@@ -420,6 +442,8 @@ async def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
body = deepcopy_minimal(
@@ -436,7 +460,7 @@ async def create(
# multipart/form-data; boundary=---abc--
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
return await self._post(
- f"/zones/{zone_id}/api_gateway/user_schemas",
+ path_template("/zones/{zone_id}/api_gateway/user_schemas", zone_id=zone_id),
body=await async_maybe_transform(body, user_schema_create_params.UserSchemaCreateParams),
files=files,
options=make_request_options(
@@ -455,7 +479,7 @@ async def create(
def list(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
omit_source: bool | Omit = omit,
page: int | Omit = omit,
per_page: int | Omit = omit,
@@ -468,7 +492,8 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[OldPublicSchema, AsyncV4PagePaginationArray[OldPublicSchema]]:
"""
- Retrieve information about all schemas on a zone
+ Lists all OpenAPI schemas uploaded to API Shield for the zone, including their
+ validation status and associated operations.
Args:
zone_id: Identifier.
@@ -489,10 +514,12 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return self._get_api_list(
- f"/zones/{zone_id}/api_gateway/user_schemas",
+ path_template("/zones/{zone_id}/api_gateway/user_schemas", zone_id=zone_id),
page=AsyncV4PagePaginationArray[OldPublicSchema],
options=make_request_options(
extra_headers=extra_headers,
@@ -519,7 +546,7 @@ async def delete(
self,
schema_id: str,
*,
- zone_id: str,
+ zone_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -527,8 +554,10 @@ async def delete(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> UserSchemaDeleteResponse:
- """
- Delete a schema
+ """Permanently removes an uploaded OpenAPI schema from API Shield schema
+ validation.
+
+ Operations using this schema will lose their validation rules.
Args:
zone_id: Identifier.
@@ -541,12 +570,16 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not schema_id:
raise ValueError(f"Expected a non-empty value for `schema_id` but received {schema_id!r}")
return await self._delete(
- f"/zones/{zone_id}/api_gateway/user_schemas/{schema_id}",
+ path_template(
+ "/zones/{zone_id}/api_gateway/user_schemas/{schema_id}", zone_id=zone_id, schema_id=schema_id
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -560,7 +593,7 @@ async def edit(
self,
schema_id: str,
*,
- zone_id: str,
+ zone_id: str | None = None,
validation_enabled: Literal[True] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -569,8 +602,10 @@ async def edit(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> OldPublicSchema:
- """
- Enable validation for a schema
+ """Activates schema validation for an uploaded OpenAPI schema.
+
+ Requests to matching
+ endpoints will be validated against the schema definitions.
Args:
zone_id: Identifier.
@@ -585,12 +620,16 @@ async def edit(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not schema_id:
raise ValueError(f"Expected a non-empty value for `schema_id` but received {schema_id!r}")
return await self._patch(
- f"/zones/{zone_id}/api_gateway/user_schemas/{schema_id}",
+ path_template(
+ "/zones/{zone_id}/api_gateway/user_schemas/{schema_id}", zone_id=zone_id, schema_id=schema_id
+ ),
body=await async_maybe_transform(
{"validation_enabled": validation_enabled}, user_schema_edit_params.UserSchemaEditParams
),
@@ -611,7 +650,7 @@ async def get(
self,
schema_id: str,
*,
- zone_id: str,
+ zone_id: str | None = None,
omit_source: bool | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -621,7 +660,8 @@ async def get(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> OldPublicSchema:
"""
- Retrieve information about a specific schema on a zone
+ Gets detailed information about a specific uploaded OpenAPI schema, including
+ its contents and validation configuration.
Args:
zone_id: Identifier.
@@ -636,12 +676,16 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
if not schema_id:
raise ValueError(f"Expected a non-empty value for `schema_id` but received {schema_id!r}")
return await self._get(
- f"/zones/{zone_id}/api_gateway/user_schemas/{schema_id}",
+ path_template(
+ "/zones/{zone_id}/api_gateway/user_schemas/{schema_id}", zone_id=zone_id, schema_id=schema_id
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/argo/api.md b/src/cloudflare/resources/argo/api.md
new file mode 100644
index 00000000000..8f14d7c8ff4
--- /dev/null
+++ b/src/cloudflare/resources/argo/api.md
@@ -0,0 +1,27 @@
+# Argo
+
+## SmartRouting
+
+Types:
+
+```python
+from cloudflare.types.argo import SmartRoutingEditResponse, SmartRoutingGetResponse
+```
+
+Methods:
+
+- client.argo.smart_routing.edit(\*, zone_id, \*\*params) -> SmartRoutingEditResponse
+- client.argo.smart_routing.get(\*, zone_id) -> SmartRoutingGetResponse
+
+## TieredCaching
+
+Types:
+
+```python
+from cloudflare.types.argo import TieredCachingEditResponse, TieredCachingGetResponse
+```
+
+Methods:
+
+- client.argo.tiered_caching.edit(\*, zone_id, \*\*params) -> Optional[TieredCachingEditResponse]
+- client.argo.tiered_caching.get(\*, zone_id) -> Optional[TieredCachingGetResponse]
diff --git a/src/cloudflare/resources/argo/smart_routing.py b/src/cloudflare/resources/argo/smart_routing.py
index d45d9be9c4d..81eedc11d47 100644
--- a/src/cloudflare/resources/argo/smart_routing.py
+++ b/src/cloudflare/resources/argo/smart_routing.py
@@ -8,7 +8,7 @@
import httpx
from ..._types import Body, Query, Headers, NotGiven, not_given
-from ..._utils import maybe_transform, async_maybe_transform
+from ..._utils import path_template, maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -49,7 +49,7 @@ def with_streaming_response(self) -> SmartRoutingResourceWithStreamingResponse:
def edit(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
value: Literal["on", "off"],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -74,10 +74,12 @@ def edit(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return self._patch(
- f"/zones/{zone_id}/argo/smart_routing",
+ path_template("/zones/{zone_id}/argo/smart_routing", zone_id=zone_id),
body=maybe_transform({"value": value}, smart_routing_edit_params.SmartRoutingEditParams),
options=make_request_options(
extra_headers=extra_headers,
@@ -92,7 +94,7 @@ def edit(
def get(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -114,10 +116,12 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return self._get(
- f"/zones/{zone_id}/argo/smart_routing",
+ path_template("/zones/{zone_id}/argo/smart_routing", zone_id=zone_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -152,7 +156,7 @@ def with_streaming_response(self) -> AsyncSmartRoutingResourceWithStreamingRespo
async def edit(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
value: Literal["on", "off"],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -177,10 +181,12 @@ async def edit(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return await self._patch(
- f"/zones/{zone_id}/argo/smart_routing",
+ path_template("/zones/{zone_id}/argo/smart_routing", zone_id=zone_id),
body=await async_maybe_transform({"value": value}, smart_routing_edit_params.SmartRoutingEditParams),
options=make_request_options(
extra_headers=extra_headers,
@@ -195,7 +201,7 @@ async def edit(
async def get(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -217,10 +223,12 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return await self._get(
- f"/zones/{zone_id}/argo/smart_routing",
+ path_template("/zones/{zone_id}/argo/smart_routing", zone_id=zone_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/argo/tiered_caching.py b/src/cloudflare/resources/argo/tiered_caching.py
index 9662940b73c..ccdecb2b9f4 100644
--- a/src/cloudflare/resources/argo/tiered_caching.py
+++ b/src/cloudflare/resources/argo/tiered_caching.py
@@ -8,7 +8,7 @@
import httpx
from ..._types import Body, Query, Headers, NotGiven, not_given
-from ..._utils import maybe_transform, async_maybe_transform
+from ..._utils import path_template, maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -49,7 +49,7 @@ def with_streaming_response(self) -> TieredCachingResourceWithStreamingResponse:
def edit(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
value: Literal["on", "off"],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -84,10 +84,12 @@ def edit(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return self._patch(
- f"/zones/{zone_id}/argo/tiered_caching",
+ path_template("/zones/{zone_id}/argo/tiered_caching", zone_id=zone_id),
body=maybe_transform({"value": value}, tiered_caching_edit_params.TieredCachingEditParams),
options=make_request_options(
extra_headers=extra_headers,
@@ -102,7 +104,7 @@ def edit(
def get(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -134,10 +136,12 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return self._get(
- f"/zones/{zone_id}/argo/tiered_caching",
+ path_template("/zones/{zone_id}/argo/tiered_caching", zone_id=zone_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -172,7 +176,7 @@ def with_streaming_response(self) -> AsyncTieredCachingResourceWithStreamingResp
async def edit(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
value: Literal["on", "off"],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -207,10 +211,12 @@ async def edit(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return await self._patch(
- f"/zones/{zone_id}/argo/tiered_caching",
+ path_template("/zones/{zone_id}/argo/tiered_caching", zone_id=zone_id),
body=await async_maybe_transform({"value": value}, tiered_caching_edit_params.TieredCachingEditParams),
options=make_request_options(
extra_headers=extra_headers,
@@ -225,7 +231,7 @@ async def edit(
async def get(
self,
*,
- zone_id: str,
+ zone_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -257,10 +263,12 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return await self._get(
- f"/zones/{zone_id}/argo/tiered_caching",
+ path_template("/zones/{zone_id}/argo/tiered_caching", zone_id=zone_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/audit_logs/__init__.py b/src/cloudflare/resources/audit_logs/__init__.py
new file mode 100644
index 00000000000..5b68ef05434
--- /dev/null
+++ b/src/cloudflare/resources/audit_logs/__init__.py
@@ -0,0 +1,19 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from .audit_logs import (
+ AuditLogsResource,
+ AsyncAuditLogsResource,
+ AuditLogsResourceWithRawResponse,
+ AsyncAuditLogsResourceWithRawResponse,
+ AuditLogsResourceWithStreamingResponse,
+ AsyncAuditLogsResourceWithStreamingResponse,
+)
+
+__all__ = [
+ "AuditLogsResource",
+ "AsyncAuditLogsResource",
+ "AuditLogsResourceWithRawResponse",
+ "AsyncAuditLogsResourceWithRawResponse",
+ "AuditLogsResourceWithStreamingResponse",
+ "AsyncAuditLogsResourceWithStreamingResponse",
+]
diff --git a/src/cloudflare/resources/audit_logs/api.md b/src/cloudflare/resources/audit_logs/api.md
new file mode 100644
index 00000000000..bc35bf17c55
--- /dev/null
+++ b/src/cloudflare/resources/audit_logs/api.md
@@ -0,0 +1,5 @@
+# AuditLogs
+
+Methods:
+
+- client.audit_logs.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[AuditLog]
diff --git a/src/cloudflare/resources/audit_logs/audit_logs.py b/src/cloudflare/resources/audit_logs/audit_logs.py
new file mode 100644
index 00000000000..dc718943528
--- /dev/null
+++ b/src/cloudflare/resources/audit_logs/audit_logs.py
@@ -0,0 +1,280 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Union
+from datetime import date, datetime
+from typing_extensions import Literal
+
+import httpx
+
+from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
+from ..._utils import path_template, maybe_transform
+from ..._compat import cached_property
+from ..._resource import SyncAPIResource, AsyncAPIResource
+from ..._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from ...pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray
+from ..._base_client import AsyncPaginator, make_request_options
+from ...types.audit_logs import audit_log_list_params
+from ...types.shared.audit_log import AuditLog
+
+__all__ = ["AuditLogsResource", "AsyncAuditLogsResource"]
+
+
+class AuditLogsResource(SyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> AuditLogsResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return AuditLogsResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AuditLogsResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return AuditLogsResourceWithStreamingResponse(self)
+
+ def list(
+ self,
+ *,
+ account_id: str | None = None,
+ id: str | Omit = omit,
+ action: audit_log_list_params.Action | Omit = omit,
+ actor: audit_log_list_params.Actor | Omit = omit,
+ before: Union[Union[str, date], Union[str, datetime]] | Omit = omit,
+ direction: Literal["desc", "asc"] | Omit = omit,
+ export: bool | Omit = omit,
+ hide_user_logs: bool | Omit = omit,
+ page: float | Omit = omit,
+ per_page: float | Omit = omit,
+ since: Union[Union[str, date], Union[str, datetime]] | Omit = omit,
+ zone: audit_log_list_params.Zone | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> SyncV4PagePaginationArray[AuditLog]:
+ """Gets a list of audit logs for an account.
+
+ Can be filtered by who made the
+ change, on which zone, and the timeframe of the change.
+
+ Args:
+ account_id: Identifier
+
+ id: Finds a specific log by its ID.
+
+ before: Limits the returned results to logs older than the specified date. A `full-date`
+ that conforms to RFC3339.
+
+ direction: Changes the direction of the chronological sorting.
+
+ export: Indicates that this request is an export of logs in CSV format.
+
+ hide_user_logs: Indicates whether or not to hide user level audit logs.
+
+ page: Defines which page of results to return.
+
+ per_page: Sets the number of results to return per page.
+
+ since: Limits the returned results to logs newer than the specified date. A `full-date`
+ that conforms to RFC3339.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ return self._get_api_list(
+ path_template("/accounts/{account_id}/audit_logs", account_id=account_id),
+ page=SyncV4PagePaginationArray[AuditLog],
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "id": id,
+ "action": action,
+ "actor": actor,
+ "before": before,
+ "direction": direction,
+ "export": export,
+ "hide_user_logs": hide_user_logs,
+ "page": page,
+ "per_page": per_page,
+ "since": since,
+ "zone": zone,
+ },
+ audit_log_list_params.AuditLogListParams,
+ ),
+ ),
+ model=AuditLog,
+ )
+
+
+class AsyncAuditLogsResource(AsyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> AsyncAuditLogsResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncAuditLogsResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncAuditLogsResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return AsyncAuditLogsResourceWithStreamingResponse(self)
+
+ def list(
+ self,
+ *,
+ account_id: str | None = None,
+ id: str | Omit = omit,
+ action: audit_log_list_params.Action | Omit = omit,
+ actor: audit_log_list_params.Actor | Omit = omit,
+ before: Union[Union[str, date], Union[str, datetime]] | Omit = omit,
+ direction: Literal["desc", "asc"] | Omit = omit,
+ export: bool | Omit = omit,
+ hide_user_logs: bool | Omit = omit,
+ page: float | Omit = omit,
+ per_page: float | Omit = omit,
+ since: Union[Union[str, date], Union[str, datetime]] | Omit = omit,
+ zone: audit_log_list_params.Zone | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> AsyncPaginator[AuditLog, AsyncV4PagePaginationArray[AuditLog]]:
+ """Gets a list of audit logs for an account.
+
+ Can be filtered by who made the
+ change, on which zone, and the timeframe of the change.
+
+ Args:
+ account_id: Identifier
+
+ id: Finds a specific log by its ID.
+
+ before: Limits the returned results to logs older than the specified date. A `full-date`
+ that conforms to RFC3339.
+
+ direction: Changes the direction of the chronological sorting.
+
+ export: Indicates that this request is an export of logs in CSV format.
+
+ hide_user_logs: Indicates whether or not to hide user level audit logs.
+
+ page: Defines which page of results to return.
+
+ per_page: Sets the number of results to return per page.
+
+ since: Limits the returned results to logs newer than the specified date. A `full-date`
+ that conforms to RFC3339.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ return self._get_api_list(
+ path_template("/accounts/{account_id}/audit_logs", account_id=account_id),
+ page=AsyncV4PagePaginationArray[AuditLog],
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "id": id,
+ "action": action,
+ "actor": actor,
+ "before": before,
+ "direction": direction,
+ "export": export,
+ "hide_user_logs": hide_user_logs,
+ "page": page,
+ "per_page": per_page,
+ "since": since,
+ "zone": zone,
+ },
+ audit_log_list_params.AuditLogListParams,
+ ),
+ ),
+ model=AuditLog,
+ )
+
+
+class AuditLogsResourceWithRawResponse:
+ def __init__(self, audit_logs: AuditLogsResource) -> None:
+ self._audit_logs = audit_logs
+
+ self.list = to_raw_response_wrapper(
+ audit_logs.list,
+ )
+
+
+class AsyncAuditLogsResourceWithRawResponse:
+ def __init__(self, audit_logs: AsyncAuditLogsResource) -> None:
+ self._audit_logs = audit_logs
+
+ self.list = async_to_raw_response_wrapper(
+ audit_logs.list,
+ )
+
+
+class AuditLogsResourceWithStreamingResponse:
+ def __init__(self, audit_logs: AuditLogsResource) -> None:
+ self._audit_logs = audit_logs
+
+ self.list = to_streamed_response_wrapper(
+ audit_logs.list,
+ )
+
+
+class AsyncAuditLogsResourceWithStreamingResponse:
+ def __init__(self, audit_logs: AsyncAuditLogsResource) -> None:
+ self._audit_logs = audit_logs
+
+ self.list = async_to_streamed_response_wrapper(
+ audit_logs.list,
+ )
diff --git a/src/cloudflare/resources/billing/__init__.py b/src/cloudflare/resources/billing/__init__.py
index c16ec03c4dc..a0005fa8305 100644
--- a/src/cloudflare/resources/billing/__init__.py
+++ b/src/cloudflare/resources/billing/__init__.py
@@ -1,5 +1,13 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+from .usage import (
+ UsageResource,
+ AsyncUsageResource,
+ UsageResourceWithRawResponse,
+ AsyncUsageResourceWithRawResponse,
+ UsageResourceWithStreamingResponse,
+ AsyncUsageResourceWithStreamingResponse,
+)
from .billing import (
BillingResource,
AsyncBillingResource,
@@ -24,6 +32,12 @@
"AsyncProfilesResourceWithRawResponse",
"ProfilesResourceWithStreamingResponse",
"AsyncProfilesResourceWithStreamingResponse",
+ "UsageResource",
+ "AsyncUsageResource",
+ "UsageResourceWithRawResponse",
+ "AsyncUsageResourceWithRawResponse",
+ "UsageResourceWithStreamingResponse",
+ "AsyncUsageResourceWithStreamingResponse",
"BillingResource",
"AsyncBillingResource",
"BillingResourceWithRawResponse",
diff --git a/src/cloudflare/resources/billing/api.md b/src/cloudflare/resources/billing/api.md
new file mode 100644
index 00000000000..1580ce478f0
--- /dev/null
+++ b/src/cloudflare/resources/billing/api.md
@@ -0,0 +1,25 @@
+# Billing
+
+## Profiles
+
+Types:
+
+```python
+from cloudflare.types.billing import ProfileGetResponse
+```
+
+Methods:
+
+- client.billing.profiles.get(\*, account_id) -> ProfileGetResponse
+
+## Usage
+
+Types:
+
+```python
+from cloudflare.types.billing import UsagePaygoResponse
+```
+
+Methods:
+
+- client.billing.usage.paygo(\*, account_id, \*\*params) -> UsagePaygoResponse
diff --git a/src/cloudflare/resources/billing/billing.py b/src/cloudflare/resources/billing/billing.py
index d57c019144e..5d7a8e1d11a 100644
--- a/src/cloudflare/resources/billing/billing.py
+++ b/src/cloudflare/resources/billing/billing.py
@@ -2,6 +2,14 @@
from __future__ import annotations
+from .usage import (
+ UsageResource,
+ AsyncUsageResource,
+ UsageResourceWithRawResponse,
+ AsyncUsageResourceWithRawResponse,
+ UsageResourceWithStreamingResponse,
+ AsyncUsageResourceWithStreamingResponse,
+)
from .profiles import (
ProfilesResource,
AsyncProfilesResource,
@@ -21,6 +29,10 @@ class BillingResource(SyncAPIResource):
def profiles(self) -> ProfilesResource:
return ProfilesResource(self._client)
+ @cached_property
+ def usage(self) -> UsageResource:
+ return UsageResource(self._client)
+
@cached_property
def with_raw_response(self) -> BillingResourceWithRawResponse:
"""
@@ -46,6 +58,10 @@ class AsyncBillingResource(AsyncAPIResource):
def profiles(self) -> AsyncProfilesResource:
return AsyncProfilesResource(self._client)
+ @cached_property
+ def usage(self) -> AsyncUsageResource:
+ return AsyncUsageResource(self._client)
+
@cached_property
def with_raw_response(self) -> AsyncBillingResourceWithRawResponse:
"""
@@ -74,6 +90,10 @@ def __init__(self, billing: BillingResource) -> None:
def profiles(self) -> ProfilesResourceWithRawResponse:
return ProfilesResourceWithRawResponse(self._billing.profiles)
+ @cached_property
+ def usage(self) -> UsageResourceWithRawResponse:
+ return UsageResourceWithRawResponse(self._billing.usage)
+
class AsyncBillingResourceWithRawResponse:
def __init__(self, billing: AsyncBillingResource) -> None:
@@ -83,6 +103,10 @@ def __init__(self, billing: AsyncBillingResource) -> None:
def profiles(self) -> AsyncProfilesResourceWithRawResponse:
return AsyncProfilesResourceWithRawResponse(self._billing.profiles)
+ @cached_property
+ def usage(self) -> AsyncUsageResourceWithRawResponse:
+ return AsyncUsageResourceWithRawResponse(self._billing.usage)
+
class BillingResourceWithStreamingResponse:
def __init__(self, billing: BillingResource) -> None:
@@ -92,6 +116,10 @@ def __init__(self, billing: BillingResource) -> None:
def profiles(self) -> ProfilesResourceWithStreamingResponse:
return ProfilesResourceWithStreamingResponse(self._billing.profiles)
+ @cached_property
+ def usage(self) -> UsageResourceWithStreamingResponse:
+ return UsageResourceWithStreamingResponse(self._billing.usage)
+
class AsyncBillingResourceWithStreamingResponse:
def __init__(self, billing: AsyncBillingResource) -> None:
@@ -100,3 +128,7 @@ def __init__(self, billing: AsyncBillingResource) -> None:
@cached_property
def profiles(self) -> AsyncProfilesResourceWithStreamingResponse:
return AsyncProfilesResourceWithStreamingResponse(self._billing.profiles)
+
+ @cached_property
+ def usage(self) -> AsyncUsageResourceWithStreamingResponse:
+ return AsyncUsageResourceWithStreamingResponse(self._billing.usage)
diff --git a/src/cloudflare/resources/billing/profiles.py b/src/cloudflare/resources/billing/profiles.py
index f3272600105..54fe1721609 100644
--- a/src/cloudflare/resources/billing/profiles.py
+++ b/src/cloudflare/resources/billing/profiles.py
@@ -8,6 +8,7 @@
import httpx
from ..._types import Body, Query, Headers, NotGiven, not_given
+from ..._utils import path_template
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -47,7 +48,7 @@ def with_streaming_response(self) -> ProfilesResourceWithStreamingResponse:
def get(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -69,10 +70,12 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get(
- f"/accounts/{account_id}/billing/profile",
+ path_template("/accounts/{account_id}/billing/profile", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -108,7 +111,7 @@ def with_streaming_response(self) -> AsyncProfilesResourceWithStreamingResponse:
async def get(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -130,10 +133,12 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._get(
- f"/accounts/{account_id}/billing/profile",
+ path_template("/accounts/{account_id}/billing/profile", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/billing/usage.py b/src/cloudflare/resources/billing/usage.py
new file mode 100644
index 00000000000..1b3636edb18
--- /dev/null
+++ b/src/cloudflare/resources/billing/usage.py
@@ -0,0 +1,217 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Type, Union, cast
+from datetime import date
+
+import httpx
+
+from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
+from ..._utils import path_template, maybe_transform, async_maybe_transform
+from ..._compat import cached_property
+from ..._resource import SyncAPIResource, AsyncAPIResource
+from ..._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from ..._wrappers import ResultWrapper
+from ..._base_client import make_request_options
+from ...types.billing import usage_paygo_params
+from ...types.billing.usage_paygo_response import UsagePaygoResponse
+
+__all__ = ["UsageResource", "AsyncUsageResource"]
+
+
+class UsageResource(SyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> UsageResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return UsageResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> UsageResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return UsageResourceWithStreamingResponse(self)
+
+ def paygo(
+ self,
+ *,
+ account_id: str | None = None,
+ from_: Union[str, date] | Omit = omit,
+ to: Union[str, date] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> UsagePaygoResponse:
+ """Returns billable usage data for PayGo (self-serve) accounts.
+
+ When no query
+ parameters are provided, returns usage for the current billing period. This
+ endpoint is currently in beta and access is restricted to select accounts.
+
+ Args:
+ account_id: Represents a Cloudflare resource identifier tag.
+
+ from_: Defines the start date for the usage query (e.g., 2025-02-01).
+
+ to: Defines the end date for the usage query (e.g., 2025-03-01).
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ return self._get(
+ path_template("/accounts/{account_id}/billing/usage/paygo", account_id=account_id),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "from_": from_,
+ "to": to,
+ },
+ usage_paygo_params.UsagePaygoParams,
+ ),
+ post_parser=ResultWrapper[UsagePaygoResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[UsagePaygoResponse], ResultWrapper[UsagePaygoResponse]),
+ )
+
+
+class AsyncUsageResource(AsyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> AsyncUsageResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncUsageResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncUsageResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return AsyncUsageResourceWithStreamingResponse(self)
+
+ async def paygo(
+ self,
+ *,
+ account_id: str | None = None,
+ from_: Union[str, date] | Omit = omit,
+ to: Union[str, date] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> UsagePaygoResponse:
+ """Returns billable usage data for PayGo (self-serve) accounts.
+
+ When no query
+ parameters are provided, returns usage for the current billing period. This
+ endpoint is currently in beta and access is restricted to select accounts.
+
+ Args:
+ account_id: Represents a Cloudflare resource identifier tag.
+
+ from_: Defines the start date for the usage query (e.g., 2025-02-01).
+
+ to: Defines the end date for the usage query (e.g., 2025-03-01).
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ return await self._get(
+ path_template("/accounts/{account_id}/billing/usage/paygo", account_id=account_id),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=await async_maybe_transform(
+ {
+ "from_": from_,
+ "to": to,
+ },
+ usage_paygo_params.UsagePaygoParams,
+ ),
+ post_parser=ResultWrapper[UsagePaygoResponse]._unwrapper,
+ ),
+ cast_to=cast(Type[UsagePaygoResponse], ResultWrapper[UsagePaygoResponse]),
+ )
+
+
+class UsageResourceWithRawResponse:
+ def __init__(self, usage: UsageResource) -> None:
+ self._usage = usage
+
+ self.paygo = to_raw_response_wrapper(
+ usage.paygo,
+ )
+
+
+class AsyncUsageResourceWithRawResponse:
+ def __init__(self, usage: AsyncUsageResource) -> None:
+ self._usage = usage
+
+ self.paygo = async_to_raw_response_wrapper(
+ usage.paygo,
+ )
+
+
+class UsageResourceWithStreamingResponse:
+ def __init__(self, usage: UsageResource) -> None:
+ self._usage = usage
+
+ self.paygo = to_streamed_response_wrapper(
+ usage.paygo,
+ )
+
+
+class AsyncUsageResourceWithStreamingResponse:
+ def __init__(self, usage: AsyncUsageResource) -> None:
+ self._usage = usage
+
+ self.paygo = async_to_streamed_response_wrapper(
+ usage.paygo,
+ )
diff --git a/src/cloudflare/resources/bot_management/__init__.py b/src/cloudflare/resources/bot_management/__init__.py
new file mode 100644
index 00000000000..2a4e95b54b3
--- /dev/null
+++ b/src/cloudflare/resources/bot_management/__init__.py
@@ -0,0 +1,19 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from .bot_management import (
+ BotManagementResource,
+ AsyncBotManagementResource,
+ BotManagementResourceWithRawResponse,
+ AsyncBotManagementResourceWithRawResponse,
+ BotManagementResourceWithStreamingResponse,
+ AsyncBotManagementResourceWithStreamingResponse,
+)
+
+__all__ = [
+ "BotManagementResource",
+ "AsyncBotManagementResource",
+ "BotManagementResourceWithRawResponse",
+ "AsyncBotManagementResourceWithRawResponse",
+ "BotManagementResourceWithStreamingResponse",
+ "AsyncBotManagementResourceWithStreamingResponse",
+]
diff --git a/src/cloudflare/resources/bot_management/api.md b/src/cloudflare/resources/bot_management/api.md
new file mode 100644
index 00000000000..906f8dfd9b6
--- /dev/null
+++ b/src/cloudflare/resources/bot_management/api.md
@@ -0,0 +1,19 @@
+# BotManagement
+
+Types:
+
+```python
+from cloudflare.types.bot_management import (
+ BotFightModeConfiguration,
+ SubscriptionConfiguration,
+ SuperBotFightModeDefinitelyConfiguration,
+ SuperBotFightModeLikelyConfiguration,
+ BotManagementUpdateResponse,
+ BotManagementGetResponse,
+)
+```
+
+Methods:
+
+- client.bot_management.update(\*, zone_id, \*\*params) -> Optional[BotManagementUpdateResponse]
+- client.bot_management.get(\*, zone_id) -> Optional[BotManagementGetResponse]
diff --git a/src/cloudflare/resources/bot_management/bot_management.py b/src/cloudflare/resources/bot_management/bot_management.py
new file mode 100644
index 00000000000..dfa0e3cf12a
--- /dev/null
+++ b/src/cloudflare/resources/bot_management/bot_management.py
@@ -0,0 +1,1280 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Any, Optional, cast
+from typing_extensions import Literal, overload
+
+import httpx
+
+from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
+from ..._utils import path_template, maybe_transform, async_maybe_transform
+from ..._compat import cached_property
+from ..._resource import SyncAPIResource, AsyncAPIResource
+from ..._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from ..._wrappers import ResultWrapper
+from ..._base_client import make_request_options
+from ...types.bot_management import bot_management_update_params
+from ...types.bot_management.bot_management_get_response import BotManagementGetResponse
+from ...types.bot_management.bot_management_update_response import BotManagementUpdateResponse
+
+__all__ = ["BotManagementResource", "AsyncBotManagementResource"]
+
+
+class BotManagementResource(SyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> BotManagementResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return BotManagementResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> BotManagementResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return BotManagementResourceWithStreamingResponse(self)
+
+ @overload
+ def update(
+ self,
+ *,
+ zone_id: str | None = None,
+ ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] | Omit = omit,
+ cf_robots_variant: Literal["off", "policy_only"] | Omit = omit,
+ crawler_protection: Literal["enabled", "disabled"] | Omit = omit,
+ enable_js: bool | Omit = omit,
+ fight_mode: bool | Omit = omit,
+ is_robots_txt_managed: bool | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> Optional[BotManagementUpdateResponse]:
+ """
+ Updates the Bot Management configuration for a zone.
+
+ This API is used to update:
+
+ - **Bot Fight Mode**
+ - **Super Bot Fight Mode**
+ - **Bot Management for Enterprise**
+
+ See [Bot Plans](https://developers.cloudflare.com/bots/plans/) for more
+ information on the different plans \\
+ If you recently upgraded or downgraded your plan, refer to the following examples
+ to clean up old configurations. Copy and paste the example body to remove old zone
+ configurations based on your current plan.
+
+ #### Clean up configuration for Bot Fight Mode plan
+
+ ```json
+ {
+ "sbfm_likely_automated": "allow",
+ "sbfm_definitely_automated": "allow",
+ "sbfm_verified_bots": "allow",
+ "sbfm_static_resource_protection": false,
+ "optimize_wordpress": false,
+ "suppress_session_score": false
+ }
+ ```
+
+ #### Clean up configuration for SBFM Pro plan
+
+ ```json
+ {
+ "sbfm_likely_automated": "allow",
+ "fight_mode": false
+ }
+ ```
+
+ #### Clean up configuration for SBFM Biz plan
+
+ ```json
+ {
+ "fight_mode": false
+ }
+ ```
+
+ #### Clean up configuration for BM Enterprise Subscription plan
+
+ It is strongly recommended that you ensure you have
+ [custom rules](https://developers.cloudflare.com/waf/custom-rules/) in place to
+ protect your zone before disabling the SBFM rules. Without these protections,
+ your zone is vulnerable to attacks.
+
+ ```json
+ {
+ "sbfm_likely_automated": "allow",
+ "sbfm_definitely_automated": "allow",
+ "sbfm_verified_bots": "allow",
+ "sbfm_static_resource_protection": false,
+ "optimize_wordpress": false,
+ "fight_mode": false
+ }
+ ```
+
+ Args:
+ zone_id: Identifier.
+
+ ai_bots_protection: Enable rule to block AI Scrapers and Crawlers. Please note the value
+ `only_on_ad_pages` is currently not available for Enterprise customers.
+
+ cf_robots_variant: Specifies the Robots Access Control License variant to use.
+
+ crawler_protection: Enable rule to punish AI Scrapers and Crawlers via a link maze.
+
+ enable_js: Use lightweight, invisible JavaScript detections to improve Bot Management.
+ [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/).
+
+ fight_mode: Whether to enable Bot Fight Mode.
+
+ is_robots_txt_managed: Enable cloudflare managed robots.txt. If an existing robots.txt is detected,
+ then managed robots.txt will be prepended to the existing robots.txt.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ ...
+
+ @overload
+ def update(
+ self,
+ *,
+ zone_id: str | None = None,
+ ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] | Omit = omit,
+ cf_robots_variant: Literal["off", "policy_only"] | Omit = omit,
+ crawler_protection: Literal["enabled", "disabled"] | Omit = omit,
+ enable_js: bool | Omit = omit,
+ is_robots_txt_managed: bool | Omit = omit,
+ optimize_wordpress: bool | Omit = omit,
+ sbfm_definitely_automated: Literal["allow", "block", "managed_challenge"] | Omit = omit,
+ sbfm_static_resource_protection: bool | Omit = omit,
+ sbfm_verified_bots: Literal["allow", "block"] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> Optional[BotManagementUpdateResponse]:
+ """
+ Updates the Bot Management configuration for a zone.
+
+ This API is used to update:
+
+ - **Bot Fight Mode**
+ - **Super Bot Fight Mode**
+ - **Bot Management for Enterprise**
+
+ See [Bot Plans](https://developers.cloudflare.com/bots/plans/) for more
+ information on the different plans \\
+ If you recently upgraded or downgraded your plan, refer to the following examples
+ to clean up old configurations. Copy and paste the example body to remove old zone
+ configurations based on your current plan.
+
+ #### Clean up configuration for Bot Fight Mode plan
+
+ ```json
+ {
+ "sbfm_likely_automated": "allow",
+ "sbfm_definitely_automated": "allow",
+ "sbfm_verified_bots": "allow",
+ "sbfm_static_resource_protection": false,
+ "optimize_wordpress": false,
+ "suppress_session_score": false
+ }
+ ```
+
+ #### Clean up configuration for SBFM Pro plan
+
+ ```json
+ {
+ "sbfm_likely_automated": "allow",
+ "fight_mode": false
+ }
+ ```
+
+ #### Clean up configuration for SBFM Biz plan
+
+ ```json
+ {
+ "fight_mode": false
+ }
+ ```
+
+ #### Clean up configuration for BM Enterprise Subscription plan
+
+ It is strongly recommended that you ensure you have
+ [custom rules](https://developers.cloudflare.com/waf/custom-rules/) in place to
+ protect your zone before disabling the SBFM rules. Without these protections,
+ your zone is vulnerable to attacks.
+
+ ```json
+ {
+ "sbfm_likely_automated": "allow",
+ "sbfm_definitely_automated": "allow",
+ "sbfm_verified_bots": "allow",
+ "sbfm_static_resource_protection": false,
+ "optimize_wordpress": false,
+ "fight_mode": false
+ }
+ ```
+
+ Args:
+ zone_id: Identifier.
+
+ ai_bots_protection: Enable rule to block AI Scrapers and Crawlers. Please note the value
+ `only_on_ad_pages` is currently not available for Enterprise customers.
+
+ cf_robots_variant: Specifies the Robots Access Control License variant to use.
+
+ crawler_protection: Enable rule to punish AI Scrapers and Crawlers via a link maze.
+
+ enable_js: Use lightweight, invisible JavaScript detections to improve Bot Management.
+ [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/).
+
+ is_robots_txt_managed: Enable cloudflare managed robots.txt. If an existing robots.txt is detected,
+ then managed robots.txt will be prepended to the existing robots.txt.
+
+ optimize_wordpress: Whether to optimize Super Bot Fight Mode protections for Wordpress.
+
+ sbfm_definitely_automated: Super Bot Fight Mode (SBFM) action to take on definitely automated requests.
+
+ sbfm_static_resource_protection: Super Bot Fight Mode (SBFM) to enable static resource protection. Enable if
+ static resources on your application need bot protection. Note: Static resource
+ protection can also result in legitimate traffic being blocked.
+
+ sbfm_verified_bots: Super Bot Fight Mode (SBFM) action to take on verified bots requests.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ ...
+
+ @overload
+ def update(
+ self,
+ *,
+ zone_id: str | None = None,
+ ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] | Omit = omit,
+ cf_robots_variant: Literal["off", "policy_only"] | Omit = omit,
+ crawler_protection: Literal["enabled", "disabled"] | Omit = omit,
+ enable_js: bool | Omit = omit,
+ is_robots_txt_managed: bool | Omit = omit,
+ optimize_wordpress: bool | Omit = omit,
+ sbfm_definitely_automated: Literal["allow", "block", "managed_challenge"] | Omit = omit,
+ sbfm_likely_automated: Literal["allow", "block", "managed_challenge"] | Omit = omit,
+ sbfm_static_resource_protection: bool | Omit = omit,
+ sbfm_verified_bots: Literal["allow", "block"] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> Optional[BotManagementUpdateResponse]:
+ """
+ Updates the Bot Management configuration for a zone.
+
+ This API is used to update:
+
+ - **Bot Fight Mode**
+ - **Super Bot Fight Mode**
+ - **Bot Management for Enterprise**
+
+ See [Bot Plans](https://developers.cloudflare.com/bots/plans/) for more
+ information on the different plans \\
+ If you recently upgraded or downgraded your plan, refer to the following examples
+ to clean up old configurations. Copy and paste the example body to remove old zone
+ configurations based on your current plan.
+
+ #### Clean up configuration for Bot Fight Mode plan
+
+ ```json
+ {
+ "sbfm_likely_automated": "allow",
+ "sbfm_definitely_automated": "allow",
+ "sbfm_verified_bots": "allow",
+ "sbfm_static_resource_protection": false,
+ "optimize_wordpress": false,
+ "suppress_session_score": false
+ }
+ ```
+
+ #### Clean up configuration for SBFM Pro plan
+
+ ```json
+ {
+ "sbfm_likely_automated": "allow",
+ "fight_mode": false
+ }
+ ```
+
+ #### Clean up configuration for SBFM Biz plan
+
+ ```json
+ {
+ "fight_mode": false
+ }
+ ```
+
+ #### Clean up configuration for BM Enterprise Subscription plan
+
+ It is strongly recommended that you ensure you have
+ [custom rules](https://developers.cloudflare.com/waf/custom-rules/) in place to
+ protect your zone before disabling the SBFM rules. Without these protections,
+ your zone is vulnerable to attacks.
+
+ ```json
+ {
+ "sbfm_likely_automated": "allow",
+ "sbfm_definitely_automated": "allow",
+ "sbfm_verified_bots": "allow",
+ "sbfm_static_resource_protection": false,
+ "optimize_wordpress": false,
+ "fight_mode": false
+ }
+ ```
+
+ Args:
+ zone_id: Identifier.
+
+ ai_bots_protection: Enable rule to block AI Scrapers and Crawlers. Please note the value
+ `only_on_ad_pages` is currently not available for Enterprise customers.
+
+ cf_robots_variant: Specifies the Robots Access Control License variant to use.
+
+ crawler_protection: Enable rule to punish AI Scrapers and Crawlers via a link maze.
+
+ enable_js: Use lightweight, invisible JavaScript detections to improve Bot Management.
+ [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/).
+
+ is_robots_txt_managed: Enable cloudflare managed robots.txt. If an existing robots.txt is detected,
+ then managed robots.txt will be prepended to the existing robots.txt.
+
+ optimize_wordpress: Whether to optimize Super Bot Fight Mode protections for Wordpress.
+
+ sbfm_definitely_automated: Super Bot Fight Mode (SBFM) action to take on definitely automated requests.
+
+ sbfm_likely_automated: Super Bot Fight Mode (SBFM) action to take on likely automated requests.
+
+ sbfm_static_resource_protection: Super Bot Fight Mode (SBFM) to enable static resource protection. Enable if
+ static resources on your application need bot protection. Note: Static resource
+ protection can also result in legitimate traffic being blocked.
+
+ sbfm_verified_bots: Super Bot Fight Mode (SBFM) action to take on verified bots requests.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ ...
+
+ @overload
+ def update(
+ self,
+ *,
+ zone_id: str | None = None,
+ ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] | Omit = omit,
+ auto_update_model: bool | Omit = omit,
+ bm_cookie_enabled: bool | Omit = omit,
+ cf_robots_variant: Literal["off", "policy_only"] | Omit = omit,
+ crawler_protection: Literal["enabled", "disabled"] | Omit = omit,
+ enable_js: bool | Omit = omit,
+ is_robots_txt_managed: bool | Omit = omit,
+ suppress_session_score: bool | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> Optional[BotManagementUpdateResponse]:
+ """
+ Updates the Bot Management configuration for a zone.
+
+ This API is used to update:
+
+ - **Bot Fight Mode**
+ - **Super Bot Fight Mode**
+ - **Bot Management for Enterprise**
+
+ See [Bot Plans](https://developers.cloudflare.com/bots/plans/) for more
+ information on the different plans \\
+ If you recently upgraded or downgraded your plan, refer to the following examples
+ to clean up old configurations. Copy and paste the example body to remove old zone
+ configurations based on your current plan.
+
+ #### Clean up configuration for Bot Fight Mode plan
+
+ ```json
+ {
+ "sbfm_likely_automated": "allow",
+ "sbfm_definitely_automated": "allow",
+ "sbfm_verified_bots": "allow",
+ "sbfm_static_resource_protection": false,
+ "optimize_wordpress": false,
+ "suppress_session_score": false
+ }
+ ```
+
+ #### Clean up configuration for SBFM Pro plan
+
+ ```json
+ {
+ "sbfm_likely_automated": "allow",
+ "fight_mode": false
+ }
+ ```
+
+ #### Clean up configuration for SBFM Biz plan
+
+ ```json
+ {
+ "fight_mode": false
+ }
+ ```
+
+ #### Clean up configuration for BM Enterprise Subscription plan
+
+ It is strongly recommended that you ensure you have
+ [custom rules](https://developers.cloudflare.com/waf/custom-rules/) in place to
+ protect your zone before disabling the SBFM rules. Without these protections,
+ your zone is vulnerable to attacks.
+
+ ```json
+ {
+ "sbfm_likely_automated": "allow",
+ "sbfm_definitely_automated": "allow",
+ "sbfm_verified_bots": "allow",
+ "sbfm_static_resource_protection": false,
+ "optimize_wordpress": false,
+ "fight_mode": false
+ }
+ ```
+
+ Args:
+ zone_id: Identifier.
+
+ ai_bots_protection: Enable rule to block AI Scrapers and Crawlers. Please note the value
+ `only_on_ad_pages` is currently not available for Enterprise customers.
+
+ auto_update_model: Automatically update to the newest bot detection models created by Cloudflare as
+ they are released.
+ [Learn more.](https://developers.cloudflare.com/bots/reference/machine-learning-models#model-versions-and-release-notes)
+
+ bm_cookie_enabled: Indicates that the bot management cookie can be placed on end user devices
+ accessing the site. Defaults to true
+
+ cf_robots_variant: Specifies the Robots Access Control License variant to use.
+
+ crawler_protection: Enable rule to punish AI Scrapers and Crawlers via a link maze.
+
+ enable_js: Use lightweight, invisible JavaScript detections to improve Bot Management.
+ [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/).
+
+ is_robots_txt_managed: Enable cloudflare managed robots.txt. If an existing robots.txt is detected,
+ then managed robots.txt will be prepended to the existing robots.txt.
+
+ suppress_session_score: Whether to disable tracking the highest bot score for a session in the Bot
+ Management cookie.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ ...
+
+ def update(
+ self,
+ *,
+ zone_id: str | None = None,
+ ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] | Omit = omit,
+ cf_robots_variant: Literal["off", "policy_only"] | Omit = omit,
+ crawler_protection: Literal["enabled", "disabled"] | Omit = omit,
+ enable_js: bool | Omit = omit,
+ fight_mode: bool | Omit = omit,
+ is_robots_txt_managed: bool | Omit = omit,
+ optimize_wordpress: bool | Omit = omit,
+ sbfm_definitely_automated: Literal["allow", "block", "managed_challenge"] | Omit = omit,
+ sbfm_static_resource_protection: bool | Omit = omit,
+ sbfm_verified_bots: Literal["allow", "block"] | Omit = omit,
+ sbfm_likely_automated: Literal["allow", "block", "managed_challenge"] | Omit = omit,
+ auto_update_model: bool | Omit = omit,
+ bm_cookie_enabled: bool | Omit = omit,
+ suppress_session_score: bool | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> Optional[BotManagementUpdateResponse]:
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ return cast(
+ Optional[BotManagementUpdateResponse],
+ self._put(
+ path_template("/zones/{zone_id}/bot_management", zone_id=zone_id),
+ body=maybe_transform(
+ {
+ "ai_bots_protection": ai_bots_protection,
+ "cf_robots_variant": cf_robots_variant,
+ "crawler_protection": crawler_protection,
+ "enable_js": enable_js,
+ "fight_mode": fight_mode,
+ "is_robots_txt_managed": is_robots_txt_managed,
+ "optimize_wordpress": optimize_wordpress,
+ "sbfm_definitely_automated": sbfm_definitely_automated,
+ "sbfm_static_resource_protection": sbfm_static_resource_protection,
+ "sbfm_verified_bots": sbfm_verified_bots,
+ "sbfm_likely_automated": sbfm_likely_automated,
+ "auto_update_model": auto_update_model,
+ "bm_cookie_enabled": bm_cookie_enabled,
+ "suppress_session_score": suppress_session_score,
+ },
+ bot_management_update_params.BotManagementUpdateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[Optional[BotManagementUpdateResponse]]._unwrapper,
+ ),
+ cast_to=cast(
+ Any, ResultWrapper[BotManagementUpdateResponse]
+ ), # Union types cannot be passed in as arguments in the type system
+ ),
+ )
+
+ def get(
+ self,
+ *,
+ zone_id: str | None = None,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> Optional[BotManagementGetResponse]:
+ """
+ Retrieve a zone's Bot Management Config
+
+ Args:
+ zone_id: Identifier.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ return cast(
+ Optional[BotManagementGetResponse],
+ self._get(
+ path_template("/zones/{zone_id}/bot_management", zone_id=zone_id),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[Optional[BotManagementGetResponse]]._unwrapper,
+ ),
+ cast_to=cast(
+ Any, ResultWrapper[BotManagementGetResponse]
+ ), # Union types cannot be passed in as arguments in the type system
+ ),
+ )
+
+
+class AsyncBotManagementResource(AsyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> AsyncBotManagementResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncBotManagementResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncBotManagementResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return AsyncBotManagementResourceWithStreamingResponse(self)
+
+ @overload
+ async def update(
+ self,
+ *,
+ zone_id: str | None = None,
+ ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] | Omit = omit,
+ cf_robots_variant: Literal["off", "policy_only"] | Omit = omit,
+ crawler_protection: Literal["enabled", "disabled"] | Omit = omit,
+ enable_js: bool | Omit = omit,
+ fight_mode: bool | Omit = omit,
+ is_robots_txt_managed: bool | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> Optional[BotManagementUpdateResponse]:
+ """
+ Updates the Bot Management configuration for a zone.
+
+ This API is used to update:
+
+ - **Bot Fight Mode**
+ - **Super Bot Fight Mode**
+ - **Bot Management for Enterprise**
+
+ See [Bot Plans](https://developers.cloudflare.com/bots/plans/) for more
+ information on the different plans \\
+ If you recently upgraded or downgraded your plan, refer to the following examples
+ to clean up old configurations. Copy and paste the example body to remove old zone
+ configurations based on your current plan.
+
+ #### Clean up configuration for Bot Fight Mode plan
+
+ ```json
+ {
+ "sbfm_likely_automated": "allow",
+ "sbfm_definitely_automated": "allow",
+ "sbfm_verified_bots": "allow",
+ "sbfm_static_resource_protection": false,
+ "optimize_wordpress": false,
+ "suppress_session_score": false
+ }
+ ```
+
+ #### Clean up configuration for SBFM Pro plan
+
+ ```json
+ {
+ "sbfm_likely_automated": "allow",
+ "fight_mode": false
+ }
+ ```
+
+ #### Clean up configuration for SBFM Biz plan
+
+ ```json
+ {
+ "fight_mode": false
+ }
+ ```
+
+ #### Clean up configuration for BM Enterprise Subscription plan
+
+ It is strongly recommended that you ensure you have
+ [custom rules](https://developers.cloudflare.com/waf/custom-rules/) in place to
+ protect your zone before disabling the SBFM rules. Without these protections,
+ your zone is vulnerable to attacks.
+
+ ```json
+ {
+ "sbfm_likely_automated": "allow",
+ "sbfm_definitely_automated": "allow",
+ "sbfm_verified_bots": "allow",
+ "sbfm_static_resource_protection": false,
+ "optimize_wordpress": false,
+ "fight_mode": false
+ }
+ ```
+
+ Args:
+ zone_id: Identifier.
+
+ ai_bots_protection: Enable rule to block AI Scrapers and Crawlers. Please note the value
+ `only_on_ad_pages` is currently not available for Enterprise customers.
+
+ cf_robots_variant: Specifies the Robots Access Control License variant to use.
+
+ crawler_protection: Enable rule to punish AI Scrapers and Crawlers via a link maze.
+
+ enable_js: Use lightweight, invisible JavaScript detections to improve Bot Management.
+ [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/).
+
+ fight_mode: Whether to enable Bot Fight Mode.
+
+ is_robots_txt_managed: Enable cloudflare managed robots.txt. If an existing robots.txt is detected,
+ then managed robots.txt will be prepended to the existing robots.txt.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ ...
+
+ @overload
+ async def update(
+ self,
+ *,
+ zone_id: str | None = None,
+ ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] | Omit = omit,
+ cf_robots_variant: Literal["off", "policy_only"] | Omit = omit,
+ crawler_protection: Literal["enabled", "disabled"] | Omit = omit,
+ enable_js: bool | Omit = omit,
+ is_robots_txt_managed: bool | Omit = omit,
+ optimize_wordpress: bool | Omit = omit,
+ sbfm_definitely_automated: Literal["allow", "block", "managed_challenge"] | Omit = omit,
+ sbfm_static_resource_protection: bool | Omit = omit,
+ sbfm_verified_bots: Literal["allow", "block"] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> Optional[BotManagementUpdateResponse]:
+ """
+ Updates the Bot Management configuration for a zone.
+
+ This API is used to update:
+
+ - **Bot Fight Mode**
+ - **Super Bot Fight Mode**
+ - **Bot Management for Enterprise**
+
+ See [Bot Plans](https://developers.cloudflare.com/bots/plans/) for more
+ information on the different plans \\
+ If you recently upgraded or downgraded your plan, refer to the following examples
+ to clean up old configurations. Copy and paste the example body to remove old zone
+ configurations based on your current plan.
+
+ #### Clean up configuration for Bot Fight Mode plan
+
+ ```json
+ {
+ "sbfm_likely_automated": "allow",
+ "sbfm_definitely_automated": "allow",
+ "sbfm_verified_bots": "allow",
+ "sbfm_static_resource_protection": false,
+ "optimize_wordpress": false,
+ "suppress_session_score": false
+ }
+ ```
+
+ #### Clean up configuration for SBFM Pro plan
+
+ ```json
+ {
+ "sbfm_likely_automated": "allow",
+ "fight_mode": false
+ }
+ ```
+
+ #### Clean up configuration for SBFM Biz plan
+
+ ```json
+ {
+ "fight_mode": false
+ }
+ ```
+
+ #### Clean up configuration for BM Enterprise Subscription plan
+
+ It is strongly recommended that you ensure you have
+ [custom rules](https://developers.cloudflare.com/waf/custom-rules/) in place to
+ protect your zone before disabling the SBFM rules. Without these protections,
+ your zone is vulnerable to attacks.
+
+ ```json
+ {
+ "sbfm_likely_automated": "allow",
+ "sbfm_definitely_automated": "allow",
+ "sbfm_verified_bots": "allow",
+ "sbfm_static_resource_protection": false,
+ "optimize_wordpress": false,
+ "fight_mode": false
+ }
+ ```
+
+ Args:
+ zone_id: Identifier.
+
+ ai_bots_protection: Enable rule to block AI Scrapers and Crawlers. Please note the value
+ `only_on_ad_pages` is currently not available for Enterprise customers.
+
+ cf_robots_variant: Specifies the Robots Access Control License variant to use.
+
+ crawler_protection: Enable rule to punish AI Scrapers and Crawlers via a link maze.
+
+ enable_js: Use lightweight, invisible JavaScript detections to improve Bot Management.
+ [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/).
+
+ is_robots_txt_managed: Enable cloudflare managed robots.txt. If an existing robots.txt is detected,
+ then managed robots.txt will be prepended to the existing robots.txt.
+
+ optimize_wordpress: Whether to optimize Super Bot Fight Mode protections for Wordpress.
+
+ sbfm_definitely_automated: Super Bot Fight Mode (SBFM) action to take on definitely automated requests.
+
+ sbfm_static_resource_protection: Super Bot Fight Mode (SBFM) to enable static resource protection. Enable if
+ static resources on your application need bot protection. Note: Static resource
+ protection can also result in legitimate traffic being blocked.
+
+ sbfm_verified_bots: Super Bot Fight Mode (SBFM) action to take on verified bots requests.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ ...
+
+ @overload
+ async def update(
+ self,
+ *,
+ zone_id: str | None = None,
+ ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] | Omit = omit,
+ cf_robots_variant: Literal["off", "policy_only"] | Omit = omit,
+ crawler_protection: Literal["enabled", "disabled"] | Omit = omit,
+ enable_js: bool | Omit = omit,
+ is_robots_txt_managed: bool | Omit = omit,
+ optimize_wordpress: bool | Omit = omit,
+ sbfm_definitely_automated: Literal["allow", "block", "managed_challenge"] | Omit = omit,
+ sbfm_likely_automated: Literal["allow", "block", "managed_challenge"] | Omit = omit,
+ sbfm_static_resource_protection: bool | Omit = omit,
+ sbfm_verified_bots: Literal["allow", "block"] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> Optional[BotManagementUpdateResponse]:
+ """
+ Updates the Bot Management configuration for a zone.
+
+ This API is used to update:
+
+ - **Bot Fight Mode**
+ - **Super Bot Fight Mode**
+ - **Bot Management for Enterprise**
+
+ See [Bot Plans](https://developers.cloudflare.com/bots/plans/) for more
+ information on the different plans \\
+ If you recently upgraded or downgraded your plan, refer to the following examples
+ to clean up old configurations. Copy and paste the example body to remove old zone
+ configurations based on your current plan.
+
+ #### Clean up configuration for Bot Fight Mode plan
+
+ ```json
+ {
+ "sbfm_likely_automated": "allow",
+ "sbfm_definitely_automated": "allow",
+ "sbfm_verified_bots": "allow",
+ "sbfm_static_resource_protection": false,
+ "optimize_wordpress": false,
+ "suppress_session_score": false
+ }
+ ```
+
+ #### Clean up configuration for SBFM Pro plan
+
+ ```json
+ {
+ "sbfm_likely_automated": "allow",
+ "fight_mode": false
+ }
+ ```
+
+ #### Clean up configuration for SBFM Biz plan
+
+ ```json
+ {
+ "fight_mode": false
+ }
+ ```
+
+ #### Clean up configuration for BM Enterprise Subscription plan
+
+ It is strongly recommended that you ensure you have
+ [custom rules](https://developers.cloudflare.com/waf/custom-rules/) in place to
+ protect your zone before disabling the SBFM rules. Without these protections,
+ your zone is vulnerable to attacks.
+
+ ```json
+ {
+ "sbfm_likely_automated": "allow",
+ "sbfm_definitely_automated": "allow",
+ "sbfm_verified_bots": "allow",
+ "sbfm_static_resource_protection": false,
+ "optimize_wordpress": false,
+ "fight_mode": false
+ }
+ ```
+
+ Args:
+ zone_id: Identifier.
+
+ ai_bots_protection: Enable rule to block AI Scrapers and Crawlers. Please note the value
+ `only_on_ad_pages` is currently not available for Enterprise customers.
+
+ cf_robots_variant: Specifies the Robots Access Control License variant to use.
+
+ crawler_protection: Enable rule to punish AI Scrapers and Crawlers via a link maze.
+
+ enable_js: Use lightweight, invisible JavaScript detections to improve Bot Management.
+ [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/).
+
+ is_robots_txt_managed: Enable cloudflare managed robots.txt. If an existing robots.txt is detected,
+ then managed robots.txt will be prepended to the existing robots.txt.
+
+ optimize_wordpress: Whether to optimize Super Bot Fight Mode protections for Wordpress.
+
+ sbfm_definitely_automated: Super Bot Fight Mode (SBFM) action to take on definitely automated requests.
+
+ sbfm_likely_automated: Super Bot Fight Mode (SBFM) action to take on likely automated requests.
+
+ sbfm_static_resource_protection: Super Bot Fight Mode (SBFM) to enable static resource protection. Enable if
+ static resources on your application need bot protection. Note: Static resource
+ protection can also result in legitimate traffic being blocked.
+
+ sbfm_verified_bots: Super Bot Fight Mode (SBFM) action to take on verified bots requests.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ ...
+
+ @overload
+ async def update(
+ self,
+ *,
+ zone_id: str | None = None,
+ ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] | Omit = omit,
+ auto_update_model: bool | Omit = omit,
+ bm_cookie_enabled: bool | Omit = omit,
+ cf_robots_variant: Literal["off", "policy_only"] | Omit = omit,
+ crawler_protection: Literal["enabled", "disabled"] | Omit = omit,
+ enable_js: bool | Omit = omit,
+ is_robots_txt_managed: bool | Omit = omit,
+ suppress_session_score: bool | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> Optional[BotManagementUpdateResponse]:
+ """
+ Updates the Bot Management configuration for a zone.
+
+ This API is used to update:
+
+ - **Bot Fight Mode**
+ - **Super Bot Fight Mode**
+ - **Bot Management for Enterprise**
+
+ See [Bot Plans](https://developers.cloudflare.com/bots/plans/) for more
+ information on the different plans \\
+ If you recently upgraded or downgraded your plan, refer to the following examples
+ to clean up old configurations. Copy and paste the example body to remove old zone
+ configurations based on your current plan.
+
+ #### Clean up configuration for Bot Fight Mode plan
+
+ ```json
+ {
+ "sbfm_likely_automated": "allow",
+ "sbfm_definitely_automated": "allow",
+ "sbfm_verified_bots": "allow",
+ "sbfm_static_resource_protection": false,
+ "optimize_wordpress": false,
+ "suppress_session_score": false
+ }
+ ```
+
+ #### Clean up configuration for SBFM Pro plan
+
+ ```json
+ {
+ "sbfm_likely_automated": "allow",
+ "fight_mode": false
+ }
+ ```
+
+ #### Clean up configuration for SBFM Biz plan
+
+ ```json
+ {
+ "fight_mode": false
+ }
+ ```
+
+ #### Clean up configuration for BM Enterprise Subscription plan
+
+ It is strongly recommended that you ensure you have
+ [custom rules](https://developers.cloudflare.com/waf/custom-rules/) in place to
+ protect your zone before disabling the SBFM rules. Without these protections,
+ your zone is vulnerable to attacks.
+
+ ```json
+ {
+ "sbfm_likely_automated": "allow",
+ "sbfm_definitely_automated": "allow",
+ "sbfm_verified_bots": "allow",
+ "sbfm_static_resource_protection": false,
+ "optimize_wordpress": false,
+ "fight_mode": false
+ }
+ ```
+
+ Args:
+ zone_id: Identifier.
+
+ ai_bots_protection: Enable rule to block AI Scrapers and Crawlers. Please note the value
+ `only_on_ad_pages` is currently not available for Enterprise customers.
+
+ auto_update_model: Automatically update to the newest bot detection models created by Cloudflare as
+ they are released.
+ [Learn more.](https://developers.cloudflare.com/bots/reference/machine-learning-models#model-versions-and-release-notes)
+
+ bm_cookie_enabled: Indicates that the bot management cookie can be placed on end user devices
+ accessing the site. Defaults to true
+
+ cf_robots_variant: Specifies the Robots Access Control License variant to use.
+
+ crawler_protection: Enable rule to punish AI Scrapers and Crawlers via a link maze.
+
+ enable_js: Use lightweight, invisible JavaScript detections to improve Bot Management.
+ [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/).
+
+ is_robots_txt_managed: Enable cloudflare managed robots.txt. If an existing robots.txt is detected,
+ then managed robots.txt will be prepended to the existing robots.txt.
+
+ suppress_session_score: Whether to disable tracking the highest bot score for a session in the Bot
+ Management cookie.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ ...
+
+ async def update(
+ self,
+ *,
+ zone_id: str | None = None,
+ ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] | Omit = omit,
+ cf_robots_variant: Literal["off", "policy_only"] | Omit = omit,
+ crawler_protection: Literal["enabled", "disabled"] | Omit = omit,
+ enable_js: bool | Omit = omit,
+ fight_mode: bool | Omit = omit,
+ is_robots_txt_managed: bool | Omit = omit,
+ optimize_wordpress: bool | Omit = omit,
+ sbfm_definitely_automated: Literal["allow", "block", "managed_challenge"] | Omit = omit,
+ sbfm_static_resource_protection: bool | Omit = omit,
+ sbfm_verified_bots: Literal["allow", "block"] | Omit = omit,
+ sbfm_likely_automated: Literal["allow", "block", "managed_challenge"] | Omit = omit,
+ auto_update_model: bool | Omit = omit,
+ bm_cookie_enabled: bool | Omit = omit,
+ suppress_session_score: bool | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> Optional[BotManagementUpdateResponse]:
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ return cast(
+ Optional[BotManagementUpdateResponse],
+ await self._put(
+ path_template("/zones/{zone_id}/bot_management", zone_id=zone_id),
+ body=await async_maybe_transform(
+ {
+ "ai_bots_protection": ai_bots_protection,
+ "cf_robots_variant": cf_robots_variant,
+ "crawler_protection": crawler_protection,
+ "enable_js": enable_js,
+ "fight_mode": fight_mode,
+ "is_robots_txt_managed": is_robots_txt_managed,
+ "optimize_wordpress": optimize_wordpress,
+ "sbfm_definitely_automated": sbfm_definitely_automated,
+ "sbfm_static_resource_protection": sbfm_static_resource_protection,
+ "sbfm_verified_bots": sbfm_verified_bots,
+ "sbfm_likely_automated": sbfm_likely_automated,
+ "auto_update_model": auto_update_model,
+ "bm_cookie_enabled": bm_cookie_enabled,
+ "suppress_session_score": suppress_session_score,
+ },
+ bot_management_update_params.BotManagementUpdateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[Optional[BotManagementUpdateResponse]]._unwrapper,
+ ),
+ cast_to=cast(
+ Any, ResultWrapper[BotManagementUpdateResponse]
+ ), # Union types cannot be passed in as arguments in the type system
+ ),
+ )
+
+ async def get(
+ self,
+ *,
+ zone_id: str | None = None,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> Optional[BotManagementGetResponse]:
+ """
+ Retrieve a zone's Bot Management Config
+
+ Args:
+ zone_id: Identifier.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if zone_id is None:
+ zone_id = self._client._get_zone_id_path_param()
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ return cast(
+ Optional[BotManagementGetResponse],
+ await self._get(
+ path_template("/zones/{zone_id}/bot_management", zone_id=zone_id),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[Optional[BotManagementGetResponse]]._unwrapper,
+ ),
+ cast_to=cast(
+ Any, ResultWrapper[BotManagementGetResponse]
+ ), # Union types cannot be passed in as arguments in the type system
+ ),
+ )
+
+
+class BotManagementResourceWithRawResponse:
+ def __init__(self, bot_management: BotManagementResource) -> None:
+ self._bot_management = bot_management
+
+ self.update = to_raw_response_wrapper(
+ bot_management.update,
+ )
+ self.get = to_raw_response_wrapper(
+ bot_management.get,
+ )
+
+
+class AsyncBotManagementResourceWithRawResponse:
+ def __init__(self, bot_management: AsyncBotManagementResource) -> None:
+ self._bot_management = bot_management
+
+ self.update = async_to_raw_response_wrapper(
+ bot_management.update,
+ )
+ self.get = async_to_raw_response_wrapper(
+ bot_management.get,
+ )
+
+
+class BotManagementResourceWithStreamingResponse:
+ def __init__(self, bot_management: BotManagementResource) -> None:
+ self._bot_management = bot_management
+
+ self.update = to_streamed_response_wrapper(
+ bot_management.update,
+ )
+ self.get = to_streamed_response_wrapper(
+ bot_management.get,
+ )
+
+
+class AsyncBotManagementResourceWithStreamingResponse:
+ def __init__(self, bot_management: AsyncBotManagementResource) -> None:
+ self._bot_management = bot_management
+
+ self.update = async_to_streamed_response_wrapper(
+ bot_management.update,
+ )
+ self.get = async_to_streamed_response_wrapper(
+ bot_management.get,
+ )
diff --git a/src/cloudflare/resources/botnet_feed/api.md b/src/cloudflare/resources/botnet_feed/api.md
new file mode 100644
index 00000000000..97232c05424
--- /dev/null
+++ b/src/cloudflare/resources/botnet_feed/api.md
@@ -0,0 +1,29 @@
+# BotnetFeed
+
+## ASN
+
+Types:
+
+```python
+from cloudflare.types.botnet_feed import ASNDayReportResponse, ASNFullReportResponse
+```
+
+Methods:
+
+- client.botnet_feed.asn.day_report(asn_id, \*, account_id, \*\*params) -> Optional[ASNDayReportResponse]
+- client.botnet_feed.asn.full_report(asn_id, \*, account_id) -> Optional[ASNFullReportResponse]
+
+## Configs
+
+### ASN
+
+Types:
+
+```python
+from cloudflare.types.botnet_feed.configs import ASNDeleteResponse, ASNGetResponse
+```
+
+Methods:
+
+- client.botnet_feed.configs.asn.delete(asn_id, \*, account_id) -> Optional[ASNDeleteResponse]
+- client.botnet_feed.configs.asn.get(\*, account_id) -> Optional[ASNGetResponse]
diff --git a/src/cloudflare/resources/botnet_feed/asn.py b/src/cloudflare/resources/botnet_feed/asn.py
index 285845ee622..d5f9b3a3cbf 100755
--- a/src/cloudflare/resources/botnet_feed/asn.py
+++ b/src/cloudflare/resources/botnet_feed/asn.py
@@ -8,7 +8,7 @@
import httpx
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ..._utils import maybe_transform, async_maybe_transform
+from ..._utils import path_template, maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -50,7 +50,7 @@ def day_report(
self,
asn_id: int,
*,
- account_id: str,
+ account_id: str | None = None,
date: Union[str, datetime] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -75,10 +75,14 @@ def day_report(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get(
- f"/accounts/{account_id}/botnet_feed/asn/{asn_id}/day_report",
+ path_template(
+ "/accounts/{account_id}/botnet_feed/asn/{asn_id}/day_report", account_id=account_id, asn_id=asn_id
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -94,7 +98,7 @@ def full_report(
self,
asn_id: int,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -117,10 +121,14 @@ def full_report(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get(
- f"/accounts/{account_id}/botnet_feed/asn/{asn_id}/full_report",
+ path_template(
+ "/accounts/{account_id}/botnet_feed/asn/{asn_id}/full_report", account_id=account_id, asn_id=asn_id
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -156,7 +164,7 @@ async def day_report(
self,
asn_id: int,
*,
- account_id: str,
+ account_id: str | None = None,
date: Union[str, datetime] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -181,10 +189,14 @@ async def day_report(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._get(
- f"/accounts/{account_id}/botnet_feed/asn/{asn_id}/day_report",
+ path_template(
+ "/accounts/{account_id}/botnet_feed/asn/{asn_id}/day_report", account_id=account_id, asn_id=asn_id
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -200,7 +212,7 @@ async def full_report(
self,
asn_id: int,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -223,10 +235,14 @@ async def full_report(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._get(
- f"/accounts/{account_id}/botnet_feed/asn/{asn_id}/full_report",
+ path_template(
+ "/accounts/{account_id}/botnet_feed/asn/{asn_id}/full_report", account_id=account_id, asn_id=asn_id
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/botnet_feed/configs/asn.py b/src/cloudflare/resources/botnet_feed/configs/asn.py
index e8cf0754eb4..5313cf8499c 100755
--- a/src/cloudflare/resources/botnet_feed/configs/asn.py
+++ b/src/cloudflare/resources/botnet_feed/configs/asn.py
@@ -7,6 +7,7 @@
import httpx
from ...._types import Body, Query, Headers, NotGiven, not_given
+from ...._utils import path_template
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -47,7 +48,7 @@ def delete(
self,
asn_id: int,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -69,10 +70,14 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._delete(
- f"/accounts/{account_id}/botnet_feed/configs/asn/{asn_id}",
+ path_template(
+ "/accounts/{account_id}/botnet_feed/configs/asn/{asn_id}", account_id=account_id, asn_id=asn_id
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -86,7 +91,7 @@ def delete(
def get(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -108,10 +113,12 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get(
- f"/accounts/{account_id}/botnet_feed/configs/asn",
+ path_template("/accounts/{account_id}/botnet_feed/configs/asn", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -147,7 +154,7 @@ async def delete(
self,
asn_id: int,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -169,10 +176,14 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._delete(
- f"/accounts/{account_id}/botnet_feed/configs/asn/{asn_id}",
+ path_template(
+ "/accounts/{account_id}/botnet_feed/configs/asn/{asn_id}", account_id=account_id, asn_id=asn_id
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -186,7 +197,7 @@ async def delete(
async def get(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -208,10 +219,12 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._get(
- f"/accounts/{account_id}/botnet_feed/configs/asn",
+ path_template("/accounts/{account_id}/botnet_feed/configs/asn", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/brand_protection/__init__.py b/src/cloudflare/resources/brand_protection/__init__.py
index 1660f110c9b..a27726071c4 100644
--- a/src/cloudflare/resources/brand_protection/__init__.py
+++ b/src/cloudflare/resources/brand_protection/__init__.py
@@ -1,5 +1,13 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+from .v2 import (
+ V2Resource,
+ AsyncV2Resource,
+ V2ResourceWithRawResponse,
+ AsyncV2ResourceWithRawResponse,
+ V2ResourceWithStreamingResponse,
+ AsyncV2ResourceWithStreamingResponse,
+)
from .logos import (
LogosResource,
AsyncLogosResource,
@@ -66,6 +74,12 @@
"AsyncLogoMatchesResourceWithRawResponse",
"LogoMatchesResourceWithStreamingResponse",
"AsyncLogoMatchesResourceWithStreamingResponse",
+ "V2Resource",
+ "AsyncV2Resource",
+ "V2ResourceWithRawResponse",
+ "AsyncV2ResourceWithRawResponse",
+ "V2ResourceWithStreamingResponse",
+ "AsyncV2ResourceWithStreamingResponse",
"BrandProtectionResource",
"AsyncBrandProtectionResource",
"BrandProtectionResourceWithRawResponse",
diff --git a/src/cloudflare/resources/brand_protection/api.md b/src/cloudflare/resources/brand_protection/api.md
new file mode 100644
index 00000000000..e2be15da0f0
--- /dev/null
+++ b/src/cloudflare/resources/brand_protection/api.md
@@ -0,0 +1,120 @@
+# BrandProtection
+
+Types:
+
+```python
+from cloudflare.types.brand_protection import (
+ Info,
+ Submit,
+ BrandProtectionSubmitResponse,
+ BrandProtectionURLInfoResponse,
+)
+```
+
+Methods:
+
+- client.brand_protection.submit(\*, account_id) -> BrandProtectionSubmitResponse
+- client.brand_protection.url_info(\*, account_id) -> SyncSinglePage[BrandProtectionURLInfoResponse]
+
+## Queries
+
+Methods:
+
+- client.brand_protection.queries.create(\*, account_id, \*\*params) -> None
+- client.brand_protection.queries.delete(\*, account_id, \*\*params) -> None
+- client.brand_protection.queries.bulk(\*, account_id, \*\*params) -> None
+
+## Matches
+
+Types:
+
+```python
+from cloudflare.types.brand_protection import MatchDownloadResponse, MatchGetResponse
+```
+
+Methods:
+
+- client.brand_protection.matches.download(\*, account_id, \*\*params) -> MatchDownloadResponse
+- client.brand_protection.matches.get(\*, account_id, \*\*params) -> MatchGetResponse
+
+## Logos
+
+Types:
+
+```python
+from cloudflare.types.brand_protection import LogoCreateResponse
+```
+
+Methods:
+
+- client.brand_protection.logos.create(\*, account_id, \*\*params) -> LogoCreateResponse
+- client.brand_protection.logos.delete(logo_id, \*, account_id) -> None
+
+## LogoMatches
+
+Types:
+
+```python
+from cloudflare.types.brand_protection import LogoMatchDownloadResponse, LogoMatchGetResponse
+```
+
+Methods:
+
+- client.brand_protection.logo_matches.download(\*, account_id, \*\*params) -> LogoMatchDownloadResponse
+- client.brand_protection.logo_matches.get(\*, account_id, \*\*params) -> LogoMatchGetResponse
+
+## V2
+
+### Queries
+
+Types:
+
+```python
+from cloudflare.types.brand_protection.v2 import QueryGetResponse
+```
+
+Methods:
+
+- client.brand_protection.v2.queries.get(\*, account_id, \*\*params) -> QueryGetResponse
+
+### Matches
+
+Types:
+
+```python
+from cloudflare.types.brand_protection.v2 import MatchGetResponse
+```
+
+Methods:
+
+- client.brand_protection.v2.matches.get(\*, account_id, \*\*params) -> MatchGetResponse
+
+### Logos
+
+Types:
+
+```python
+from cloudflare.types.brand_protection.v2 import (
+ LogoCreateResponse,
+ LogoDeleteResponse,
+ LogoGetResponse,
+)
+```
+
+Methods:
+
+- client.brand_protection.v2.logos.create(\*, account_id, \*\*params) -> LogoCreateResponse
+- client.brand_protection.v2.logos.delete(query_id, \*, account_id) -> LogoDeleteResponse
+- client.brand_protection.v2.logos.get(\*, account_id, \*\*params) -> LogoGetResponse
+
+### LogoMatches
+
+Types:
+
+```python
+from cloudflare.types.brand_protection.v2 import LogoMatchGetResponse
+```
+
+Methods:
+
+- client.brand_protection.v2.logo_matches.get(\*, account_id, \*\*params) -> LogoMatchGetResponse
diff --git a/src/cloudflare/resources/brand_protection/brand_protection.py b/src/cloudflare/resources/brand_protection/brand_protection.py
index efe44ec7d57..624e5d3ad79 100644
--- a/src/cloudflare/resources/brand_protection/brand_protection.py
+++ b/src/cloudflare/resources/brand_protection/brand_protection.py
@@ -12,6 +12,14 @@
LogosResourceWithStreamingResponse,
AsyncLogosResourceWithStreamingResponse,
)
+from .v2.v2 import (
+ V2Resource,
+ AsyncV2Resource,
+ V2ResourceWithRawResponse,
+ AsyncV2ResourceWithRawResponse,
+ V2ResourceWithStreamingResponse,
+ AsyncV2ResourceWithStreamingResponse,
+)
from .matches import (
MatchesResource,
AsyncMatchesResource,
@@ -29,6 +37,7 @@
AsyncQueriesResourceWithStreamingResponse,
)
from ..._types import Body, Query, Headers, NotGiven, not_given
+from ..._utils import path_template
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -70,6 +79,10 @@ def logos(self) -> LogosResource:
def logo_matches(self) -> LogoMatchesResource:
return LogoMatchesResource(self._client)
+ @cached_property
+ def v2(self) -> V2Resource:
+ return V2Resource(self._client)
+
@cached_property
def with_raw_response(self) -> BrandProtectionResourceWithRawResponse:
"""
@@ -92,7 +105,7 @@ def with_streaming_response(self) -> BrandProtectionResourceWithStreamingRespons
def submit(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -112,10 +125,12 @@ def submit(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._post(
- f"/accounts/{account_id}/brand-protection/submit",
+ path_template("/accounts/{account_id}/brand-protection/submit", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -125,7 +140,7 @@ def submit(
def url_info(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -145,10 +160,12 @@ def url_info(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/brand-protection/url-info",
+ path_template("/accounts/{account_id}/brand-protection/url-info", account_id=account_id),
page=SyncSinglePage[BrandProtectionURLInfoResponse],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -174,6 +191,10 @@ def logos(self) -> AsyncLogosResource:
def logo_matches(self) -> AsyncLogoMatchesResource:
return AsyncLogoMatchesResource(self._client)
+ @cached_property
+ def v2(self) -> AsyncV2Resource:
+ return AsyncV2Resource(self._client)
+
@cached_property
def with_raw_response(self) -> AsyncBrandProtectionResourceWithRawResponse:
"""
@@ -196,7 +217,7 @@ def with_streaming_response(self) -> AsyncBrandProtectionResourceWithStreamingRe
async def submit(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -216,10 +237,12 @@ async def submit(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._post(
- f"/accounts/{account_id}/brand-protection/submit",
+ path_template("/accounts/{account_id}/brand-protection/submit", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -229,7 +252,7 @@ async def submit(
def url_info(
self,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -249,10 +272,12 @@ def url_info(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
- f"/accounts/{account_id}/brand-protection/url-info",
+ path_template("/accounts/{account_id}/brand-protection/url-info", account_id=account_id),
page=AsyncSinglePage[BrandProtectionURLInfoResponse],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -288,6 +313,10 @@ def logos(self) -> LogosResourceWithRawResponse:
def logo_matches(self) -> LogoMatchesResourceWithRawResponse:
return LogoMatchesResourceWithRawResponse(self._brand_protection.logo_matches)
+ @cached_property
+ def v2(self) -> V2ResourceWithRawResponse:
+ return V2ResourceWithRawResponse(self._brand_protection.v2)
+
class AsyncBrandProtectionResourceWithRawResponse:
def __init__(self, brand_protection: AsyncBrandProtectionResource) -> None:
@@ -316,6 +345,10 @@ def logos(self) -> AsyncLogosResourceWithRawResponse:
def logo_matches(self) -> AsyncLogoMatchesResourceWithRawResponse:
return AsyncLogoMatchesResourceWithRawResponse(self._brand_protection.logo_matches)
+ @cached_property
+ def v2(self) -> AsyncV2ResourceWithRawResponse:
+ return AsyncV2ResourceWithRawResponse(self._brand_protection.v2)
+
class BrandProtectionResourceWithStreamingResponse:
def __init__(self, brand_protection: BrandProtectionResource) -> None:
@@ -344,6 +377,10 @@ def logos(self) -> LogosResourceWithStreamingResponse:
def logo_matches(self) -> LogoMatchesResourceWithStreamingResponse:
return LogoMatchesResourceWithStreamingResponse(self._brand_protection.logo_matches)
+ @cached_property
+ def v2(self) -> V2ResourceWithStreamingResponse:
+ return V2ResourceWithStreamingResponse(self._brand_protection.v2)
+
class AsyncBrandProtectionResourceWithStreamingResponse:
def __init__(self, brand_protection: AsyncBrandProtectionResource) -> None:
@@ -371,3 +408,7 @@ def logos(self) -> AsyncLogosResourceWithStreamingResponse:
@cached_property
def logo_matches(self) -> AsyncLogoMatchesResourceWithStreamingResponse:
return AsyncLogoMatchesResourceWithStreamingResponse(self._brand_protection.logo_matches)
+
+ @cached_property
+ def v2(self) -> AsyncV2ResourceWithStreamingResponse:
+ return AsyncV2ResourceWithStreamingResponse(self._brand_protection.v2)
diff --git a/src/cloudflare/resources/brand_protection/logo_matches.py b/src/cloudflare/resources/brand_protection/logo_matches.py
index abe100862e5..e8219c56bdd 100644
--- a/src/cloudflare/resources/brand_protection/logo_matches.py
+++ b/src/cloudflare/resources/brand_protection/logo_matches.py
@@ -5,7 +5,7 @@
import httpx
from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
-from ..._utils import maybe_transform, async_maybe_transform
+from ..._utils import path_template, maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -45,7 +45,7 @@ def with_streaming_response(self) -> LogoMatchesResourceWithStreamingResponse:
def download(
self,
*,
- account_id: str,
+ account_id: str | None = None,
limit: str | Omit = omit,
logo_id: SequenceNotStr[str] | Omit = omit,
offset: str | Omit = omit,
@@ -68,10 +68,12 @@ def download(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get(
- f"/accounts/{account_id}/brand-protection/logo-matches/download",
+ path_template("/accounts/{account_id}/brand-protection/logo-matches/download", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -92,7 +94,7 @@ def download(
def get(
self,
*,
- account_id: str,
+ account_id: str | None = None,
limit: str | Omit = omit,
logo_id: SequenceNotStr[str] | Omit = omit,
offset: str | Omit = omit,
@@ -115,10 +117,12 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get(
- f"/accounts/{account_id}/brand-protection/logo-matches",
+ path_template("/accounts/{account_id}/brand-protection/logo-matches", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -160,7 +164,7 @@ def with_streaming_response(self) -> AsyncLogoMatchesResourceWithStreamingRespon
async def download(
self,
*,
- account_id: str,
+ account_id: str | None = None,
limit: str | Omit = omit,
logo_id: SequenceNotStr[str] | Omit = omit,
offset: str | Omit = omit,
@@ -183,10 +187,12 @@ async def download(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._get(
- f"/accounts/{account_id}/brand-protection/logo-matches/download",
+ path_template("/accounts/{account_id}/brand-protection/logo-matches/download", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -207,7 +213,7 @@ async def download(
async def get(
self,
*,
- account_id: str,
+ account_id: str | None = None,
limit: str | Omit = omit,
logo_id: SequenceNotStr[str] | Omit = omit,
offset: str | Omit = omit,
@@ -230,10 +236,12 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._get(
- f"/accounts/{account_id}/brand-protection/logo-matches",
+ path_template("/accounts/{account_id}/brand-protection/logo-matches", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/brand_protection/logos.py b/src/cloudflare/resources/brand_protection/logos.py
index fb55402f7e7..a432d1e0fc3 100644
--- a/src/cloudflare/resources/brand_protection/logos.py
+++ b/src/cloudflare/resources/brand_protection/logos.py
@@ -5,7 +5,7 @@
import httpx
from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, FileTypes, omit, not_given
-from ..._utils import maybe_transform, async_maybe_transform
+from ..._utils import path_template, maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -44,7 +44,7 @@ def with_streaming_response(self) -> LogosResourceWithStreamingResponse:
def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
match_type: str | Omit = omit,
tag: str | Omit = omit,
threshold: float | Omit = omit,
@@ -68,10 +68,12 @@ def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._post(
- f"/accounts/{account_id}/brand-protection/logos",
+ path_template("/accounts/{account_id}/brand-protection/logos", account_id=account_id),
body=maybe_transform({"image": image}, logo_create_params.LogoCreateParams),
options=make_request_options(
extra_headers=extra_headers,
@@ -94,7 +96,7 @@ def delete(
self,
logo_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -114,13 +116,17 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not logo_id:
raise ValueError(f"Expected a non-empty value for `logo_id` but received {logo_id!r}")
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
return self._delete(
- f"/accounts/{account_id}/brand-protection/logos/{logo_id}",
+ path_template(
+ "/accounts/{account_id}/brand-protection/logos/{logo_id}", account_id=account_id, logo_id=logo_id
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -151,7 +157,7 @@ def with_streaming_response(self) -> AsyncLogosResourceWithStreamingResponse:
async def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
match_type: str | Omit = omit,
tag: str | Omit = omit,
threshold: float | Omit = omit,
@@ -175,10 +181,12 @@ async def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._post(
- f"/accounts/{account_id}/brand-protection/logos",
+ path_template("/accounts/{account_id}/brand-protection/logos", account_id=account_id),
body=await async_maybe_transform({"image": image}, logo_create_params.LogoCreateParams),
options=make_request_options(
extra_headers=extra_headers,
@@ -201,7 +209,7 @@ async def delete(
self,
logo_id: str,
*,
- account_id: str,
+ account_id: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -221,13 +229,17 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not logo_id:
raise ValueError(f"Expected a non-empty value for `logo_id` but received {logo_id!r}")
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
return await self._delete(
- f"/accounts/{account_id}/brand-protection/logos/{logo_id}",
+ path_template(
+ "/accounts/{account_id}/brand-protection/logos/{logo_id}", account_id=account_id, logo_id=logo_id
+ ),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
diff --git a/src/cloudflare/resources/brand_protection/matches.py b/src/cloudflare/resources/brand_protection/matches.py
index cf18f113e32..2ab27a7022f 100644
--- a/src/cloudflare/resources/brand_protection/matches.py
+++ b/src/cloudflare/resources/brand_protection/matches.py
@@ -5,7 +5,7 @@
import httpx
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ..._utils import maybe_transform, async_maybe_transform
+from ..._utils import path_template, maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -45,7 +45,7 @@ def with_streaming_response(self) -> MatchesResourceWithStreamingResponse:
def download(
self,
*,
- account_id: str,
+ account_id: str | None = None,
id: str | Omit = omit,
include_domain_id: bool | Omit = omit,
limit: int | Omit = omit,
@@ -69,10 +69,12 @@ def download(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get(
- f"/accounts/{account_id}/brand-protection/matches/download",
+ path_template("/accounts/{account_id}/brand-protection/matches/download", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -94,7 +96,7 @@ def download(
def get(
self,
*,
- account_id: str,
+ account_id: str | None = None,
id: str | Omit = omit,
include_domain_id: bool | Omit = omit,
limit: int | Omit = omit,
@@ -118,10 +120,12 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get(
- f"/accounts/{account_id}/brand-protection/matches",
+ path_template("/accounts/{account_id}/brand-protection/matches", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -164,7 +168,7 @@ def with_streaming_response(self) -> AsyncMatchesResourceWithStreamingResponse:
async def download(
self,
*,
- account_id: str,
+ account_id: str | None = None,
id: str | Omit = omit,
include_domain_id: bool | Omit = omit,
limit: int | Omit = omit,
@@ -188,10 +192,12 @@ async def download(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._get(
- f"/accounts/{account_id}/brand-protection/matches/download",
+ path_template("/accounts/{account_id}/brand-protection/matches/download", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -213,7 +219,7 @@ async def download(
async def get(
self,
*,
- account_id: str,
+ account_id: str | None = None,
id: str | Omit = omit,
include_domain_id: bool | Omit = omit,
limit: int | Omit = omit,
@@ -237,10 +243,12 @@ async def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._get(
- f"/accounts/{account_id}/brand-protection/matches",
+ path_template("/accounts/{account_id}/brand-protection/matches", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/brand_protection/queries.py b/src/cloudflare/resources/brand_protection/queries.py
index 4b7ead75a1c..6d1cbab77d1 100644
--- a/src/cloudflare/resources/brand_protection/queries.py
+++ b/src/cloudflare/resources/brand_protection/queries.py
@@ -8,7 +8,7 @@
import httpx
from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given
-from ..._utils import maybe_transform, async_maybe_transform
+from ..._utils import path_template, maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -46,7 +46,7 @@ def with_streaming_response(self) -> QueriesResourceWithStreamingResponse:
def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
id: str | Omit = omit,
query_scan: bool | Omit = omit,
query_tag: str | Omit = omit,
@@ -74,11 +74,13 @@ def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
return self._post(
- f"/accounts/{account_id}/brand-protection/queries",
+ path_template("/accounts/{account_id}/brand-protection/queries", account_id=account_id),
body=maybe_transform(
{
"max_time": max_time,
@@ -109,7 +111,7 @@ def create(
def delete(
self,
*,
- account_id: str,
+ account_id: str | None = None,
id: str | Omit = omit,
scan: bool | Omit = omit,
tag: str | Omit = omit,
@@ -132,11 +134,13 @@ def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
return self._delete(
- f"/accounts/{account_id}/brand-protection/queries",
+ path_template("/accounts/{account_id}/brand-protection/queries", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -157,7 +161,7 @@ def delete(
def bulk(
self,
*,
- account_id: str,
+ account_id: str | None = None,
queries: Iterable[Dict[str, object]] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -178,11 +182,13 @@ def bulk(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
return self._post(
- f"/accounts/{account_id}/brand-protection/queries/bulk",
+ path_template("/accounts/{account_id}/brand-protection/queries/bulk", account_id=account_id),
body=maybe_transform({"queries": queries}, query_bulk_params.QueryBulkParams),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -214,7 +220,7 @@ def with_streaming_response(self) -> AsyncQueriesResourceWithStreamingResponse:
async def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
id: str | Omit = omit,
query_scan: bool | Omit = omit,
query_tag: str | Omit = omit,
@@ -242,11 +248,13 @@ async def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
return await self._post(
- f"/accounts/{account_id}/brand-protection/queries",
+ path_template("/accounts/{account_id}/brand-protection/queries", account_id=account_id),
body=await async_maybe_transform(
{
"max_time": max_time,
@@ -277,7 +285,7 @@ async def create(
async def delete(
self,
*,
- account_id: str,
+ account_id: str | None = None,
id: str | Omit = omit,
scan: bool | Omit = omit,
tag: str | Omit = omit,
@@ -300,11 +308,13 @@ async def delete(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
return await self._delete(
- f"/accounts/{account_id}/brand-protection/queries",
+ path_template("/accounts/{account_id}/brand-protection/queries", account_id=account_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -325,7 +335,7 @@ async def delete(
async def bulk(
self,
*,
- account_id: str,
+ account_id: str | None = None,
queries: Iterable[Dict[str, object]] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -346,11 +356,13 @@ async def bulk(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
return await self._post(
- f"/accounts/{account_id}/brand-protection/queries/bulk",
+ path_template("/accounts/{account_id}/brand-protection/queries/bulk", account_id=account_id),
body=await async_maybe_transform({"queries": queries}, query_bulk_params.QueryBulkParams),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
diff --git a/src/cloudflare/resources/brand_protection/v2/__init__.py b/src/cloudflare/resources/brand_protection/v2/__init__.py
new file mode 100644
index 00000000000..30145cd1f36
--- /dev/null
+++ b/src/cloudflare/resources/brand_protection/v2/__init__.py
@@ -0,0 +1,75 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from .v2 import (
+ V2Resource,
+ AsyncV2Resource,
+ V2ResourceWithRawResponse,
+ AsyncV2ResourceWithRawResponse,
+ V2ResourceWithStreamingResponse,
+ AsyncV2ResourceWithStreamingResponse,
+)
+from .logos import (
+ LogosResource,
+ AsyncLogosResource,
+ LogosResourceWithRawResponse,
+ AsyncLogosResourceWithRawResponse,
+ LogosResourceWithStreamingResponse,
+ AsyncLogosResourceWithStreamingResponse,
+)
+from .matches import (
+ MatchesResource,
+ AsyncMatchesResource,
+ MatchesResourceWithRawResponse,
+ AsyncMatchesResourceWithRawResponse,
+ MatchesResourceWithStreamingResponse,
+ AsyncMatchesResourceWithStreamingResponse,
+)
+from .queries import (
+ QueriesResource,
+ AsyncQueriesResource,
+ QueriesResourceWithRawResponse,
+ AsyncQueriesResourceWithRawResponse,
+ QueriesResourceWithStreamingResponse,
+ AsyncQueriesResourceWithStreamingResponse,
+)
+from .logo_matches import (
+ LogoMatchesResource,
+ AsyncLogoMatchesResource,
+ LogoMatchesResourceWithRawResponse,
+ AsyncLogoMatchesResourceWithRawResponse,
+ LogoMatchesResourceWithStreamingResponse,
+ AsyncLogoMatchesResourceWithStreamingResponse,
+)
+
+__all__ = [
+ "QueriesResource",
+ "AsyncQueriesResource",
+ "QueriesResourceWithRawResponse",
+ "AsyncQueriesResourceWithRawResponse",
+ "QueriesResourceWithStreamingResponse",
+ "AsyncQueriesResourceWithStreamingResponse",
+ "MatchesResource",
+ "AsyncMatchesResource",
+ "MatchesResourceWithRawResponse",
+ "AsyncMatchesResourceWithRawResponse",
+ "MatchesResourceWithStreamingResponse",
+ "AsyncMatchesResourceWithStreamingResponse",
+ "LogosResource",
+ "AsyncLogosResource",
+ "LogosResourceWithRawResponse",
+ "AsyncLogosResourceWithRawResponse",
+ "LogosResourceWithStreamingResponse",
+ "AsyncLogosResourceWithStreamingResponse",
+ "LogoMatchesResource",
+ "AsyncLogoMatchesResource",
+ "LogoMatchesResourceWithRawResponse",
+ "AsyncLogoMatchesResourceWithRawResponse",
+ "LogoMatchesResourceWithStreamingResponse",
+ "AsyncLogoMatchesResourceWithStreamingResponse",
+ "V2Resource",
+ "AsyncV2Resource",
+ "V2ResourceWithRawResponse",
+ "AsyncV2ResourceWithRawResponse",
+ "V2ResourceWithStreamingResponse",
+ "AsyncV2ResourceWithStreamingResponse",
+]
diff --git a/src/cloudflare/resources/brand_protection/v2/logo_matches.py b/src/cloudflare/resources/brand_protection/v2/logo_matches.py
new file mode 100644
index 00000000000..ae58cf9010e
--- /dev/null
+++ b/src/cloudflare/resources/brand_protection/v2/logo_matches.py
@@ -0,0 +1,225 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing_extensions import Literal
+
+import httpx
+
+from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
+from ...._utils import path_template, maybe_transform, async_maybe_transform
+from ...._compat import cached_property
+from ...._resource import SyncAPIResource, AsyncAPIResource
+from ...._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from ...._base_client import make_request_options
+from ....types.brand_protection.v2 import logo_match_get_params
+from ....types.brand_protection.v2.logo_match_get_response import LogoMatchGetResponse
+
+__all__ = ["LogoMatchesResource", "AsyncLogoMatchesResource"]
+
+
+class LogoMatchesResource(SyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> LogoMatchesResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return LogoMatchesResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> LogoMatchesResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return LogoMatchesResourceWithStreamingResponse(self)
+
+ def get(
+ self,
+ *,
+ account_id: str | None = None,
+ query_id: str,
+ download: str | Omit = omit,
+ limit: str | Omit = omit,
+ offset: str | Omit = omit,
+ order: Literal["asc", "desc"] | Omit = omit,
+ order_by: Literal["matchedAt", "domain", "similarityScore", "registrar"] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> LogoMatchGetResponse:
+ """
+ Get paginated list of logo matches for a specific brand protection logo query
+
+ Args:
+ order: Sort order. Options: 'asc' (ascending) or 'desc' (descending)
+
+ order_by: Column to sort by. Options: 'matchedAt', 'domain', 'similarityScore', or
+ 'registrar'
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ return self._get(
+ path_template(
+ "/accounts/{account_id}/cloudforce-one/v2/brand-protection/logo/matches", account_id=account_id
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "query_id": query_id,
+ "download": download,
+ "limit": limit,
+ "offset": offset,
+ "order": order,
+ "order_by": order_by,
+ },
+ logo_match_get_params.LogoMatchGetParams,
+ ),
+ ),
+ cast_to=LogoMatchGetResponse,
+ )
+
+
+class AsyncLogoMatchesResource(AsyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> AsyncLogoMatchesResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncLogoMatchesResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncLogoMatchesResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return AsyncLogoMatchesResourceWithStreamingResponse(self)
+
+ async def get(
+ self,
+ *,
+ account_id: str | None = None,
+ query_id: str,
+ download: str | Omit = omit,
+ limit: str | Omit = omit,
+ offset: str | Omit = omit,
+ order: Literal["asc", "desc"] | Omit = omit,
+ order_by: Literal["matchedAt", "domain", "similarityScore", "registrar"] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> LogoMatchGetResponse:
+ """
+ Get paginated list of logo matches for a specific brand protection logo query
+
+ Args:
+ order: Sort order. Options: 'asc' (ascending) or 'desc' (descending)
+
+ order_by: Column to sort by. Options: 'matchedAt', 'domain', 'similarityScore', or
+ 'registrar'
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ return await self._get(
+ path_template(
+ "/accounts/{account_id}/cloudforce-one/v2/brand-protection/logo/matches", account_id=account_id
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=await async_maybe_transform(
+ {
+ "query_id": query_id,
+ "download": download,
+ "limit": limit,
+ "offset": offset,
+ "order": order,
+ "order_by": order_by,
+ },
+ logo_match_get_params.LogoMatchGetParams,
+ ),
+ ),
+ cast_to=LogoMatchGetResponse,
+ )
+
+
+class LogoMatchesResourceWithRawResponse:
+ def __init__(self, logo_matches: LogoMatchesResource) -> None:
+ self._logo_matches = logo_matches
+
+ self.get = to_raw_response_wrapper(
+ logo_matches.get,
+ )
+
+
+class AsyncLogoMatchesResourceWithRawResponse:
+ def __init__(self, logo_matches: AsyncLogoMatchesResource) -> None:
+ self._logo_matches = logo_matches
+
+ self.get = async_to_raw_response_wrapper(
+ logo_matches.get,
+ )
+
+
+class LogoMatchesResourceWithStreamingResponse:
+ def __init__(self, logo_matches: LogoMatchesResource) -> None:
+ self._logo_matches = logo_matches
+
+ self.get = to_streamed_response_wrapper(
+ logo_matches.get,
+ )
+
+
+class AsyncLogoMatchesResourceWithStreamingResponse:
+ def __init__(self, logo_matches: AsyncLogoMatchesResource) -> None:
+ self._logo_matches = logo_matches
+
+ self.get = async_to_streamed_response_wrapper(
+ logo_matches.get,
+ )
diff --git a/src/cloudflare/resources/brand_protection/v2/logos.py b/src/cloudflare/resources/brand_protection/v2/logos.py
new file mode 100644
index 00000000000..2472996be7e
--- /dev/null
+++ b/src/cloudflare/resources/brand_protection/v2/logos.py
@@ -0,0 +1,445 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+import httpx
+
+from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
+from ...._utils import path_template, maybe_transform, async_maybe_transform
+from ...._compat import cached_property
+from ...._resource import SyncAPIResource, AsyncAPIResource
+from ...._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from ...._base_client import make_request_options
+from ....types.brand_protection.v2 import logo_get_params, logo_create_params
+from ....types.brand_protection.v2.logo_get_response import LogoGetResponse
+from ....types.brand_protection.v2.logo_create_response import LogoCreateResponse
+from ....types.brand_protection.v2.logo_delete_response import LogoDeleteResponse
+
+__all__ = ["LogosResource", "AsyncLogosResource"]
+
+
+class LogosResource(SyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> LogosResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return LogosResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> LogosResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return LogosResourceWithStreamingResponse(self)
+
+ def create(
+ self,
+ *,
+ account_id: str | None = None,
+ image_data: str,
+ similarity_threshold: float,
+ tag: str,
+ search_lookback: bool | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> LogoCreateResponse:
+ """
+ Create a new saved brand protection logo query for visual similarity matching
+
+ Args:
+ image_data: Base64 encoded image data. Can include data URI prefix (e.g.,
+ 'data:image/png;base64,...') or just the base64 string.
+
+ similarity_threshold: Minimum similarity score (0-1) required for visual matches
+
+ tag: Unique identifier for the logo query
+
+ search_lookback: If true, search historic scanned images for matches above the similarity
+ threshold
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ return self._post(
+ path_template(
+ "/accounts/{account_id}/cloudforce-one/v2/brand-protection/logo/queries", account_id=account_id
+ ),
+ body=maybe_transform(
+ {
+ "image_data": image_data,
+ "similarity_threshold": similarity_threshold,
+ "tag": tag,
+ "search_lookback": search_lookback,
+ },
+ logo_create_params.LogoCreateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=LogoCreateResponse,
+ )
+
+ def delete(
+ self,
+ query_id: str,
+ *,
+ account_id: str | None = None,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> LogoDeleteResponse:
+ """Delete a saved brand protection logo query.
+
+ Returns 404 if the query ID doesn't
+ exist.
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not query_id:
+ raise ValueError(f"Expected a non-empty value for `query_id` but received {query_id!r}")
+ return self._delete(
+ path_template(
+ "/accounts/{account_id}/cloudforce-one/v2/brand-protection/logo/queries/{query_id}",
+ account_id=account_id,
+ query_id=query_id,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=LogoDeleteResponse,
+ )
+
+ def get(
+ self,
+ *,
+ account_id: str | None = None,
+ id: str | Omit = omit,
+ download: str | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> LogoGetResponse:
+ """Get all saved brand protection logo queries for an account.
+
+ Optionally specify
+ id to get a single query. Set download=true to include base64-encoded image
+ data.
+
+ Args:
+ id: Optional query ID to retrieve a specific logo query
+
+ download: If true, include base64-encoded image data in the response
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ return self._get(
+ path_template(
+ "/accounts/{account_id}/cloudforce-one/v2/brand-protection/logo/queries", account_id=account_id
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "id": id,
+ "download": download,
+ },
+ logo_get_params.LogoGetParams,
+ ),
+ ),
+ cast_to=LogoGetResponse,
+ )
+
+
+class AsyncLogosResource(AsyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> AsyncLogosResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncLogosResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncLogosResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return AsyncLogosResourceWithStreamingResponse(self)
+
+ async def create(
+ self,
+ *,
+ account_id: str | None = None,
+ image_data: str,
+ similarity_threshold: float,
+ tag: str,
+ search_lookback: bool | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> LogoCreateResponse:
+ """
+ Create a new saved brand protection logo query for visual similarity matching
+
+ Args:
+ image_data: Base64 encoded image data. Can include data URI prefix (e.g.,
+ 'data:image/png;base64,...') or just the base64 string.
+
+ similarity_threshold: Minimum similarity score (0-1) required for visual matches
+
+ tag: Unique identifier for the logo query
+
+ search_lookback: If true, search historic scanned images for matches above the similarity
+ threshold
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ return await self._post(
+ path_template(
+ "/accounts/{account_id}/cloudforce-one/v2/brand-protection/logo/queries", account_id=account_id
+ ),
+ body=await async_maybe_transform(
+ {
+ "image_data": image_data,
+ "similarity_threshold": similarity_threshold,
+ "tag": tag,
+ "search_lookback": search_lookback,
+ },
+ logo_create_params.LogoCreateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=LogoCreateResponse,
+ )
+
+ async def delete(
+ self,
+ query_id: str,
+ *,
+ account_id: str | None = None,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> LogoDeleteResponse:
+ """Delete a saved brand protection logo query.
+
+ Returns 404 if the query ID doesn't
+ exist.
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not query_id:
+ raise ValueError(f"Expected a non-empty value for `query_id` but received {query_id!r}")
+ return await self._delete(
+ path_template(
+ "/accounts/{account_id}/cloudforce-one/v2/brand-protection/logo/queries/{query_id}",
+ account_id=account_id,
+ query_id=query_id,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=LogoDeleteResponse,
+ )
+
+ async def get(
+ self,
+ *,
+ account_id: str | None = None,
+ id: str | Omit = omit,
+ download: str | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> LogoGetResponse:
+ """Get all saved brand protection logo queries for an account.
+
+ Optionally specify
+ id to get a single query. Set download=true to include base64-encoded image
+ data.
+
+ Args:
+ id: Optional query ID to retrieve a specific logo query
+
+ download: If true, include base64-encoded image data in the response
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ return await self._get(
+ path_template(
+ "/accounts/{account_id}/cloudforce-one/v2/brand-protection/logo/queries", account_id=account_id
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=await async_maybe_transform(
+ {
+ "id": id,
+ "download": download,
+ },
+ logo_get_params.LogoGetParams,
+ ),
+ ),
+ cast_to=LogoGetResponse,
+ )
+
+
+class LogosResourceWithRawResponse:
+ def __init__(self, logos: LogosResource) -> None:
+ self._logos = logos
+
+ self.create = to_raw_response_wrapper(
+ logos.create,
+ )
+ self.delete = to_raw_response_wrapper(
+ logos.delete,
+ )
+ self.get = to_raw_response_wrapper(
+ logos.get,
+ )
+
+
+class AsyncLogosResourceWithRawResponse:
+ def __init__(self, logos: AsyncLogosResource) -> None:
+ self._logos = logos
+
+ self.create = async_to_raw_response_wrapper(
+ logos.create,
+ )
+ self.delete = async_to_raw_response_wrapper(
+ logos.delete,
+ )
+ self.get = async_to_raw_response_wrapper(
+ logos.get,
+ )
+
+
+class LogosResourceWithStreamingResponse:
+ def __init__(self, logos: LogosResource) -> None:
+ self._logos = logos
+
+ self.create = to_streamed_response_wrapper(
+ logos.create,
+ )
+ self.delete = to_streamed_response_wrapper(
+ logos.delete,
+ )
+ self.get = to_streamed_response_wrapper(
+ logos.get,
+ )
+
+
+class AsyncLogosResourceWithStreamingResponse:
+ def __init__(self, logos: AsyncLogosResource) -> None:
+ self._logos = logos
+
+ self.create = async_to_streamed_response_wrapper(
+ logos.create,
+ )
+ self.delete = async_to_streamed_response_wrapper(
+ logos.delete,
+ )
+ self.get = async_to_streamed_response_wrapper(
+ logos.get,
+ )
diff --git a/src/cloudflare/resources/brand_protection/v2/matches.py b/src/cloudflare/resources/brand_protection/v2/matches.py
new file mode 100644
index 00000000000..aecd7fca0f9
--- /dev/null
+++ b/src/cloudflare/resources/brand_protection/v2/matches.py
@@ -0,0 +1,247 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing_extensions import Literal
+
+import httpx
+
+from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
+from ...._utils import path_template, maybe_transform, async_maybe_transform
+from ...._compat import cached_property
+from ...._resource import SyncAPIResource, AsyncAPIResource
+from ...._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from ...._base_client import make_request_options
+from ....types.brand_protection.v2 import match_get_params
+from ....types.brand_protection.v2.match_get_response import MatchGetResponse
+
+__all__ = ["MatchesResource", "AsyncMatchesResource"]
+
+
+class MatchesResource(SyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> MatchesResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return MatchesResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> MatchesResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return MatchesResourceWithStreamingResponse(self)
+
+ def get(
+ self,
+ *,
+ account_id: str | None = None,
+ query_id: SequenceNotStr[str],
+ domain_search: str | Omit = omit,
+ include_dismissed: str | Omit = omit,
+ include_domain_id: str | Omit = omit,
+ limit: str | Omit = omit,
+ offset: str | Omit = omit,
+ order: Literal["asc", "desc"] | Omit = omit,
+ order_by: Literal["domain", "first_seen", "registrar"] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> MatchGetResponse:
+ """
+ Get paginated list of domain matches for one or more brand protection queries.
+ When multiple query_ids are provided (comma-separated), matches are deduplicated
+ across queries and each match includes a matched_queries array.
+
+ Args:
+ query_id: Query ID or comma-separated list of Query IDs. When multiple IDs are provided,
+ matches are deduplicated across queries and each match includes matched_queries
+ and match_ids arrays.
+
+ domain_search: Filter matches by domain name (substring match)
+
+ order: Sort order. Options: 'asc' (ascending) or 'desc' (descending)
+
+ order_by: Column to sort by. Options: 'domain', 'first_seen', or 'registrar'
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ return self._get(
+ path_template(
+ "/accounts/{account_id}/cloudforce-one/v2/brand-protection/domain/matches", account_id=account_id
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "query_id": query_id,
+ "domain_search": domain_search,
+ "include_dismissed": include_dismissed,
+ "include_domain_id": include_domain_id,
+ "limit": limit,
+ "offset": offset,
+ "order": order,
+ "order_by": order_by,
+ },
+ match_get_params.MatchGetParams,
+ ),
+ ),
+ cast_to=MatchGetResponse,
+ )
+
+
+class AsyncMatchesResource(AsyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> AsyncMatchesResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncMatchesResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncMatchesResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return AsyncMatchesResourceWithStreamingResponse(self)
+
+ async def get(
+ self,
+ *,
+ account_id: str | None = None,
+ query_id: SequenceNotStr[str],
+ domain_search: str | Omit = omit,
+ include_dismissed: str | Omit = omit,
+ include_domain_id: str | Omit = omit,
+ limit: str | Omit = omit,
+ offset: str | Omit = omit,
+ order: Literal["asc", "desc"] | Omit = omit,
+ order_by: Literal["domain", "first_seen", "registrar"] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> MatchGetResponse:
+ """
+ Get paginated list of domain matches for one or more brand protection queries.
+ When multiple query_ids are provided (comma-separated), matches are deduplicated
+ across queries and each match includes a matched_queries array.
+
+ Args:
+ query_id: Query ID or comma-separated list of Query IDs. When multiple IDs are provided,
+ matches are deduplicated across queries and each match includes matched_queries
+ and match_ids arrays.
+
+ domain_search: Filter matches by domain name (substring match)
+
+ order: Sort order. Options: 'asc' (ascending) or 'desc' (descending)
+
+ order_by: Column to sort by. Options: 'domain', 'first_seen', or 'registrar'
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ return await self._get(
+ path_template(
+ "/accounts/{account_id}/cloudforce-one/v2/brand-protection/domain/matches", account_id=account_id
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=await async_maybe_transform(
+ {
+ "query_id": query_id,
+ "domain_search": domain_search,
+ "include_dismissed": include_dismissed,
+ "include_domain_id": include_domain_id,
+ "limit": limit,
+ "offset": offset,
+ "order": order,
+ "order_by": order_by,
+ },
+ match_get_params.MatchGetParams,
+ ),
+ ),
+ cast_to=MatchGetResponse,
+ )
+
+
+class MatchesResourceWithRawResponse:
+ def __init__(self, matches: MatchesResource) -> None:
+ self._matches = matches
+
+ self.get = to_raw_response_wrapper(
+ matches.get,
+ )
+
+
+class AsyncMatchesResourceWithRawResponse:
+ def __init__(self, matches: AsyncMatchesResource) -> None:
+ self._matches = matches
+
+ self.get = async_to_raw_response_wrapper(
+ matches.get,
+ )
+
+
+class MatchesResourceWithStreamingResponse:
+ def __init__(self, matches: MatchesResource) -> None:
+ self._matches = matches
+
+ self.get = to_streamed_response_wrapper(
+ matches.get,
+ )
+
+
+class AsyncMatchesResourceWithStreamingResponse:
+ def __init__(self, matches: AsyncMatchesResource) -> None:
+ self._matches = matches
+
+ self.get = async_to_streamed_response_wrapper(
+ matches.get,
+ )
diff --git a/src/cloudflare/resources/brand_protection/v2/queries.py b/src/cloudflare/resources/brand_protection/v2/queries.py
new file mode 100644
index 00000000000..78c84a29b3b
--- /dev/null
+++ b/src/cloudflare/resources/brand_protection/v2/queries.py
@@ -0,0 +1,183 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+import httpx
+
+from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
+from ...._utils import path_template, maybe_transform, async_maybe_transform
+from ...._compat import cached_property
+from ...._resource import SyncAPIResource, AsyncAPIResource
+from ...._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from ...._base_client import make_request_options
+from ....types.brand_protection.v2 import query_get_params
+from ....types.brand_protection.v2.query_get_response import QueryGetResponse
+
+__all__ = ["QueriesResource", "AsyncQueriesResource"]
+
+
+class QueriesResource(SyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> QueriesResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return QueriesResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> QueriesResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return QueriesResourceWithStreamingResponse(self)
+
+ def get(
+ self,
+ *,
+ account_id: str | None = None,
+ id: str | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> QueryGetResponse:
+ """
+ Get all saved brand protection queries for an account
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ return self._get(
+ path_template(
+ "/accounts/{account_id}/cloudforce-one/v2/brand-protection/domain/queries", account_id=account_id
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform({"id": id}, query_get_params.QueryGetParams),
+ ),
+ cast_to=QueryGetResponse,
+ )
+
+
+class AsyncQueriesResource(AsyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> AsyncQueriesResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncQueriesResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncQueriesResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return AsyncQueriesResourceWithStreamingResponse(self)
+
+ async def get(
+ self,
+ *,
+ account_id: str | None = None,
+ id: str | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> QueryGetResponse:
+ """
+ Get all saved brand protection queries for an account
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ return await self._get(
+ path_template(
+ "/accounts/{account_id}/cloudforce-one/v2/brand-protection/domain/queries", account_id=account_id
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=await async_maybe_transform({"id": id}, query_get_params.QueryGetParams),
+ ),
+ cast_to=QueryGetResponse,
+ )
+
+
+class QueriesResourceWithRawResponse:
+ def __init__(self, queries: QueriesResource) -> None:
+ self._queries = queries
+
+ self.get = to_raw_response_wrapper(
+ queries.get,
+ )
+
+
+class AsyncQueriesResourceWithRawResponse:
+ def __init__(self, queries: AsyncQueriesResource) -> None:
+ self._queries = queries
+
+ self.get = async_to_raw_response_wrapper(
+ queries.get,
+ )
+
+
+class QueriesResourceWithStreamingResponse:
+ def __init__(self, queries: QueriesResource) -> None:
+ self._queries = queries
+
+ self.get = to_streamed_response_wrapper(
+ queries.get,
+ )
+
+
+class AsyncQueriesResourceWithStreamingResponse:
+ def __init__(self, queries: AsyncQueriesResource) -> None:
+ self._queries = queries
+
+ self.get = async_to_streamed_response_wrapper(
+ queries.get,
+ )
diff --git a/src/cloudflare/resources/brand_protection/v2/v2.py b/src/cloudflare/resources/brand_protection/v2/v2.py
new file mode 100644
index 00000000000..0045a6cd48b
--- /dev/null
+++ b/src/cloudflare/resources/brand_protection/v2/v2.py
@@ -0,0 +1,198 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from .logos import (
+ LogosResource,
+ AsyncLogosResource,
+ LogosResourceWithRawResponse,
+ AsyncLogosResourceWithRawResponse,
+ LogosResourceWithStreamingResponse,
+ AsyncLogosResourceWithStreamingResponse,
+)
+from .matches import (
+ MatchesResource,
+ AsyncMatchesResource,
+ MatchesResourceWithRawResponse,
+ AsyncMatchesResourceWithRawResponse,
+ MatchesResourceWithStreamingResponse,
+ AsyncMatchesResourceWithStreamingResponse,
+)
+from .queries import (
+ QueriesResource,
+ AsyncQueriesResource,
+ QueriesResourceWithRawResponse,
+ AsyncQueriesResourceWithRawResponse,
+ QueriesResourceWithStreamingResponse,
+ AsyncQueriesResourceWithStreamingResponse,
+)
+from ...._compat import cached_property
+from ...._resource import SyncAPIResource, AsyncAPIResource
+from .logo_matches import (
+ LogoMatchesResource,
+ AsyncLogoMatchesResource,
+ LogoMatchesResourceWithRawResponse,
+ AsyncLogoMatchesResourceWithRawResponse,
+ LogoMatchesResourceWithStreamingResponse,
+ AsyncLogoMatchesResourceWithStreamingResponse,
+)
+
+__all__ = ["V2Resource", "AsyncV2Resource"]
+
+
+class V2Resource(SyncAPIResource):
+ @cached_property
+ def queries(self) -> QueriesResource:
+ return QueriesResource(self._client)
+
+ @cached_property
+ def matches(self) -> MatchesResource:
+ return MatchesResource(self._client)
+
+ @cached_property
+ def logos(self) -> LogosResource:
+ return LogosResource(self._client)
+
+ @cached_property
+ def logo_matches(self) -> LogoMatchesResource:
+ return LogoMatchesResource(self._client)
+
+ @cached_property
+ def with_raw_response(self) -> V2ResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return V2ResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> V2ResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return V2ResourceWithStreamingResponse(self)
+
+
+class AsyncV2Resource(AsyncAPIResource):
+ @cached_property
+ def queries(self) -> AsyncQueriesResource:
+ return AsyncQueriesResource(self._client)
+
+ @cached_property
+ def matches(self) -> AsyncMatchesResource:
+ return AsyncMatchesResource(self._client)
+
+ @cached_property
+ def logos(self) -> AsyncLogosResource:
+ return AsyncLogosResource(self._client)
+
+ @cached_property
+ def logo_matches(self) -> AsyncLogoMatchesResource:
+ return AsyncLogoMatchesResource(self._client)
+
+ @cached_property
+ def with_raw_response(self) -> AsyncV2ResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncV2ResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncV2ResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return AsyncV2ResourceWithStreamingResponse(self)
+
+
+class V2ResourceWithRawResponse:
+ def __init__(self, v2: V2Resource) -> None:
+ self._v2 = v2
+
+ @cached_property
+ def queries(self) -> QueriesResourceWithRawResponse:
+ return QueriesResourceWithRawResponse(self._v2.queries)
+
+ @cached_property
+ def matches(self) -> MatchesResourceWithRawResponse:
+ return MatchesResourceWithRawResponse(self._v2.matches)
+
+ @cached_property
+ def logos(self) -> LogosResourceWithRawResponse:
+ return LogosResourceWithRawResponse(self._v2.logos)
+
+ @cached_property
+ def logo_matches(self) -> LogoMatchesResourceWithRawResponse:
+ return LogoMatchesResourceWithRawResponse(self._v2.logo_matches)
+
+
+class AsyncV2ResourceWithRawResponse:
+ def __init__(self, v2: AsyncV2Resource) -> None:
+ self._v2 = v2
+
+ @cached_property
+ def queries(self) -> AsyncQueriesResourceWithRawResponse:
+ return AsyncQueriesResourceWithRawResponse(self._v2.queries)
+
+ @cached_property
+ def matches(self) -> AsyncMatchesResourceWithRawResponse:
+ return AsyncMatchesResourceWithRawResponse(self._v2.matches)
+
+ @cached_property
+ def logos(self) -> AsyncLogosResourceWithRawResponse:
+ return AsyncLogosResourceWithRawResponse(self._v2.logos)
+
+ @cached_property
+ def logo_matches(self) -> AsyncLogoMatchesResourceWithRawResponse:
+ return AsyncLogoMatchesResourceWithRawResponse(self._v2.logo_matches)
+
+
+class V2ResourceWithStreamingResponse:
+ def __init__(self, v2: V2Resource) -> None:
+ self._v2 = v2
+
+ @cached_property
+ def queries(self) -> QueriesResourceWithStreamingResponse:
+ return QueriesResourceWithStreamingResponse(self._v2.queries)
+
+ @cached_property
+ def matches(self) -> MatchesResourceWithStreamingResponse:
+ return MatchesResourceWithStreamingResponse(self._v2.matches)
+
+ @cached_property
+ def logos(self) -> LogosResourceWithStreamingResponse:
+ return LogosResourceWithStreamingResponse(self._v2.logos)
+
+ @cached_property
+ def logo_matches(self) -> LogoMatchesResourceWithStreamingResponse:
+ return LogoMatchesResourceWithStreamingResponse(self._v2.logo_matches)
+
+
+class AsyncV2ResourceWithStreamingResponse:
+ def __init__(self, v2: AsyncV2Resource) -> None:
+ self._v2 = v2
+
+ @cached_property
+ def queries(self) -> AsyncQueriesResourceWithStreamingResponse:
+ return AsyncQueriesResourceWithStreamingResponse(self._v2.queries)
+
+ @cached_property
+ def matches(self) -> AsyncMatchesResourceWithStreamingResponse:
+ return AsyncMatchesResourceWithStreamingResponse(self._v2.matches)
+
+ @cached_property
+ def logos(self) -> AsyncLogosResourceWithStreamingResponse:
+ return AsyncLogosResourceWithStreamingResponse(self._v2.logos)
+
+ @cached_property
+ def logo_matches(self) -> AsyncLogoMatchesResourceWithStreamingResponse:
+ return AsyncLogoMatchesResourceWithStreamingResponse(self._v2.logo_matches)
diff --git a/src/cloudflare/resources/browser_rendering/__init__.py b/src/cloudflare/resources/browser_rendering/__init__.py
index ca6102ced41..ad6d656dc22 100644
--- a/src/cloudflare/resources/browser_rendering/__init__.py
+++ b/src/cloudflare/resources/browser_rendering/__init__.py
@@ -16,6 +16,14 @@
JsonResourceWithStreamingResponse,
AsyncJsonResourceWithStreamingResponse,
)
+from .crawl import (
+ CrawlResource,
+ AsyncCrawlResource,
+ CrawlResourceWithRawResponse,
+ AsyncCrawlResourceWithRawResponse,
+ CrawlResourceWithStreamingResponse,
+ AsyncCrawlResourceWithStreamingResponse,
+)
from .links import (
LinksResource,
AsyncLinksResource,
@@ -40,6 +48,14 @@
ContentResourceWithStreamingResponse,
AsyncContentResourceWithStreamingResponse,
)
+from .devtools import (
+ DevtoolsResource,
+ AsyncDevtoolsResource,
+ DevtoolsResourceWithRawResponse,
+ AsyncDevtoolsResourceWithRawResponse,
+ DevtoolsResourceWithStreamingResponse,
+ AsyncDevtoolsResourceWithStreamingResponse,
+)
from .markdown import (
MarkdownResource,
AsyncMarkdownResource,
@@ -122,6 +138,18 @@
"AsyncMarkdownResourceWithRawResponse",
"MarkdownResourceWithStreamingResponse",
"AsyncMarkdownResourceWithStreamingResponse",
+ "CrawlResource",
+ "AsyncCrawlResource",
+ "CrawlResourceWithRawResponse",
+ "AsyncCrawlResourceWithRawResponse",
+ "CrawlResourceWithStreamingResponse",
+ "AsyncCrawlResourceWithStreamingResponse",
+ "DevtoolsResource",
+ "AsyncDevtoolsResource",
+ "DevtoolsResourceWithRawResponse",
+ "AsyncDevtoolsResourceWithRawResponse",
+ "DevtoolsResourceWithStreamingResponse",
+ "AsyncDevtoolsResourceWithStreamingResponse",
"BrowserRenderingResource",
"AsyncBrowserRenderingResource",
"BrowserRenderingResourceWithRawResponse",
diff --git a/src/cloudflare/resources/browser_rendering/api.md b/src/cloudflare/resources/browser_rendering/api.md
new file mode 100644
index 00000000000..c384cdcb32d
--- /dev/null
+++ b/src/cloudflare/resources/browser_rendering/api.md
@@ -0,0 +1,172 @@
+# BrowserRendering
+
+## Content
+
+Types:
+
+```python
+from cloudflare.types.browser_rendering import ContentCreateResponse
+```
+
+Methods:
+
+- client.browser_rendering.content.create(\*, account_id, \*\*params) -> str
+
+## PDF
+
+Methods:
+
+- client.browser_rendering.pdf.create(\*, account_id, \*\*params) -> BinaryAPIResponse
+
+## Scrape
+
+Types:
+
+```python
+from cloudflare.types.browser_rendering import ScrapeCreateResponse
+```
+
+Methods:
+
+- client.browser_rendering.scrape.create(\*, account_id, \*\*params) -> ScrapeCreateResponse
+
+## Screenshot
+
+Types:
+
+```python
+from cloudflare.types.browser_rendering import ScreenshotCreateResponse
+```
+
+Methods:
+
+- client.browser_rendering.screenshot.create(\*, account_id, \*\*params) -> ScreenshotCreateResponse
+
+## Snapshot
+
+Types:
+
+```python
+from cloudflare.types.browser_rendering import SnapshotCreateResponse
+```
+
+Methods:
+
+- client.browser_rendering.snapshot.create(\*, account_id, \*\*params) -> Optional[SnapshotCreateResponse]
+
+## Json
+
+Types:
+
+```python
+from cloudflare.types.browser_rendering import JsonCreateResponse
+```
+
+Methods:
+
+- client.browser_rendering.json.create(\*, account_id, \*\*params) -> JsonCreateResponse
+
+## Links
+
+Types:
+
+```python
+from cloudflare.types.browser_rendering import LinkCreateResponse
+```
+
+Methods:
+
+- client.browser_rendering.links.create(\*, account_id, \*\*params) -> LinkCreateResponse
+
+## Markdown
+
+Types:
+
+```python
+from cloudflare.types.browser_rendering import MarkdownCreateResponse
+```
+
+Methods:
+
+- client.browser_rendering.markdown.create(\*, account_id, \*\*params) -> str
+
+## Crawl
+
+Types:
+
+```python
+from cloudflare.types.browser_rendering import (
+ CrawlCreateResponse,
+ CrawlDeleteResponse,
+ CrawlGetResponse,
+)
+```
+
+Methods:
+
+- client.browser_rendering.crawl.create(\*, account_id, \*\*params) -> str
+- client.browser_rendering.crawl.delete(job_id, \*, account_id) -> CrawlDeleteResponse
+- client.browser_rendering.crawl.get(job_id, \*, account_id, \*\*params) -> CrawlGetResponse
+
+## Devtools
+
+### Session
+
+Types:
+
+```python
+from cloudflare.types.browser_rendering.devtools import SessionListResponse, SessionGetResponse
+```
+
+Methods:
+
+- client.browser_rendering.devtools.session.list(\*, account_id, \*\*params) -> SessionListResponse
+- client.browser_rendering.devtools.session.get(session_id, \*, account_id) -> Optional[SessionGetResponse]
+
+### Browser
+
+Types:
+
+```python
+from cloudflare.types.browser_rendering.devtools import (
+ BrowserCreateResponse,
+ BrowserDeleteResponse,
+ BrowserProtocolResponse,
+ BrowserVersionResponse,
+)
+```
+
+Methods:
+
+- client.browser_rendering.devtools.browser.create(\*, account_id, \*\*params) -> BrowserCreateResponse
+- client.browser_rendering.devtools.browser.delete(session_id, \*, account_id) -> BrowserDeleteResponse
+- client.browser_rendering.devtools.browser.connect(session_id, \*, account_id, \*\*params) -> None
+- client.browser_rendering.devtools.browser.launch(\*, account_id, \*\*params) -> None
+- client.browser_rendering.devtools.browser.protocol(session_id, \*, account_id) -> BrowserProtocolResponse
+- client.browser_rendering.devtools.browser.version(session_id, \*, account_id) -> BrowserVersionResponse
+
+#### Page
+
+Methods:
+
+- client.browser_rendering.devtools.browser.page.get(target_id, \*, account_id, session_id) -> None
+
+#### Targets
+
+Types:
+
+```python
+from cloudflare.types.browser_rendering.devtools.browser import (
+ TargetCreateResponse,
+ TargetListResponse,
+ TargetActivateResponse,
+ TargetGetResponse,
+)
+```
+
+Methods:
+
+- client.browser_rendering.devtools.browser.targets.create(session_id, \*, account_id, \*\*params) -> TargetCreateResponse
+- client.browser_rendering.devtools.browser.targets.list(session_id, \*, account_id) -> TargetListResponse
+- client.browser_rendering.devtools.browser.targets.activate(target_id, \*, account_id, session_id) -> TargetActivateResponse
+- client.browser_rendering.devtools.browser.targets.get(target_id, \*, account_id, session_id) -> TargetGetResponse
diff --git a/src/cloudflare/resources/browser_rendering/browser_rendering.py b/src/cloudflare/resources/browser_rendering/browser_rendering.py
index bee931f57df..25c30a0cdda 100644
--- a/src/cloudflare/resources/browser_rendering/browser_rendering.py
+++ b/src/cloudflare/resources/browser_rendering/browser_rendering.py
@@ -18,6 +18,14 @@
JsonResourceWithStreamingResponse,
AsyncJsonResourceWithStreamingResponse,
)
+from .crawl import (
+ CrawlResource,
+ AsyncCrawlResource,
+ CrawlResourceWithRawResponse,
+ AsyncCrawlResourceWithRawResponse,
+ CrawlResourceWithStreamingResponse,
+ AsyncCrawlResourceWithStreamingResponse,
+)
from .links import (
LinksResource,
AsyncLinksResource,
@@ -68,6 +76,14 @@
AsyncScreenshotResourceWithStreamingResponse,
)
from ..._resource import SyncAPIResource, AsyncAPIResource
+from .devtools.devtools import (
+ DevtoolsResource,
+ AsyncDevtoolsResource,
+ DevtoolsResourceWithRawResponse,
+ AsyncDevtoolsResourceWithRawResponse,
+ DevtoolsResourceWithStreamingResponse,
+ AsyncDevtoolsResourceWithStreamingResponse,
+)
__all__ = ["BrowserRenderingResource", "AsyncBrowserRenderingResource"]
@@ -105,6 +121,14 @@ def links(self) -> LinksResource:
def markdown(self) -> MarkdownResource:
return MarkdownResource(self._client)
+ @cached_property
+ def crawl(self) -> CrawlResource:
+ return CrawlResource(self._client)
+
+ @cached_property
+ def devtools(self) -> DevtoolsResource:
+ return DevtoolsResource(self._client)
+
@cached_property
def with_raw_response(self) -> BrowserRenderingResourceWithRawResponse:
"""
@@ -158,6 +182,14 @@ def links(self) -> AsyncLinksResource:
def markdown(self) -> AsyncMarkdownResource:
return AsyncMarkdownResource(self._client)
+ @cached_property
+ def crawl(self) -> AsyncCrawlResource:
+ return AsyncCrawlResource(self._client)
+
+ @cached_property
+ def devtools(self) -> AsyncDevtoolsResource:
+ return AsyncDevtoolsResource(self._client)
+
@cached_property
def with_raw_response(self) -> AsyncBrowserRenderingResourceWithRawResponse:
"""
@@ -214,6 +246,14 @@ def links(self) -> LinksResourceWithRawResponse:
def markdown(self) -> MarkdownResourceWithRawResponse:
return MarkdownResourceWithRawResponse(self._browser_rendering.markdown)
+ @cached_property
+ def crawl(self) -> CrawlResourceWithRawResponse:
+ return CrawlResourceWithRawResponse(self._browser_rendering.crawl)
+
+ @cached_property
+ def devtools(self) -> DevtoolsResourceWithRawResponse:
+ return DevtoolsResourceWithRawResponse(self._browser_rendering.devtools)
+
class AsyncBrowserRenderingResourceWithRawResponse:
def __init__(self, browser_rendering: AsyncBrowserRenderingResource) -> None:
@@ -251,6 +291,14 @@ def links(self) -> AsyncLinksResourceWithRawResponse:
def markdown(self) -> AsyncMarkdownResourceWithRawResponse:
return AsyncMarkdownResourceWithRawResponse(self._browser_rendering.markdown)
+ @cached_property
+ def crawl(self) -> AsyncCrawlResourceWithRawResponse:
+ return AsyncCrawlResourceWithRawResponse(self._browser_rendering.crawl)
+
+ @cached_property
+ def devtools(self) -> AsyncDevtoolsResourceWithRawResponse:
+ return AsyncDevtoolsResourceWithRawResponse(self._browser_rendering.devtools)
+
class BrowserRenderingResourceWithStreamingResponse:
def __init__(self, browser_rendering: BrowserRenderingResource) -> None:
@@ -288,6 +336,14 @@ def links(self) -> LinksResourceWithStreamingResponse:
def markdown(self) -> MarkdownResourceWithStreamingResponse:
return MarkdownResourceWithStreamingResponse(self._browser_rendering.markdown)
+ @cached_property
+ def crawl(self) -> CrawlResourceWithStreamingResponse:
+ return CrawlResourceWithStreamingResponse(self._browser_rendering.crawl)
+
+ @cached_property
+ def devtools(self) -> DevtoolsResourceWithStreamingResponse:
+ return DevtoolsResourceWithStreamingResponse(self._browser_rendering.devtools)
+
class AsyncBrowserRenderingResourceWithStreamingResponse:
def __init__(self, browser_rendering: AsyncBrowserRenderingResource) -> None:
@@ -324,3 +380,11 @@ def links(self) -> AsyncLinksResourceWithStreamingResponse:
@cached_property
def markdown(self) -> AsyncMarkdownResourceWithStreamingResponse:
return AsyncMarkdownResourceWithStreamingResponse(self._browser_rendering.markdown)
+
+ @cached_property
+ def crawl(self) -> AsyncCrawlResourceWithStreamingResponse:
+ return AsyncCrawlResourceWithStreamingResponse(self._browser_rendering.crawl)
+
+ @cached_property
+ def devtools(self) -> AsyncDevtoolsResourceWithStreamingResponse:
+ return AsyncDevtoolsResourceWithStreamingResponse(self._browser_rendering.devtools)
diff --git a/src/cloudflare/resources/browser_rendering/content.py b/src/cloudflare/resources/browser_rendering/content.py
index a70abd0583b..f20bd6e729e 100644
--- a/src/cloudflare/resources/browser_rendering/content.py
+++ b/src/cloudflare/resources/browser_rendering/content.py
@@ -8,7 +8,7 @@
import httpx
from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
-from ..._utils import required_args, maybe_transform, async_maybe_transform
+from ..._utils import path_template, required_args, maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -49,7 +49,7 @@ def with_streaming_response(self) -> ContentResourceWithStreamingResponse:
def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
url: str,
cache_ttl: float | Omit = omit,
action_timeout: float | Omit = omit,
@@ -182,7 +182,7 @@ def create(
def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
html: str,
cache_ttl: float | Omit = omit,
action_timeout: float | Omit = omit,
@@ -312,11 +312,11 @@ def create(
"""
...
- @required_args(["account_id", "url"], ["account_id", "html"])
+ @required_args(["url"], ["html"])
def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
url: str | Omit = omit,
cache_ttl: float | Omit = omit,
action_timeout: float | Omit = omit,
@@ -401,10 +401,12 @@ def create(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> str:
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._post(
- f"/accounts/{account_id}/browser-rendering/content",
+ path_template("/accounts/{account_id}/browser-rendering/content", account_id=account_id),
body=maybe_transform(
{
"url": url,
@@ -466,7 +468,7 @@ def with_streaming_response(self) -> AsyncContentResourceWithStreamingResponse:
async def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
url: str,
cache_ttl: float | Omit = omit,
action_timeout: float | Omit = omit,
@@ -599,7 +601,7 @@ async def create(
async def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
html: str,
cache_ttl: float | Omit = omit,
action_timeout: float | Omit = omit,
@@ -729,11 +731,11 @@ async def create(
"""
...
- @required_args(["account_id", "url"], ["account_id", "html"])
+ @required_args(["url"], ["html"])
async def create(
self,
*,
- account_id: str,
+ account_id: str | None = None,
url: str | Omit = omit,
cache_ttl: float | Omit = omit,
action_timeout: float | Omit = omit,
@@ -818,10 +820,12 @@ async def create(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> str:
+ if account_id is None:
+ account_id = self._client._get_account_id_path_param()
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._post(
- f"/accounts/{account_id}/browser-rendering/content",
+ path_template("/accounts/{account_id}/browser-rendering/content", account_id=account_id),
body=await async_maybe_transform(
{
"url": url,
diff --git a/src/cloudflare/resources/browser_rendering/crawl.py b/src/cloudflare/resources/browser_rendering/crawl.py
new file mode 100644
index 00000000000..434b45d4b6e
--- /dev/null
+++ b/src/cloudflare/resources/browser_rendering/crawl.py
@@ -0,0 +1,1135 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Dict, List, Type, Iterable, cast
+from typing_extensions import Literal, overload
+
+import httpx
+
+from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
+from ..._utils import path_template, required_args, maybe_transform, async_maybe_transform
+from ..._compat import cached_property
+from ..._resource import SyncAPIResource, AsyncAPIResource
+from ..._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from ..._wrappers import ResultWrapper
+from ..._base_client import make_request_options
+from ...types.browser_rendering import crawl_get_params, crawl_create_params
+from ...types.browser_rendering.crawl_get_response import CrawlGetResponse
+from ...types.browser_rendering.crawl_create_response import CrawlCreateResponse
+from ...types.browser_rendering.crawl_delete_response import CrawlDeleteResponse
+
+__all__ = ["CrawlResource", "AsyncCrawlResource"]
+
+
+class CrawlResource(SyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> CrawlResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
+ """
+ return CrawlResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> CrawlResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
+ """
+ return CrawlResourceWithStreamingResponse(self)
+
+ @overload
+ def create(
+ self,
+ *,
+ account_id: str | None = None,
+ url: str,
+ cache_ttl: float | Omit = omit,
+ action_timeout: float | Omit = omit,
+ add_script_tag: Iterable[crawl_create_params.Variant0AddScriptTag] | Omit = omit,
+ add_style_tag: Iterable[crawl_create_params.Variant0AddStyleTag] | Omit = omit,
+ allow_request_pattern: SequenceNotStr[str] | Omit = omit,
+ allow_resource_types: List[
+ Literal[
+ "document",
+ "stylesheet",
+ "image",
+ "media",
+ "font",
+ "script",
+ "texttrack",
+ "xhr",
+ "fetch",
+ "prefetch",
+ "eventsource",
+ "websocket",
+ "manifest",
+ "signedexchange",
+ "ping",
+ "cspviolationreport",
+ "preflight",
+ "other",
+ ]
+ ]
+ | Omit = omit,
+ authenticate: crawl_create_params.Variant0Authenticate | Omit = omit,
+ best_attempt: bool | Omit = omit,
+ cookies: Iterable[crawl_create_params.Variant0Cookie] | Omit = omit,
+ crawl_purposes: List[Literal["search", "ai-input", "ai-train"]] | Omit = omit,
+ depth: float | Omit = omit,
+ emulate_media_type: str | Omit = omit,
+ formats: List[Literal["html", "markdown", "json"]] | Omit = omit,
+ goto_options: crawl_create_params.Variant0GotoOptions | Omit = omit,
+ json_options: crawl_create_params.Variant0JsonOptions | Omit = omit,
+ limit: float | Omit = omit,
+ max_age: float | Omit = omit,
+ modified_since: int | Omit = omit,
+ options: crawl_create_params.Variant0Options | Omit = omit,
+ reject_request_pattern: SequenceNotStr[str] | Omit = omit,
+ reject_resource_types: List[
+ Literal[
+ "document",
+ "stylesheet",
+ "image",
+ "media",
+ "font",
+ "script",
+ "texttrack",
+ "xhr",
+ "fetch",
+ "prefetch",
+ "eventsource",
+ "websocket",
+ "manifest",
+ "signedexchange",
+ "ping",
+ "cspviolationreport",
+ "preflight",
+ "other",
+ ]
+ ]
+ | Omit = omit,
+ render: Literal[True] | Omit = omit,
+ set_extra_http_headers: Dict[str, str] | Omit = omit,
+ set_java_script_enabled: bool | Omit = omit,
+ source: Literal["sitemaps", "links", "all"] | Omit = omit,
+ viewport: crawl_create_params.Variant0Viewport | Omit = omit,
+ wait_for_selector: crawl_create_params.Variant0WaitForSelector | Omit = omit,
+ wait_for_timeout: float | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> str:
+ """Starts a crawl job for the provided URL and its children.
+
+ Check available
+ options like `gotoOptions` and `waitFor*` to control page load behaviour.
+
+ Args:
+ account_id: Account ID.
+
+ url: URL to navigate to, eg. `https://example.com`.
+
+ cache_ttl: Cache TTL default is 5s. Set to 0 to disable.
+
+ action_timeout: The maximum duration allowed for the browser action to complete after the page
+ has loaded (such as taking screenshots, extracting content, or generating PDFs).
+ If this time limit is exceeded, the action stops and returns a timeout error.
+
+ add_script_tag: Adds a `