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..ee5aba40e84 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: 2126
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c51406afe7e9e2e80becb9d86c4d0b67cfe23a0d04fbfba973c2133da11be47f.yml
+openapi_spec_hash: ebe782c4592c06e7e22eb0a725cc326e
+config_hash: fab306f9c013d1ed01ed9c35c79f428b
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 13307919a9f..217789a585d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,147 @@
# Changelog
+## 5.0.0-beta.2 (2026-04-15)
+
+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
+
+* 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))
+* 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))
+* 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))
+* **radar:** Add Botnet Threat Feed endpoint ([ec3681f](https://github.com/cloudflare/cloudflare-python/commit/ec3681f12a7c0335a60b0778190c80b72f76422b))
+* test: skip prism tests for endpoints with non-JSON content types ([631d664](https://github.com/cloudflare/cloudflare-python/commit/631d664d36c72148726a7261839ad0f6d24b7ac4))
+
+
+### 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))
+
## 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/api.md b/api.md
index 890a848cb44..b3c7cdb0d46 100644
--- a/api.md
+++ b/api.md
@@ -428,6 +428,30 @@ Methods:
- client.zones.settings.edit(setting_id, \*, zone_id, \*\*params) -> Optional[SettingEditResponse]
- client.zones.settings.get(setting_id, \*, zone_id) -> Optional[SettingGetResponse]
+## Environments
+
+Types:
+
+```python
+from cloudflare.types.zones import (
+ EnvironmentCreateResponse,
+ EnvironmentUpdateResponse,
+ EnvironmentListResponse,
+ EnvironmentDeleteResponse,
+ EnvironmentEditResponse,
+ EnvironmentRollbackResponse,
+)
+```
+
+Methods:
+
+- client.zones.environments.create(\*, zone_id, \*\*params) -> EnvironmentCreateResponse
+- client.zones.environments.update(\*, zone_id, \*\*params) -> EnvironmentUpdateResponse
+- client.zones.environments.list(\*, zone_id) -> EnvironmentListResponse
+- client.zones.environments.delete(environment_id, \*, zone_id) -> EnvironmentDeleteResponse
+- client.zones.environments.edit(\*, zone_id, \*\*params) -> EnvironmentEditResponse
+- client.zones.environments.rollback(environment_id, \*, zone_id) -> EnvironmentRollbackResponse
+
## CustomNameservers
Types:
@@ -791,7 +815,7 @@ from cloudflare.types.ssl import (
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.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[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]
@@ -869,6 +893,21 @@ Methods:
- 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]
+
# Argo
## SmartRouting
@@ -1368,7 +1407,7 @@ from cloudflare.types.email_security import InvestigateListResponse, Investigate
Methods:
- client.email_security.investigate.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[InvestigateListResponse]
-- client.email_security.investigate.get(postfix_id, \*, account_id) -> InvestigateGetResponse
+- client.email_security.investigate.get(postfix_id, \*, account_id, \*\*params) -> InvestigateGetResponse
### Detections
@@ -1417,7 +1456,7 @@ from cloudflare.types.email_security.investigate import TraceGetResponse
Methods:
-- client.email_security.investigate.trace.get(postfix_id, \*, account_id) -> TraceGetResponse
+- client.email_security.investigate.trace.get(postfix_id, \*, account_id, \*\*params) -> TraceGetResponse
### Move
@@ -1429,7 +1468,7 @@ from cloudflare.types.email_security.investigate import MoveCreateResponse, Move
Methods:
-- client.email_security.investigate.move.create(postfix_id, \*, account_id, \*\*params) -> SyncSinglePage[MoveCreateResponse]
+- client.email_security.investigate.move.create(postfix_id, \*, account_id, \*\*params) -> MoveCreateResponse
- client.email_security.investigate.move.bulk(\*, account_id, \*\*params) -> SyncSinglePage[MoveBulkResponse]
### Reclassify
@@ -1450,6 +1489,20 @@ Methods:
- client.email_security.investigate.release.bulk(\*, account_id, \*\*params) -> SyncSinglePage[ReleaseBulkResponse]
+## Phishguard
+
+### Reports
+
+Types:
+
+```python
+from cloudflare.types.email_security.phishguard import ReportListResponse
+```
+
+Methods:
+
+- client.email_security.phishguard.reports.list(\*, account_id, \*\*params) -> SyncSinglePage[ReportListResponse]
+
## Settings
### AllowPolicies
@@ -1652,6 +1705,45 @@ Methods:
- client.email_routing.addresses.delete(destination_address_identifier, \*, account_id) -> Optional[Address]
- client.email_routing.addresses.get(destination_address_identifier, \*, account_id) -> Optional[Address]
+# EmailSending
+
+Types:
+
+```python
+from cloudflare.types.email_sending import EmailSendingSendResponse, EmailSendingSendRawResponse
+```
+
+Methods:
+
+- client.email_sending.send(\*, account_id, \*\*params) -> EmailSendingSendResponse
+- client.email_sending.send_raw(\*, account_id, \*\*params) -> EmailSendingSendRawResponse
+
+## Subdomains
+
+Types:
+
+```python
+from cloudflare.types.email_sending import (
+ SubdomainCreateResponse,
+ SubdomainListResponse,
+ SubdomainDeleteResponse,
+ SubdomainGetResponse,
+)
+```
+
+Methods:
+
+- client.email_sending.subdomains.create(\*, zone_id, \*\*params) -> Optional[SubdomainCreateResponse]
+- client.email_sending.subdomains.list(\*, zone_id) -> SyncSinglePage[SubdomainListResponse]
+- client.email_sending.subdomains.delete(subdomain_id, \*, zone_id) -> SubdomainDeleteResponse
+- client.email_sending.subdomains.get(subdomain_id, \*, zone_id) -> Optional[SubdomainGetResponse]
+
+### DNS
+
+Methods:
+
+- client.email_sending.subdomains.dns.get(subdomain_id, \*, zone_id) -> SyncSinglePage[DNSRecord]
+
# Filters
Types:
@@ -2182,7 +2274,6 @@ 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
@@ -2599,15 +2690,20 @@ Methods:
Types:
```python
-from cloudflare.types.workers import Domain
+from cloudflare.types.workers import (
+ DomainUpdateResponse,
+ DomainListResponse,
+ DomainDeleteResponse,
+ DomainGetResponse,
+)
```
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]
+- client.workers.domains.update(\*, account_id, \*\*params) -> DomainUpdateResponse
+- client.workers.domains.list(\*, account_id, \*\*params) -> SyncSinglePage[DomainListResponse]
+- client.workers.domains.delete(domain_id, \*, account_id) -> DomainDeleteResponse
+- client.workers.domains.get(domain_id, \*, account_id) -> DomainGetResponse
## Subdomains
@@ -2643,6 +2739,26 @@ Methods:
- client.workers.observability.telemetry.query(\*, account_id, \*\*params) -> TelemetryQueryResponse
- client.workers.observability.telemetry.values(\*, account_id, \*\*params) -> SyncSinglePage[TelemetryValuesResponse]
+### Destinations
+
+Types:
+
+```python
+from cloudflare.types.workers.observability import (
+ DestinationCreateResponse,
+ DestinationUpdateResponse,
+ DestinationListResponse,
+ DestinationDeleteResponse,
+)
+```
+
+Methods:
+
+- client.workers.observability.destinations.create(\*, account_id, \*\*params) -> DestinationCreateResponse
+- client.workers.observability.destinations.update(slug, \*, account_id, \*\*params) -> DestinationUpdateResponse
+- client.workers.observability.destinations.list(\*, account_id, \*\*params) -> SyncSinglePage[DestinationListResponse]
+- client.workers.observability.destinations.delete(slug, \*, account_id) -> Optional[DestinationDeleteResponse]
+
# KV
## Namespaces
@@ -2865,6 +2981,82 @@ Methods:
- 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:
@@ -2890,6 +3082,30 @@ Methods:
- 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:
@@ -3091,51 +3307,9 @@ Methods:
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
+from cloudflare.types.rulesets import Kind, Phase, Ruleset
```
-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:
@@ -3160,32 +3334,9 @@ from cloudflare.types.rulesets import (
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:
@@ -3499,6 +3650,18 @@ 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
+
# BrandProtection
Types:
@@ -3564,6 +3727,62 @@ 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
+
# Diagnostics
## Traceroutes
@@ -4515,7 +4734,7 @@ from cloudflare.types.mtls_certificates import MTLSCertificate, MTLSCertificateC
Methods:
- client.mtls_certificates.create(\*, account_id, \*\*params) -> Optional[MTLSCertificateCreateResponse]
-- client.mtls_certificates.list(\*, account_id) -> SyncSinglePage[MTLSCertificate]
+- client.mtls_certificates.list(\*, account_id, \*\*params) -> SyncSinglePage[MTLSCertificate]
- client.mtls_certificates.delete(mtls_certificate_id, \*, account_id) -> Optional[MTLSCertificate]
- client.mtls_certificates.get(mtls_certificate_id, \*, account_id) -> Optional[MTLSCertificate]
@@ -4598,6 +4817,22 @@ Methods:
# Registrar
+Types:
+
+```python
+from cloudflare.types.registrar import (
+ Registration,
+ WorkflowStatus,
+ RegistrarCheckResponse,
+ RegistrarSearchResponse,
+)
+```
+
+Methods:
+
+- client.registrar.check(\*, account_id, \*\*params) -> RegistrarCheckResponse
+- client.registrar.search(\*, account_id, \*\*params) -> RegistrarSearchResponse
+
## Domains
Types:
@@ -4612,6 +4847,26 @@ Methods:
- client.registrar.domains.list(\*, account_id) -> SyncSinglePage[Domain]
- client.registrar.domains.get(domain_name, \*, account_id) -> object
+## Registrations
+
+Methods:
+
+- client.registrar.registrations.create(\*, account_id, \*\*params) -> WorkflowStatus
+- client.registrar.registrations.edit(domain_name, \*, account_id, \*\*params) -> WorkflowStatus
+- client.registrar.registrations.get(domain_name, \*, account_id) -> Registration
+
+## RegistrationStatus
+
+Methods:
+
+- client.registrar.registration_status.get(domain_name, \*, account_id) -> WorkflowStatus
+
+## UpdateStatus
+
+Methods:
+
+- client.registrar.update_status.get(domain_name, \*, account_id) -> WorkflowStatus
+
# RequestTracers
## Traces
@@ -4709,7 +4964,7 @@ Methods:
Types:
```python
-from cloudflare.types.stream import Audio, AudioTrackDeleteResponse
+from cloudflare.types.stream import Audio, AudioTrackDeleteResponse, AudioTrackGetResponse
```
Methods:
@@ -4717,7 +4972,7 @@ 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]
+- client.stream.audio_tracks.get(identifier, \*, account_id) -> Optional[AudioTrackGetResponse]
## Videos
@@ -4741,7 +4996,7 @@ from cloudflare.types.stream import Clip
Methods:
-- client.stream.clip.create(\*, account_id, \*\*params) -> Optional[Clip]
+- client.stream.clip.create(\*, account_id, \*\*params) -> Optional[Video]
## Copy
@@ -4826,14 +5081,14 @@ Methods:
Types:
```python
-from cloudflare.types.stream import WebhookDeleteResponse
+from cloudflare.types.stream import WebhookUpdateResponse, WebhookDeleteResponse, WebhookGetResponse
```
Methods:
-- client.stream.webhooks.update(\*, account_id, \*\*params) -> object
+- client.stream.webhooks.update(\*, account_id, \*\*params) -> Optional[WebhookUpdateResponse]
- client.stream.webhooks.delete(\*, account_id) -> str
-- client.stream.webhooks.get(\*, account_id) -> object
+- client.stream.webhooks.get(\*, account_id) -> Optional[WebhookGetResponse]
## Captions
@@ -4888,7 +5143,7 @@ from cloudflare.types.stream import (
Methods:
-- client.stream.downloads.create(identifier, \*, account_id, \*\*params) -> Optional[DownloadCreateResponse]
+- client.stream.downloads.create(identifier, \*, account_id) -> Optional[DownloadCreateResponse]
- client.stream.downloads.delete(identifier, \*, account_id) -> str
- client.stream.downloads.get(identifier, \*, account_id) -> Optional[DownloadGetResponse]
@@ -5588,6 +5843,22 @@ Methods:
- 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]
+### IPProfiles
+
+Types:
+
+```python
+from cloudflare.types.zero_trust.devices import IPProfile, IPProfileDeleteResponse
+```
+
+Methods:
+
+- client.zero_trust.devices.ip_profiles.create(\*, account_id, \*\*params) -> IPProfile
+- client.zero_trust.devices.ip_profiles.update(profile_id, \*, account_id, \*\*params) -> IPProfile
+- client.zero_trust.devices.ip_profiles.list(\*, account_id, \*\*params) -> SyncSinglePage[IPProfile]
+- client.zero_trust.devices.ip_profiles.delete(profile_id, \*, account_id) -> IPProfileDeleteResponse
+- client.zero_trust.devices.ip_profiles.get(profile_id, \*, account_id) -> IPProfile
+
### Networks
Types:
@@ -6286,12 +6557,22 @@ Methods:
Types:
```python
-from cloudflare.types.zero_trust.access import AccessUser, UserListResponse
+from cloudflare.types.zero_trust.access import (
+ AccessUser,
+ UserCreateResponse,
+ UserUpdateResponse,
+ UserListResponse,
+ UserGetResponse,
+)
```
Methods:
+- client.zero_trust.access.users.create(\*, account_id, \*\*params) -> Optional[UserCreateResponse]
+- client.zero_trust.access.users.update(user_id, \*, account_id, \*\*params) -> Optional[UserUpdateResponse]
- client.zero_trust.access.users.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[UserListResponse]
+- client.zero_trust.access.users.delete(user_id, \*, account_id) -> object
+- client.zero_trust.access.users.get(user_id, \*, account_id) -> Optional[UserGetResponse]
#### ActiveSessions
@@ -6578,7 +6859,29 @@ Methods:
- 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
+### Rules
+
+Types:
+
+```python
+from cloudflare.types.zero_trust.dex import (
+ RuleCreateResponse,
+ RuleUpdateResponse,
+ RuleListResponse,
+ RuleDeleteResponse,
+ RuleGetResponse,
+)
+```
+
+Methods:
+
+- client.zero_trust.dex.rules.create(\*, account_id, \*\*params) -> Optional[RuleCreateResponse]
+- client.zero_trust.dex.rules.update(rule_id, \*, account_id, \*\*params) -> Optional[RuleUpdateResponse]
+- client.zero_trust.dex.rules.list(\*, account_id, \*\*params) -> SyncV4PagePagination[Optional[RuleListResponse]]
+- client.zero_trust.dex.rules.delete(rule_id, \*, account_id) -> Optional[RuleDeleteResponse]
+- client.zero_trust.dex.rules.get(rule_id, \*, account_id) -> Optional[RuleGetResponse]
+
+## Tunnels
Types:
@@ -6693,6 +6996,36 @@ Methods:
- client.zero_trust.tunnels.warp_connector.token.get(tunnel_id, \*, account_id) -> str
+#### Connections
+
+Types:
+
+```python
+from cloudflare.types.zero_trust.tunnels.warp_connector import ConnectionGetResponse
+```
+
+Methods:
+
+- client.zero_trust.tunnels.warp_connector.connections.get(tunnel_id, \*, account_id) -> SyncSinglePage[ConnectionGetResponse]
+
+#### Connectors
+
+Types:
+
+```python
+from cloudflare.types.zero_trust.tunnels.warp_connector import ConnectorGetResponse
+```
+
+Methods:
+
+- client.zero_trust.tunnels.warp_connector.connectors.get(connector_id, \*, account_id, tunnel_id) -> ConnectorGetResponse
+
+#### Failover
+
+Methods:
+
+- client.zero_trust.tunnels.warp_connector.failover.update(tunnel_id, \*, account_id, \*\*params) -> object
+
## ConnectivitySettings
Types:
@@ -6716,40 +7049,29 @@ Methods:
Types:
```python
-from cloudflare.types.zero_trust.dlp import (
- Dataset,
- DatasetArray,
- DatasetCreation,
- DatasetCreateResponse,
- DatasetUpdateResponse,
- DatasetGetResponse,
-)
+from cloudflare.types.zero_trust.dlp import Dataset, DatasetArray, DatasetCreation
```
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.create(\*, account_id, \*\*params) -> Optional[DatasetCreation]
+- client.zero_trust.dlp.datasets.update(dataset_id, \*, account_id, \*\*params) -> Optional[Dataset]
- 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]
+- client.zero_trust.dlp.datasets.get(dataset_id, \*, account_id) -> Optional[Dataset]
#### Upload
Types:
```python
-from cloudflare.types.zero_trust.dlp.datasets import (
- NewVersion,
- UploadCreateResponse,
- UploadEditResponse,
-)
+from cloudflare.types.zero_trust.dlp.datasets import NewVersion
```
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]
+- client.zero_trust.dlp.datasets.upload.create(dataset_id, \*, account_id) -> Optional[NewVersion]
+- client.zero_trust.dlp.datasets.upload.edit(version, dataset, \*, account_id, dataset_id, \*\*params) -> Optional[Dataset]
#### Versions
@@ -6847,57 +7169,42 @@ Methods:
Types:
```python
-from cloudflare.types.zero_trust.dlp import (
- ContextAwareness,
- Profile,
- SkipConfiguration,
- ProfileGetResponse,
-)
+from cloudflare.types.zero_trust.dlp import ContextAwareness, Profile, SkipConfiguration
```
Methods:
- client.zero_trust.dlp.profiles.list(\*, account_id, \*\*params) -> SyncSinglePage[Profile]
-- client.zero_trust.dlp.profiles.get(profile_id, \*, account_id) -> Optional[ProfileGetResponse]
+- client.zero_trust.dlp.profiles.get(profile_id, \*, account_id) -> Optional[Profile]
#### Custom
Types:
```python
-from cloudflare.types.zero_trust.dlp.profiles import (
- CustomProfile,
- Pattern,
- CustomCreateResponse,
- CustomUpdateResponse,
- CustomGetResponse,
-)
+from cloudflare.types.zero_trust.dlp.profiles import CustomProfile, Pattern
```
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.create(\*, account_id, \*\*params) -> Optional[Profile]
+- client.zero_trust.dlp.profiles.custom.update(profile_id, \*, account_id, \*\*params) -> Optional[Profile]
- 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]
+- client.zero_trust.dlp.profiles.custom.get(profile_id, \*, account_id) -> Optional[Profile]
#### Predefined
Types:
```python
-from cloudflare.types.zero_trust.dlp.profiles import (
- PredefinedProfile,
- PredefinedUpdateResponse,
- PredefinedGetResponse,
-)
+from cloudflare.types.zero_trust.dlp.profiles import PredefinedProfile
```
Methods:
-- client.zero_trust.dlp.profiles.predefined.update(profile_id, \*, account_id, \*\*params) -> Optional[PredefinedUpdateResponse]
+- client.zero_trust.dlp.profiles.predefined.update(profile_id, \*, account_id, \*\*params) -> Optional[PredefinedProfile]
- 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]
+- client.zero_trust.dlp.profiles.predefined.get(profile_id, \*, account_id) -> Optional[PredefinedProfile]
### Limits
@@ -7214,6 +7521,27 @@ Methods:
- 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]
+### Pacfiles
+
+Types:
+
+```python
+from cloudflare.types.zero_trust.gateway import (
+ PacfileCreateResponse,
+ PacfileUpdateResponse,
+ PacfileListResponse,
+ PacfileGetResponse,
+)
+```
+
+Methods:
+
+- client.zero_trust.gateway.pacfiles.create(\*, account_id, \*\*params) -> Optional[PacfileCreateResponse]
+- client.zero_trust.gateway.pacfiles.update(pacfile_id, \*, account_id, \*\*params) -> Optional[PacfileUpdateResponse]
+- client.zero_trust.gateway.pacfiles.list(\*, account_id) -> SyncSinglePage[PacfileListResponse]
+- client.zero_trust.gateway.pacfiles.delete(pacfile_id, \*, account_id) -> object
+- client.zero_trust.gateway.pacfiles.get(pacfile_id, \*, account_id) -> Optional[PacfileGetResponse]
+
## Networks
### Routes
@@ -7264,27 +7592,30 @@ Methods:
### Subnets
+Methods:
+
+- client.zero_trust.networks.subnets.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[Subnet]
+
+#### WARP
+
Types:
```python
-from cloudflare.types.zero_trust.networks import SubnetListResponse
+from cloudflare.types.zero_trust.networks.subnets import Subnet, WARPDeleteResponse
```
Methods:
-- client.zero_trust.networks.subnets.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[SubnetListResponse]
+- client.zero_trust.networks.subnets.warp.create(\*, account_id, \*\*params) -> Subnet
+- client.zero_trust.networks.subnets.warp.delete(subnet_id, \*, account_id) -> Optional[WARPDeleteResponse]
+- client.zero_trust.networks.subnets.warp.edit(subnet_id, \*, account_id, \*\*params) -> Subnet
+- client.zero_trust.networks.subnets.warp.get(subnet_id, \*, account_id) -> Subnet
#### 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
+- client.zero_trust.networks.subnets.cloudflare_source.update(address_family, \*, account_id, \*\*params) -> Subnet
### HostnameRoutes
@@ -7576,6 +7907,95 @@ Methods:
- client.url_scanner.scans.har(scan_id, \*, account_id) -> ScanHARResponse
- client.url_scanner.scans.screenshot(scan_id, \*, account_id, \*\*params) -> BinaryAPIResponse
+# VulnerabilityScanner
+
+## CredentialSets
+
+Types:
+
+```python
+from cloudflare.types.vulnerability_scanner import (
+ CredentialSetCreateResponse,
+ CredentialSetUpdateResponse,
+ CredentialSetListResponse,
+ CredentialSetEditResponse,
+ CredentialSetGetResponse,
+)
+```
+
+Methods:
+
+- client.vulnerability_scanner.credential_sets.create(\*, account_id, \*\*params) -> Optional[CredentialSetCreateResponse]
+- client.vulnerability_scanner.credential_sets.update(credential_set_id, \*, account_id, \*\*params) -> Optional[CredentialSetUpdateResponse]
+- client.vulnerability_scanner.credential_sets.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[CredentialSetListResponse]
+- client.vulnerability_scanner.credential_sets.delete(credential_set_id, \*, account_id) -> object
+- client.vulnerability_scanner.credential_sets.edit(credential_set_id, \*, account_id, \*\*params) -> Optional[CredentialSetEditResponse]
+- client.vulnerability_scanner.credential_sets.get(credential_set_id, \*, account_id) -> Optional[CredentialSetGetResponse]
+
+### Credentials
+
+Types:
+
+```python
+from cloudflare.types.vulnerability_scanner.credential_sets import (
+ CredentialCreateResponse,
+ CredentialUpdateResponse,
+ CredentialListResponse,
+ CredentialEditResponse,
+ CredentialGetResponse,
+)
+```
+
+Methods:
+
+- client.vulnerability_scanner.credential_sets.credentials.create(credential_set_id, \*, account_id, \*\*params) -> Optional[CredentialCreateResponse]
+- client.vulnerability_scanner.credential_sets.credentials.update(credential_id, \*, account_id, credential_set_id, \*\*params) -> Optional[CredentialUpdateResponse]
+- client.vulnerability_scanner.credential_sets.credentials.list(credential_set_id, \*, account_id, \*\*params) -> SyncV4PagePaginationArray[CredentialListResponse]
+- client.vulnerability_scanner.credential_sets.credentials.delete(credential_id, \*, account_id, credential_set_id) -> object
+- client.vulnerability_scanner.credential_sets.credentials.edit(credential_id, \*, account_id, credential_set_id, \*\*params) -> Optional[CredentialEditResponse]
+- client.vulnerability_scanner.credential_sets.credentials.get(credential_id, \*, account_id, credential_set_id) -> Optional[CredentialGetResponse]
+
+## Scans
+
+Types:
+
+```python
+from cloudflare.types.vulnerability_scanner import (
+ ScanCreateResponse,
+ ScanListResponse,
+ ScanGetResponse,
+)
+```
+
+Methods:
+
+- client.vulnerability_scanner.scans.create(\*, account_id, \*\*params) -> Optional[ScanCreateResponse]
+- client.vulnerability_scanner.scans.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[ScanListResponse]
+- client.vulnerability_scanner.scans.get(scan_id, \*, account_id) -> Optional[ScanGetResponse]
+
+## TargetEnvironments
+
+Types:
+
+```python
+from cloudflare.types.vulnerability_scanner import (
+ TargetEnvironmentCreateResponse,
+ TargetEnvironmentUpdateResponse,
+ TargetEnvironmentListResponse,
+ TargetEnvironmentEditResponse,
+ TargetEnvironmentGetResponse,
+)
+```
+
+Methods:
+
+- client.vulnerability_scanner.target_environments.create(\*, account_id, \*\*params) -> Optional[TargetEnvironmentCreateResponse]
+- client.vulnerability_scanner.target_environments.update(target_environment_id, \*, account_id, \*\*params) -> Optional[TargetEnvironmentUpdateResponse]
+- client.vulnerability_scanner.target_environments.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[TargetEnvironmentListResponse]
+- client.vulnerability_scanner.target_environments.delete(target_environment_id, \*, account_id) -> object
+- client.vulnerability_scanner.target_environments.edit(target_environment_id, \*, account_id, \*\*params) -> Optional[TargetEnvironmentEditResponse]
+- client.vulnerability_scanner.target_environments.get(target_environment_id, \*, account_id) -> Optional[TargetEnvironmentGetResponse]
+
# Radar
## AI
@@ -8057,6 +8477,36 @@ Methods:
- client.radar.netflows.top.ases(\*\*params) -> TopAsesResponse
- client.radar.netflows.top.locations(\*\*params) -> TopLocationsResponse
+## PostQuantum
+
+### Origin
+
+Types:
+
+```python
+from cloudflare.types.radar.post_quantum import (
+ OriginSummaryResponse,
+ OriginTimeseriesGroupsResponse,
+)
+```
+
+Methods:
+
+- client.radar.post_quantum.origin.summary(dimension, \*\*params) -> OriginSummaryResponse
+- client.radar.post_quantum.origin.timeseries_groups(dimension, \*\*params) -> OriginTimeseriesGroupsResponse
+
+### TLS
+
+Types:
+
+```python
+from cloudflare.types.radar.post_quantum import TLSSupportResponse
+```
+
+Methods:
+
+- client.radar.post_quantum.tls.support(\*\*params) -> TLSSupportResponse
+
## Search
Types:
@@ -8601,6 +9051,7 @@ Types:
from cloudflare.types.radar.entities import (
ASNListResponse,
ASNAsSetResponse,
+ ASNBotnetThreatFeedResponse,
ASNGetResponse,
ASNIPResponse,
ASNRelResponse,
@@ -8611,6 +9062,7 @@ Methods:
- client.radar.entities.asns.list(\*\*params) -> ASNListResponse
- client.radar.entities.asns.as_set(asn, \*\*params) -> ASNAsSetResponse
+- client.radar.entities.asns.botnet_threat_feed(\*\*params) -> ASNBotnetThreatFeedResponse
- client.radar.entities.asns.get(asn, \*\*params) -> ASNGetResponse
- client.radar.entities.asns.ip(\*\*params) -> ASNIPResponse
- client.radar.entities.asns.rel(asn, \*\*params) -> ASNRelResponse
@@ -9195,6 +9647,21 @@ Methods:
- client.origin_post_quantum_encryption.update(\*, zone_id, \*\*params) -> Optional[OriginPostQuantumEncryptionUpdateResponse]
- client.origin_post_quantum_encryption.get(\*, zone_id) -> Optional[OriginPostQuantumEncryptionGetResponse]
+# GoogleTagGateway
+
+## Config
+
+Types:
+
+```python
+from cloudflare.types.google_tag_gateway import Config
+```
+
+Methods:
+
+- client.google_tag_gateway.config.update(\*, zone_id, \*\*params) -> Optional[Config]
+- client.google_tag_gateway.config.get(\*, zone_id) -> Optional[Config]
+
# Zaraz
Types:
@@ -9383,19 +9850,14 @@ Methods:
Types:
```python
-from cloudflare.types.snippets import (
- SnippetUpdateResponse,
- SnippetListResponse,
- SnippetDeleteResponse,
- SnippetGetResponse,
-)
+from cloudflare.types.snippets import SnippetUpdateResponse, SnippetListResponse, 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.delete(snippet_name, \*, zone_id) -> object
- client.snippets.get(snippet_name, \*, zone_id) -> SnippetGetResponse
## Content
@@ -9406,17 +9868,11 @@ Methods:
## 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]
+- client.snippets.rules.update(\*, zone_id, \*\*params) -> object
+- client.snippets.rules.list(\*, zone_id) -> object
+- client.snippets.rules.delete(\*, zone_id) -> object
# RealtimeKit
@@ -9814,7 +10270,6 @@ Types:
from cloudflare.types.cloudforce_one import (
ThreatEventCreateResponse,
ThreatEventListResponse,
- ThreatEventDeleteResponse,
ThreatEventBulkCreateResponse,
ThreatEventEditResponse,
ThreatEventGetResponse,
@@ -9825,7 +10280,6 @@ 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
@@ -10329,7 +10783,7 @@ Methods:
- 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
+- client.workflows.instances.get(instance_id, \*, account_id, workflow_name, \*\*params) -> InstanceGetResponse
### Status
@@ -10426,6 +10880,70 @@ Methods:
- 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]
+# ResourceTagging
+
+Types:
+
+```python
+from cloudflare.types.resource_tagging import ResourceTaggingListResponse
+```
+
+Methods:
+
+- client.resource_tagging.list(\*, account_id, \*\*params) -> SyncCursorPaginationAfter[ResourceTaggingListResponse]
+
+## AccountTags
+
+Types:
+
+```python
+from cloudflare.types.resource_tagging import AccountTagUpdateResponse, AccountTagGetResponse
+```
+
+Methods:
+
+- client.resource_tagging.account_tags.update(\*, account_id, \*\*params) -> Optional[AccountTagUpdateResponse]
+- client.resource_tagging.account_tags.delete(\*, account_id) -> None
+- client.resource_tagging.account_tags.get(\*, account_id, \*\*params) -> Optional[AccountTagGetResponse]
+
+## ZoneTags
+
+Types:
+
+```python
+from cloudflare.types.resource_tagging import ZoneTagUpdateResponse, ZoneTagGetResponse
+```
+
+Methods:
+
+- client.resource_tagging.zone_tags.update(\*, zone_id, \*\*params) -> Optional[ZoneTagUpdateResponse]
+- client.resource_tagging.zone_tags.delete(\*, zone_id) -> None
+- client.resource_tagging.zone_tags.get(\*, zone_id, \*\*params) -> Optional[ZoneTagGetResponse]
+
+## Keys
+
+Types:
+
+```python
+from cloudflare.types.resource_tagging import KeyListResponse
+```
+
+Methods:
+
+- client.resource_tagging.keys.list(\*, account_id, \*\*params) -> SyncCursorPaginationAfter[KeyListResponse]
+
+## Values
+
+Types:
+
+```python
+from cloudflare.types.resource_tagging import ValueListResponse
+```
+
+Methods:
+
+- client.resource_tagging.values.list(tag_key, \*, account_id, \*\*params) -> SyncCursorPaginationAfter[ValueListResponse]
+
# LeakedCredentialChecks
Types:
@@ -10613,9 +11131,15 @@ Methods:
### Schema
+Types:
+
+```python
+from cloudflare.types.ai.models import SchemaGetResponse
+```
+
Methods:
-- client.ai.models.schema.get(\*, account_id, \*\*params) -> object
+- client.ai.models.schema.get(\*, account_id, \*\*params) -> SchemaGetResponse
## ToMarkdown
@@ -10660,19 +11184,6 @@ Methods:
- 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:
@@ -10688,7 +11199,7 @@ from cloudflare.types.aisearch.instances import (
Methods:
-- client.aisearch.instances.jobs.create(id, \*, account_id) -> JobCreateResponse
+- 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
@@ -10715,148 +11226,178 @@ Methods:
- client.aisearch.tokens.delete(id, \*, account_id) -> TokenDeleteResponse
- client.aisearch.tokens.read(id, \*, account_id) -> TokenReadResponse
-# SecurityCenter
+# BrowserRendering
-## Insights
+## Content
Types:
```python
-from cloudflare.types.security_center import InsightListResponse, InsightDismissResponse
+from cloudflare.types.browser_rendering import ContentCreateResponse
```
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
+- client.browser_rendering.content.create(\*, account_id, \*\*params) -> str
-### Class
+## PDF
+
+Methods:
+
+- client.browser_rendering.pdf.create(\*, account_id, \*\*params) -> BinaryAPIResponse
+
+## Scrape
Types:
```python
-from cloudflare.types.security_center.insights import ClassGetResponse
+from cloudflare.types.browser_rendering import ScrapeCreateResponse
```
Methods:
-- client.security*center.insights.class*.get(\*, account_id, zone_id, \*\*params) -> Optional[ClassGetResponse]
+- client.browser_rendering.scrape.create(\*, account_id, \*\*params) -> ScrapeCreateResponse
-### Severity
+## Screenshot
Types:
```python
-from cloudflare.types.security_center.insights import SeverityGetResponse
+from cloudflare.types.browser_rendering import ScreenshotCreateResponse
```
Methods:
-- client.security_center.insights.severity.get(\*, account_id, zone_id, \*\*params) -> Optional[SeverityGetResponse]
+- client.browser_rendering.screenshot.create(\*, account_id, \*\*params) -> ScreenshotCreateResponse
-### Type
+## Snapshot
Types:
```python
-from cloudflare.types.security_center.insights import TypeGetResponse
+from cloudflare.types.browser_rendering import SnapshotCreateResponse
```
Methods:
-- client.security_center.insights.type.get(\*, account_id, zone_id, \*\*params) -> Optional[TypeGetResponse]
-
-# BrowserRendering
+- client.browser_rendering.snapshot.create(\*, account_id, \*\*params) -> Optional[SnapshotCreateResponse]
-## Content
+## Json
Types:
```python
-from cloudflare.types.browser_rendering import ContentCreateResponse
+from cloudflare.types.browser_rendering import JsonCreateResponse
```
Methods:
-- client.browser_rendering.content.create(\*, account_id, \*\*params) -> str
-
-## PDF
-
-Methods:
-
-- client.browser_rendering.pdf.create(\*, account_id, \*\*params) -> BinaryAPIResponse
+- client.browser_rendering.json.create(\*, account_id, \*\*params) -> JsonCreateResponse
-## Scrape
+## Links
Types:
```python
-from cloudflare.types.browser_rendering import ScrapeCreateResponse
+from cloudflare.types.browser_rendering import LinkCreateResponse
```
Methods:
-- client.browser_rendering.scrape.create(\*, account_id, \*\*params) -> ScrapeCreateResponse
+- client.browser_rendering.links.create(\*, account_id, \*\*params) -> LinkCreateResponse
-## Screenshot
+## Markdown
Types:
```python
-from cloudflare.types.browser_rendering import ScreenshotCreateResponse
+from cloudflare.types.browser_rendering import MarkdownCreateResponse
```
Methods:
-- client.browser_rendering.screenshot.create(\*, account_id, \*\*params) -> ScreenshotCreateResponse
+- client.browser_rendering.markdown.create(\*, account_id, \*\*params) -> str
-## Snapshot
+## Crawl
Types:
```python
-from cloudflare.types.browser_rendering import SnapshotCreateResponse
+from cloudflare.types.browser_rendering import (
+ CrawlCreateResponse,
+ CrawlDeleteResponse,
+ CrawlGetResponse,
+)
```
Methods:
-- client.browser_rendering.snapshot.create(\*, account_id, \*\*params) -> Optional[SnapshotCreateResponse]
+- 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
-## Json
+## Devtools
+
+### Session
Types:
```python
-from cloudflare.types.browser_rendering import JsonCreateResponse
+from cloudflare.types.browser_rendering.devtools import SessionListResponse, SessionGetResponse
```
Methods:
-- client.browser_rendering.json.create(\*, account_id, \*\*params) -> JsonCreateResponse
+- client.browser_rendering.devtools.session.list(\*, account_id, \*\*params) -> SessionListResponse
+- client.browser_rendering.devtools.session.get(session_id, \*, account_id) -> Optional[SessionGetResponse]
-## Links
+### Browser
Types:
```python
-from cloudflare.types.browser_rendering import LinkCreateResponse
+from cloudflare.types.browser_rendering.devtools import (
+ BrowserCreateResponse,
+ BrowserDeleteResponse,
+ BrowserProtocolResponse,
+ BrowserVersionResponse,
+)
```
Methods:
-- client.browser_rendering.links.create(\*, account_id, \*\*params) -> LinkCreateResponse
+- 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
-## Markdown
+#### Page
+
+Methods:
+
+- client.browser_rendering.devtools.browser.page.get(target_id, \*, account_id, session_id) -> None
+
+#### Targets
Types:
```python
-from cloudflare.types.browser_rendering import MarkdownCreateResponse
+from cloudflare.types.browser_rendering.devtools.browser import (
+ TargetCreateResponse,
+ TargetListResponse,
+ TargetActivateResponse,
+ TargetGetResponse,
+)
```
Methods:
-- client.browser_rendering.markdown.create(\*, account_id, \*\*params) -> str
+- 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
# CustomPages
@@ -10872,9 +11413,30 @@ from cloudflare.types.custom_pages import (
Methods:
-- 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]
+- 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]
+
+## Assets
+
+Types:
+
+```python
+from cloudflare.types.custom_pages import (
+ AssetCreateResponse,
+ AssetUpdateResponse,
+ AssetListResponse,
+ AssetGetResponse,
+)
+```
+
+Methods:
+
+- client.custom_pages.assets.create(\*, account_id, zone_id, \*\*params) -> Optional[AssetCreateResponse]
+- client.custom_pages.assets.update(asset_name, \*, account_id, zone_id, \*\*params) -> Optional[AssetUpdateResponse]
+- client.custom_pages.assets.list(\*, account_id, zone_id, \*\*params) -> SyncV4PagePaginationArray[AssetListResponse]
+- client.custom_pages.assets.delete(asset_name, \*, account_id, zone_id) -> None
+- client.custom_pages.assets.get(asset_name, \*, account_id, zone_id) -> Optional[AssetGetResponse]
# SecretsStore
@@ -10883,18 +11445,14 @@ Methods:
Types:
```python
-from cloudflare.types.secrets_store import (
- StoreCreateResponse,
- StoreListResponse,
- StoreDeleteResponse,
-)
+from cloudflare.types.secrets_store import StoreCreateResponse, StoreListResponse
```
Methods:
-- client.secrets_store.stores.create(\*, account_id, \*\*params) -> SyncSinglePage[StoreCreateResponse]
+- client.secrets_store.stores.create(\*, account_id, \*\*params) -> Optional[StoreCreateResponse]
- client.secrets_store.stores.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[StoreListResponse]
-- client.secrets_store.stores.delete(store_id, \*, account_id) -> Optional[StoreDeleteResponse]
+- client.secrets_store.stores.delete(store_id, \*, account_id) -> object
### Secrets
@@ -10904,8 +11462,6 @@ Types:
from cloudflare.types.secrets_store.stores import (
SecretCreateResponse,
SecretListResponse,
- SecretDeleteResponse,
- SecretBulkDeleteResponse,
SecretDuplicateResponse,
SecretEditResponse,
SecretGetResponse,
@@ -10916,8 +11472,8 @@ Methods:
- 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.delete(secret_id, \*, account_id, store_id) -> object
+- client.secrets_store.stores.secrets.bulk_delete(store_id, \*, account_id) -> object
- 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]
@@ -10958,7 +11514,7 @@ Methods:
- 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.delete_v1(pipeline_id, \*, account_id) -> object
- 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]
@@ -10976,7 +11532,7 @@ Methods:
- 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.delete(sink_id, \*, account_id, \*\*params) -> object
- client.pipelines.sinks.get(sink_id, \*, account_id) -> SinkGetResponse
## Streams
@@ -10997,7 +11553,7 @@ Methods:
- 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.delete(stream_id, \*, account_id, \*\*params) -> object
- client.pipelines.streams.get(stream_id, \*, account_id) -> StreamGetResponse
# SchemaValidation
diff --git a/pyproject.toml b/pyproject.toml
index a5a2adb78ec..2375f19d098 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"
diff --git a/src/cloudflare/_client.py b/src/cloudflare/_client.py
index edc473185de..03cb74b4e69 100644
--- a/src/cloudflare/_client.py
+++ b/src/cloudflare/_client.py
@@ -69,7 +69,6 @@
aisearch,
alerting,
firewall,
- rulesets,
snippets,
spectrum,
hostnames,
@@ -99,6 +98,7 @@
security_txt,
abuse_reports,
email_routing,
+ email_sending,
magic_transit,
organizations,
secrets_store,
@@ -112,22 +112,24 @@
durable_objects,
r2_data_catalog,
request_tracers,
- security_center,
brand_protection,
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,
@@ -166,7 +168,6 @@
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
@@ -180,7 +181,6 @@
from .resources.aisearch.aisearch import AISearchResource, AsyncAISearchResource
from .resources.alerting.alerting import AlertingResource, AsyncAlertingResource
from .resources.firewall.firewall import FirewallResource, AsyncFirewallResource
- 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
@@ -205,11 +205,13 @@
from .resources.page_shield.page_shield import PageShieldResource, AsyncPageShieldResource
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.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
@@ -225,15 +227,16 @@
from .resources.durable_objects.durable_objects import DurableObjectsResource, AsyncDurableObjectsResource
from .resources.r2_data_catalog.r2_data_catalog import R2DataCatalogResource, AsyncR2DataCatalogResource
from .resources.request_tracers.request_tracers import RequestTracersResource, AsyncRequestTracersResource
- from .resources.security_center.security_center import SecurityCenterResource, AsyncSecurityCenterResource
from .resources.brand_protection.brand_protection import BrandProtectionResource, AsyncBrandProtectionResource
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.google_tag_gateway.google_tag_gateway import GoogleTagGatewayResource, AsyncGoogleTagGatewayResource
from .resources.custom_certificates.custom_certificates import (
CustomCertificatesResource,
AsyncCustomCertificatesResource,
@@ -242,6 +245,10 @@
NetworkInterconnectsResource,
AsyncNetworkInterconnectsResource,
)
+ from .resources.vulnerability_scanner.vulnerability_scanner import (
+ VulnerabilityScannerResource,
+ AsyncVulnerabilityScannerResource,
+ )
from .resources.workers_for_platforms.workers_for_platforms import (
WorkersForPlatformsResource,
AsyncWorkersForPlatformsResource,
@@ -483,6 +490,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
@@ -591,12 +604,6 @@ def page_shield(self) -> PageShieldResource:
return PageShieldResource(self)
- @cached_property
- def rulesets(self) -> RulesetsResource:
- from .resources.rulesets import RulesetsResource
-
- return RulesetsResource(self)
-
@cached_property
def url_normalization(self) -> URLNormalizationResource:
from .resources.url_normalization import URLNormalizationResource
@@ -783,6 +790,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 +820,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 +916,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
@@ -927,12 +952,6 @@ def aisearch(self) -> AISearchResource:
return AISearchResource(self)
- @cached_property
- def security_center(self) -> SecurityCenterResource:
- from .resources.security_center import SecurityCenterResource
-
- return SecurityCenterResource(self)
-
@cached_property
def browser_rendering(self) -> BrowserRenderingResource:
from .resources.browser_rendering import BrowserRenderingResource
@@ -1349,6 +1368,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
@@ -1457,12 +1482,6 @@ def page_shield(self) -> AsyncPageShieldResource:
return AsyncPageShieldResource(self)
- @cached_property
- def rulesets(self) -> AsyncRulesetsResource:
- from .resources.rulesets import AsyncRulesetsResource
-
- return AsyncRulesetsResource(self)
-
@cached_property
def url_normalization(self) -> AsyncURLNormalizationResource:
from .resources.url_normalization import AsyncURLNormalizationResource
@@ -1649,6 +1668,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 +1698,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 +1794,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
@@ -1793,12 +1830,6 @@ def aisearch(self) -> AsyncAISearchResource:
return AsyncAISearchResource(self)
- @cached_property
- def security_center(self) -> AsyncSecurityCenterResource:
- from .resources.security_center import AsyncSecurityCenterResource
-
- return AsyncSecurityCenterResource(self)
-
@cached_property
def browser_rendering(self) -> AsyncBrowserRenderingResource:
from .resources.browser_rendering import AsyncBrowserRenderingResource
@@ -2143,6 +2174,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
@@ -2251,12 +2288,6 @@ def page_shield(self) -> page_shield.PageShieldResourceWithRawResponse:
return PageShieldResourceWithRawResponse(self._client.page_shield)
- @cached_property
- def rulesets(self) -> rulesets.RulesetsResourceWithRawResponse:
- from .resources.rulesets import RulesetsResourceWithRawResponse
-
- return RulesetsResourceWithRawResponse(self._client.rulesets)
-
@cached_property
def url_normalization(self) -> url_normalization.URLNormalizationResourceWithRawResponse:
from .resources.url_normalization import URLNormalizationResourceWithRawResponse
@@ -2443,6 +2474,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 +2506,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 +2602,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
@@ -2589,12 +2638,6 @@ def aisearch(self) -> aisearch.AISearchResourceWithRawResponse:
return AISearchResourceWithRawResponse(self._client.aisearch)
- @cached_property
- def security_center(self) -> security_center.SecurityCenterResourceWithRawResponse:
- from .resources.security_center import SecurityCenterResourceWithRawResponse
-
- return SecurityCenterResourceWithRawResponse(self._client.security_center)
-
@cached_property
def browser_rendering(self) -> browser_rendering.BrowserRenderingResourceWithRawResponse:
from .resources.browser_rendering import BrowserRenderingResourceWithRawResponse
@@ -2764,6 +2807,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
@@ -2872,12 +2921,6 @@ def page_shield(self) -> page_shield.AsyncPageShieldResourceWithRawResponse:
return AsyncPageShieldResourceWithRawResponse(self._client.page_shield)
- @cached_property
- def rulesets(self) -> rulesets.AsyncRulesetsResourceWithRawResponse:
- from .resources.rulesets import AsyncRulesetsResourceWithRawResponse
-
- return AsyncRulesetsResourceWithRawResponse(self._client.rulesets)
-
@cached_property
def url_normalization(self) -> url_normalization.AsyncURLNormalizationResourceWithRawResponse:
from .resources.url_normalization import AsyncURLNormalizationResourceWithRawResponse
@@ -3064,6 +3107,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 +3139,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 +3235,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
@@ -3210,12 +3271,6 @@ def aisearch(self) -> aisearch.AsyncAISearchResourceWithRawResponse:
return AsyncAISearchResourceWithRawResponse(self._client.aisearch)
- @cached_property
- def security_center(self) -> security_center.AsyncSecurityCenterResourceWithRawResponse:
- from .resources.security_center import AsyncSecurityCenterResourceWithRawResponse
-
- return AsyncSecurityCenterResourceWithRawResponse(self._client.security_center)
-
@cached_property
def browser_rendering(self) -> browser_rendering.AsyncBrowserRenderingResourceWithRawResponse:
from .resources.browser_rendering import AsyncBrowserRenderingResourceWithRawResponse
@@ -3385,6 +3440,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
@@ -3493,12 +3554,6 @@ def page_shield(self) -> page_shield.PageShieldResourceWithStreamingResponse:
return PageShieldResourceWithStreamingResponse(self._client.page_shield)
- @cached_property
- def rulesets(self) -> rulesets.RulesetsResourceWithStreamingResponse:
- from .resources.rulesets import RulesetsResourceWithStreamingResponse
-
- return RulesetsResourceWithStreamingResponse(self._client.rulesets)
-
@cached_property
def url_normalization(self) -> url_normalization.URLNormalizationResourceWithStreamingResponse:
from .resources.url_normalization import URLNormalizationResourceWithStreamingResponse
@@ -3685,6 +3740,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 +3772,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 +3868,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
@@ -3831,12 +3904,6 @@ def aisearch(self) -> aisearch.AISearchResourceWithStreamingResponse:
return AISearchResourceWithStreamingResponse(self._client.aisearch)
- @cached_property
- def security_center(self) -> security_center.SecurityCenterResourceWithStreamingResponse:
- from .resources.security_center import SecurityCenterResourceWithStreamingResponse
-
- return SecurityCenterResourceWithStreamingResponse(self._client.security_center)
-
@cached_property
def browser_rendering(self) -> browser_rendering.BrowserRenderingResourceWithStreamingResponse:
from .resources.browser_rendering import BrowserRenderingResourceWithStreamingResponse
@@ -4008,6 +4075,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
@@ -4116,12 +4189,6 @@ def page_shield(self) -> page_shield.AsyncPageShieldResourceWithStreamingRespons
return AsyncPageShieldResourceWithStreamingResponse(self._client.page_shield)
- @cached_property
- def rulesets(self) -> rulesets.AsyncRulesetsResourceWithStreamingResponse:
- from .resources.rulesets import AsyncRulesetsResourceWithStreamingResponse
-
- return AsyncRulesetsResourceWithStreamingResponse(self._client.rulesets)
-
@cached_property
def url_normalization(self) -> url_normalization.AsyncURLNormalizationResourceWithStreamingResponse:
from .resources.url_normalization import AsyncURLNormalizationResourceWithStreamingResponse
@@ -4310,6 +4377,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 +4413,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 +4509,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,
@@ -4462,12 +4547,6 @@ def aisearch(self) -> aisearch.AsyncAISearchResourceWithStreamingResponse:
return AsyncAISearchResourceWithStreamingResponse(self._client.aisearch)
- @cached_property
- def security_center(self) -> security_center.AsyncSecurityCenterResourceWithStreamingResponse:
- from .resources.security_center import AsyncSecurityCenterResourceWithStreamingResponse
-
- return AsyncSecurityCenterResourceWithStreamingResponse(self._client.security_center)
-
@cached_property
def browser_rendering(self) -> browser_rendering.AsyncBrowserRenderingResourceWithStreamingResponse:
from .resources.browser_rendering import AsyncBrowserRenderingResourceWithStreamingResponse
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..2b4cbdb2f5a 100644
--- a/src/cloudflare/resources/abuse_reports/abuse_reports.py
+++ b/src/cloudflare/resources/abuse_reports/abuse_reports.py
@@ -273,7 +273,7 @@ def create(
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,
@@ -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
@@ -866,7 +869,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 +887,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.
@@ -929,6 +933,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,
@@ -1299,7 +1304,7 @@ async def create(
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,
@@ -1657,6 +1662,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 +1703,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
@@ -1892,7 +1900,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 +1918,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.
@@ -1955,6 +1964,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,
diff --git a/src/cloudflare/resources/abuse_reports/mitigations.py b/src/cloudflare/resources/abuse_reports/mitigations.py
index 298b58d4143..854d18824d2 100644
--- a/src/cloudflare/resources/abuse_reports/mitigations.py
+++ b/src/cloudflare/resources/abuse_reports/mitigations.py
@@ -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",
@@ -230,6 +231,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",
diff --git a/src/cloudflare/resources/accounts/logs/audit.py b/src/cloudflare/resources/accounts/logs/audit.py
index fd663c7cc68..2eef3ce2f8d 100644
--- a/src/cloudflare/resources/accounts/logs/audit.py
+++ b/src/cloudflare/resources/accounts/logs/audit.py
@@ -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.
@@ -226,13 +221,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.
diff --git a/src/cloudflare/resources/accounts/members.py b/src/cloudflare/resources/accounts/members.py
index 61eb3ff9fc2..015215bb852 100644
--- a/src/cloudflare/resources/accounts/members.py
+++ b/src/cloudflare/resources/accounts/members.py
@@ -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
@@ -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
@@ -461,6 +469,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
@@ -496,6 +508,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
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/custom_trust_store.py b/src/cloudflare/resources/acm/custom_trust_store.py
new file mode 100644
index 00000000000..d7b87885150
--- /dev/null
+++ b/src/cloudflare/resources/acm/custom_trust_store.py
@@ -0,0 +1,540 @@
+# 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 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,
+ 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 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/custom_trust_store",
+ 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,
+ 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 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}/acm/custom_trust_store",
+ 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,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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 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(
+ f"/zones/{zone_id}/acm/custom_trust_store/{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,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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 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(
+ f"/zones/{zone_id}/acm/custom_trust_store/{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,
+ 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 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/custom_trust_store",
+ 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,
+ 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 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}/acm/custom_trust_store",
+ 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,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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 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(
+ f"/zones/{zone_id}/acm/custom_trust_store/{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,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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 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(
+ f"/zones/{zone_id}/acm/custom_trust_store/{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/ai/authors.py b/src/cloudflare/resources/ai/authors.py
index 8f3ceeb8486..e6b3360823b 100644
--- a/src/cloudflare/resources/ai/authors.py
+++ b/src/cloudflare/resources/ai/authors.py
@@ -51,7 +51,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
@@ -106,7 +106,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
diff --git a/src/cloudflare/resources/ai/finetunes/assets.py b/src/cloudflare/resources/ai/finetunes/assets.py
index 50ce6bb6cae..ada060fb7b2 100644
--- a/src/cloudflare/resources/ai/finetunes/assets.py
+++ b/src/cloudflare/resources/ai/finetunes/assets.py
@@ -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
@@ -130,7 +130,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
diff --git a/src/cloudflare/resources/ai/finetunes/finetunes.py b/src/cloudflare/resources/ai/finetunes/finetunes.py
index e998763b6f2..ed583d0a69e 100644
--- a/src/cloudflare/resources/ai/finetunes/finetunes.py
+++ b/src/cloudflare/resources/ai/finetunes/finetunes.py
@@ -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
@@ -131,7 +131,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
@@ -201,7 +201,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
@@ -247,7 +247,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
diff --git a/src/cloudflare/resources/ai/finetunes/public.py b/src/cloudflare/resources/ai/finetunes/public.py
index 0e8f9e74988..1f519ce3564 100644
--- a/src/cloudflare/resources/ai/finetunes/public.py
+++ b/src/cloudflare/resources/ai/finetunes/public.py
@@ -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
@@ -132,7 +132,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
diff --git a/src/cloudflare/resources/ai/models/models.py b/src/cloudflare/resources/ai/models/models.py
index 9d6d4f9c83d..c2f40e2e160 100644
--- a/src/cloudflare/resources/ai/models/models.py
+++ b/src/cloudflare/resources/ai/models/models.py
@@ -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
@@ -163,7 +163,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
diff --git a/src/cloudflare/resources/ai/models/schema.py b/src/cloudflare/resources/ai/models/schema.py
index 2f12236dd38..a041d762955 100644
--- a/src/cloudflare/resources/ai/models/schema.py
+++ b/src/cloudflare/resources/ai/models/schema.py
@@ -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"]
@@ -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
@@ -79,9 +80,9 @@ def get(
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]),
)
@@ -116,9 +117,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
@@ -141,9 +142,9 @@ async def get(
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..a312b56238e 100644
--- a/src/cloudflare/resources/ai/tasks.py
+++ b/src/cloudflare/resources/ai/tasks.py
@@ -51,7 +51,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
@@ -106,7 +106,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
diff --git a/src/cloudflare/resources/ai/to_markdown.py b/src/cloudflare/resources/ai/to_markdown.py
index 15cab8aa9e4..a4792606100 100644
--- a/src/cloudflare/resources/ai/to_markdown.py
+++ b/src/cloudflare/resources/ai/to_markdown.py
@@ -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
@@ -92,7 +92,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
@@ -156,7 +156,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
@@ -191,7 +191,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
diff --git a/src/cloudflare/resources/ai_gateway/ai_gateway.py b/src/cloudflare/resources/ai_gateway/ai_gateway.py
index 545ad9b28e6..608295f937f 100644
--- a/src/cloudflare/resources/ai_gateway/ai_gateway.py
+++ b/src/cloudflare/resources/ai_gateway/ai_gateway.py
@@ -144,13 +144,16 @@ def create(
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
@@ -185,13 +197,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,
@@ -216,17 +231,20 @@ def update(
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 +254,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
@@ -262,17 +289,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,
@@ -302,7 +332,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
@@ -350,7 +380,7 @@ def delete(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AIGatewayDeleteResponse:
"""
- Delete a Gateway
+ Deletes an AI Gateway dataset.
Args:
id: gateway id
@@ -392,7 +422,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
@@ -480,13 +510,16 @@ async def create(
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 +529,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
@@ -521,13 +563,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,
@@ -552,17 +597,20 @@ async def update(
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 +620,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
@@ -598,17 +655,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,
@@ -638,7 +698,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
@@ -686,7 +746,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
@@ -728,7 +788,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
diff --git a/src/cloudflare/resources/ai_gateway/datasets.py b/src/cloudflare/resources/ai_gateway/datasets.py
index bb256a33205..91601b7a385 100644
--- a/src/cloudflare/resources/ai_gateway/datasets.py
+++ b/src/cloudflare/resources/ai_gateway/datasets.py
@@ -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
@@ -119,7 +119,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
@@ -176,7 +176,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
@@ -231,7 +231,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
@@ -276,7 +276,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
@@ -344,7 +344,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
@@ -398,7 +398,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
@@ -455,7 +455,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
@@ -510,7 +510,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
@@ -555,7 +555,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
diff --git a/src/cloudflare/resources/ai_gateway/dynamic_routing.py b/src/cloudflare/resources/ai_gateway/dynamic_routing.py
index 719f7e12ff7..d4ad8c97251 100644
--- a/src/cloudflare/resources/ai_gateway/dynamic_routing.py
+++ b/src/cloudflare/resources/ai_gateway/dynamic_routing.py
@@ -233,7 +233,6 @@ def create_deployment(
*,
account_id: str,
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.
@@ -263,10 +262,7 @@ def create_deployment(
return self._post(
f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/deployments",
body=maybe_transform(
- {
- "comment": comment,
- "version_id": version_id,
- },
+ {"version_id": version_id},
dynamic_routing_create_deployment_params.DynamicRoutingCreateDeploymentParams,
),
options=make_request_options(
@@ -287,7 +283,6 @@ def create_version(
*,
account_id: str,
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.
@@ -317,11 +312,7 @@ def create_version(
return self._post(
f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/versions",
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,
@@ -696,7 +687,6 @@ async def create_deployment(
*,
account_id: str,
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.
@@ -726,10 +716,7 @@ async def create_deployment(
return await self._post(
f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/deployments",
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(
@@ -750,7 +737,6 @@ async def create_version(
*,
account_id: str,
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.
@@ -780,11 +766,7 @@ async def create_version(
return await self._post(
f"/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/versions",
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,
diff --git a/src/cloudflare/resources/ai_gateway/evaluations.py b/src/cloudflare/resources/ai_gateway/evaluations.py
index e3d9fd87309..b466e084495 100644
--- a/src/cloudflare/resources/ai_gateway/evaluations.py
+++ b/src/cloudflare/resources/ai_gateway/evaluations.py
@@ -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
@@ -119,7 +119,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
@@ -174,7 +174,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
@@ -219,7 +219,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
@@ -287,7 +287,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
@@ -342,7 +342,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
@@ -397,7 +397,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
@@ -442,7 +442,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
diff --git a/src/cloudflare/resources/ai_gateway/logs.py b/src/cloudflare/resources/ai_gateway/logs.py
index 8518d36781c..0ea6559c96b 100644
--- a/src/cloudflare/resources/ai_gateway/logs.py
+++ b/src/cloudflare/resources/ai_gateway/logs.py
@@ -236,7 +236,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
@@ -289,7 +289,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
@@ -334,7 +334,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
@@ -375,7 +375,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
@@ -610,7 +610,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
@@ -663,7 +663,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
@@ -708,7 +708,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
@@ -749,7 +749,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
diff --git a/src/cloudflare/resources/ai_gateway/provider_configs.py b/src/cloudflare/resources/ai_gateway/provider_configs.py
index 60c7fc5f891..2e75c14bdc3 100644
--- a/src/cloudflare/resources/ai_gateway/provider_configs.py
+++ b/src/cloudflare/resources/ai_gateway/provider_configs.py
@@ -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
@@ -122,7 +122,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
@@ -199,7 +199,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
@@ -255,7 +255,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
diff --git a/src/cloudflare/resources/ai_gateway/urls.py b/src/cloudflare/resources/ai_gateway/urls.py
index 8f660faa164..988e21ecc24 100644
--- a/src/cloudflare/resources/ai_gateway/urls.py
+++ b/src/cloudflare/resources/ai_gateway/urls.py
@@ -56,7 +56,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
@@ -122,7 +122,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
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..a555deae5be 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,14 +15,6 @@
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 ...._compat import cached_property
@@ -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)
@@ -88,92 +76,115 @@ def create(
*,
account_id: str,
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[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: 3600 (1h), 7200
+ (2h), 14400 (4h), 21600 (6h), 43200 (12h), 86400 (24h).
extra_headers: Send extra headers
@@ -202,26 +222,33 @@ def create(
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,
),
@@ -240,34 +267,40 @@ def update(
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",
- "",
+ 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 +310,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[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 +420,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: 3600 (1h), 7200
+ (2h), 14400 (4h), 21600 (6h), 43200 (12h), 86400 (24h).
extra_headers: Send extra headers
@@ -399,19 +458,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,
@@ -433,6 +496,9 @@ def list(
self,
*,
account_id: str,
+ 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 +513,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
@@ -469,6 +539,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,
@@ -491,11 +564,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
@@ -530,12 +604,16 @@ def chat_completions(
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 +644,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
@@ -612,11 +691,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
@@ -647,8 +727,9 @@ def search(
id: str,
*,
account_id: str,
- messages: Iterable[instance_search_params.Message],
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 +738,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
@@ -678,8 +763,9 @@ def search(
f"/accounts/{account_id}/ai-search/instances/{id}/search",
body=maybe_transform(
{
- "messages": messages,
"aisearch_options": aisearch_options,
+ "messages": messages,
+ "query": query,
},
instance_search_params.InstanceSearchParams,
),
@@ -706,10 +792,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
@@ -737,10 +823,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)
@@ -769,92 +851,115 @@ async def create(
*,
account_id: str,
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[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 +967,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: 3600 (1h), 7200
+ (2h), 14400 (4h), 21600 (6h), 43200 (12h), 86400 (24h).
extra_headers: Send extra headers
@@ -883,26 +997,33 @@ async def create(
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,
),
@@ -921,34 +1042,40 @@ async def update(
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",
- "",
+ 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 +1085,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[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 +1195,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: 3600 (1h), 7200
+ (2h), 14400 (4h), 21600 (6h), 43200 (12h), 86400 (24h).
extra_headers: Send extra headers
@@ -1080,19 +1233,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,
@@ -1114,6 +1271,9 @@ def list(
self,
*,
account_id: str,
+ 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 +1288,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
@@ -1150,6 +1314,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,
@@ -1172,11 +1339,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
@@ -1211,12 +1379,16 @@ async def chat_completions(
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 +1419,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
@@ -1293,11 +1466,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
@@ -1328,8 +1502,9 @@ async def search(
id: str,
*,
account_id: str,
- messages: Iterable[instance_search_params.Message],
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 +1513,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
@@ -1359,8 +1538,9 @@ async def search(
f"/accounts/{account_id}/ai-search/instances/{id}/search",
body=await async_maybe_transform(
{
- "messages": messages,
"aisearch_options": aisearch_options,
+ "messages": messages,
+ "query": query,
},
instance_search_params.InstanceSearchParams,
),
@@ -1387,10 +1567,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
@@ -1446,10 +1626,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 +1660,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 +1694,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 +1728,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..a9bfcf9eb60 100644
--- a/src/cloudflare/resources/aisearch/instances/jobs.py
+++ b/src/cloudflare/resources/aisearch/instances/jobs.py
@@ -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
@@ -53,6 +53,7 @@ def create(
id: str,
*,
account_id: 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,
@@ -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
@@ -80,6 +81,7 @@ def create(
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",
+ body=maybe_transform({"description": description}, job_create_params.JobCreateParams),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -105,10 +107,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
@@ -155,10 +157,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
@@ -202,10 +204,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
@@ -266,6 +268,7 @@ async def create(
id: str,
*,
account_id: 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,
@@ -274,10 +277,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
@@ -293,6 +296,7 @@ async def create(
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",
+ body=await async_maybe_transform({"description": description}, job_create_params.JobCreateParams),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -318,10 +322,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
@@ -368,10 +372,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
@@ -415,10 +419,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
diff --git a/src/cloudflare/resources/aisearch/tokens.py b/src/cloudflare/resources/aisearch/tokens.py
index 1834a9b0c6a..94654a58c85 100644
--- a/src/cloudflare/resources/aisearch/tokens.py
+++ b/src/cloudflare/resources/aisearch/tokens.py
@@ -3,6 +3,7 @@
from __future__ import annotations
from typing import Type, cast
+from typing_extensions import Literal
import httpx
@@ -64,7 +65,7 @@ def create(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> TokenCreateResponse:
"""
- Create new tokens.
+ Create a new tokens.
Args:
extra_headers: Send extra headers
@@ -152,6 +153,8 @@ def list(
self,
*,
account_id: str,
+ order_by: Literal["created_at"] | Omit = omit,
+ order_by_direction: Literal["asc", "desc"] | Omit = omit,
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.
@@ -165,6 +168,10 @@ def list(
List tokens.
Args:
+ order_by: Order By Column Name
+
+ order_by_direction: Order By Direction
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -185,6 +192,8 @@ def list(
timeout=timeout,
query=maybe_transform(
{
+ "order_by": order_by,
+ "order_by_direction": order_by_direction,
"page": page,
"per_page": per_page,
},
@@ -310,7 +319,7 @@ async def create(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> TokenCreateResponse:
"""
- Create new tokens.
+ Create a new tokens.
Args:
extra_headers: Send extra headers
@@ -398,6 +407,8 @@ def list(
self,
*,
account_id: str,
+ order_by: Literal["created_at"] | Omit = omit,
+ order_by_direction: Literal["asc", "desc"] | Omit = omit,
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.
@@ -411,6 +422,10 @@ def list(
List tokens.
Args:
+ order_by: Order By Column Name
+
+ order_by_direction: Order By Direction
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -431,6 +446,8 @@ def list(
timeout=timeout,
query=maybe_transform(
{
+ "order_by": order_by,
+ "order_by_direction": order_by_direction,
"page": page,
"per_page": per_page,
},
diff --git a/src/cloudflare/resources/alerting/policies.py b/src/cloudflare/resources/alerting/policies.py
index 8f8115ecd60..64b96549788 100644
--- a/src/cloudflare/resources/alerting/policies.py
+++ b/src/cloudflare/resources/alerting/policies.py
@@ -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",
@@ -221,6 +222,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",
@@ -513,6 +515,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",
@@ -662,6 +665,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",
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_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..bd62e5e568b 100644
--- a/src/cloudflare/resources/api_gateway/configurations.py
+++ b/src/cloudflare/resources/api_gateway/configurations.py
@@ -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.
@@ -105,7 +107,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.
@@ -169,8 +172,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.
@@ -219,7 +224,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.
diff --git a/src/cloudflare/resources/api_gateway/expression_template/fallthrough.py b/src/cloudflare/resources/api_gateway/expression_template/fallthrough.py
index 1434470cfad..8f4d2735cd0 100644
--- a/src/cloudflare/resources/api_gateway/expression_template/fallthrough.py
+++ b/src/cloudflare/resources/api_gateway/expression_template/fallthrough.py
@@ -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.
@@ -120,8 +122,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.
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..4f2280b9c56
--- /dev/null
+++ b/src/cloudflare/resources/api_gateway/labels/labels.py
@@ -0,0 +1,312 @@
+# 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 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,
+ 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 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/labels",
+ 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,
+ 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 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/labels",
+ 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..fef15b370e5
--- /dev/null
+++ b/src/cloudflare/resources/api_gateway/labels/managed/managed.py
@@ -0,0 +1,234 @@
+# 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 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,
+ 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 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(
+ f"/zones/{zone_id}/api_gateway/labels/managed/{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,
+ 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 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(
+ f"/zones/{zone_id}/api_gateway/labels/managed/{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..edf21582d99
--- /dev/null
+++ b/src/cloudflare/resources/api_gateway/labels/managed/resources/operation.py
@@ -0,0 +1,198 @@
+# 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 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,
+ 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 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(
+ f"/zones/{zone_id}/api_gateway/labels/managed/{name}/resources/operation",
+ 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,
+ 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 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(
+ f"/zones/{zone_id}/api_gateway/labels/managed/{name}/resources/operation",
+ 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..57532ca8f3a
--- /dev/null
+++ b/src/cloudflare/resources/api_gateway/labels/user/resources/operation.py
@@ -0,0 +1,198 @@
+# 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 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,
+ 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 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(
+ f"/zones/{zone_id}/api_gateway/labels/user/{name}/resources/operation",
+ 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,
+ 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 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(
+ f"/zones/{zone_id}/api_gateway/labels/user/{name}/resources/operation",
+ 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..ee4a303db37
--- /dev/null
+++ b/src/cloudflare/resources/api_gateway/labels/user/user.py
@@ -0,0 +1,768 @@
+# 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 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,
+ 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 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(
+ f"/zones/{zone_id}/api_gateway/labels/user/{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,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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 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(
+ f"/zones/{zone_id}/api_gateway/labels/user/{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,
+ 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 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/labels/user",
+ 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,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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 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/labels/user",
+ 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,
+ 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 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(
+ f"/zones/{zone_id}/api_gateway/labels/user/{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,
+ 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 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(
+ f"/zones/{zone_id}/api_gateway/labels/user/{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,
+ 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 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(
+ f"/zones/{zone_id}/api_gateway/labels/user/{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,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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 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(
+ f"/zones/{zone_id}/api_gateway/labels/user/{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,
+ 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 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/labels/user",
+ 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,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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 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/labels/user",
+ 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,
+ 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 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(
+ f"/zones/{zone_id}/api_gateway/labels/user/{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,
+ 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 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(
+ f"/zones/{zone_id}/api_gateway/labels/user/{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..8ad2bb6e87c
--- /dev/null
+++ b/src/cloudflare/resources/api_gateway/operations/labels.py
@@ -0,0 +1,775 @@
+# 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 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,
+ 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 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(
+ f"/zones/{zone_id}/api_gateway/operations/{operation_id}/labels",
+ 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,
+ 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 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}/labels",
+ 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,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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 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}/labels",
+ 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,
+ 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 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/labels",
+ 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,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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 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/labels",
+ 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,
+ 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 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/labels",
+ 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,
+ 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 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(
+ f"/zones/{zone_id}/api_gateway/operations/{operation_id}/labels",
+ 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,
+ 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 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}/labels",
+ 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,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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 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}/labels",
+ 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,
+ 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 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/labels",
+ 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,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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 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/labels",
+ 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,
+ 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 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/labels",
+ 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..31189308551 100644
--- a/src/cloudflare/resources/api_gateway/operations/operations.py
+++ b/src/cloudflare/resources/api_gateway/operations/operations.py
@@ -7,6 +7,14 @@
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 ...._compat import cached_property
@@ -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)
@@ -152,7 +164,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.
@@ -223,8 +236,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.
@@ -307,7 +322,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.
@@ -344,7 +360,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.
@@ -382,6 +399,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)
@@ -489,7 +510,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.
@@ -560,8 +582,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.
@@ -644,7 +668,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.
@@ -681,7 +706,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.
@@ -741,6 +767,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 +799,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 +831,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 +863,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/user_schemas/hosts.py b/src/cloudflare/resources/api_gateway/user_schemas/hosts.py
index 01861b64473..d193678ec7d 100644
--- a/src/cloudflare/resources/api_gateway/user_schemas/hosts.py
+++ b/src/cloudflare/resources/api_gateway/user_schemas/hosts.py
@@ -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.
@@ -136,8 +138,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.
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..346db5396d5 100644
--- a/src/cloudflare/resources/api_gateway/user_schemas/user_schemas.py
+++ b/src/cloudflare/resources/api_gateway/user_schemas/user_schemas.py
@@ -166,7 +166,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.
@@ -225,8 +226,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.
@@ -267,8 +270,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.
@@ -319,7 +324,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.
@@ -468,7 +474,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.
@@ -527,8 +534,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.
@@ -569,8 +578,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.
@@ -621,7 +632,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.
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/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/usage.py b/src/cloudflare/resources/billing/usage.py
new file mode 100644
index 00000000000..d9841c26684
--- /dev/null
+++ b/src/cloudflare/resources/billing/usage.py
@@ -0,0 +1,213 @@
+# 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 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,
+ 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 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/usage/paygo",
+ 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,
+ 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 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/usage/paygo",
+ 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/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/brand_protection.py b/src/cloudflare/resources/brand_protection/brand_protection.py
index efe44ec7d57..c28e5602df7 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,
@@ -70,6 +78,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:
"""
@@ -174,6 +186,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:
"""
@@ -288,6 +304,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 +336,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 +368,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 +399,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/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..d980660ebdd
--- /dev/null
+++ b/src/cloudflare/resources/brand_protection/v2/logo_matches.py
@@ -0,0 +1,217 @@
+# 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 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,
+ 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 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}/cloudforce-one/v2/brand-protection/logo/matches",
+ 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,
+ 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 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}/cloudforce-one/v2/brand-protection/logo/matches",
+ 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..5787bf1bed6
--- /dev/null
+++ b/src/cloudflare/resources/brand_protection/v2/logos.py
@@ -0,0 +1,417 @@
+# 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 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,
+ 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 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}/cloudforce-one/v2/brand-protection/logo/queries",
+ 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,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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 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(
+ f"/accounts/{account_id}/cloudforce-one/v2/brand-protection/logo/queries/{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,
+ 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 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}/cloudforce-one/v2/brand-protection/logo/queries",
+ 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,
+ 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 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}/cloudforce-one/v2/brand-protection/logo/queries",
+ 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,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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 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(
+ f"/accounts/{account_id}/cloudforce-one/v2/brand-protection/logo/queries/{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,
+ 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 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}/cloudforce-one/v2/brand-protection/logo/queries",
+ 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..8222b0ec167
--- /dev/null
+++ b/src/cloudflare/resources/brand_protection/v2/matches.py
@@ -0,0 +1,239 @@
+# 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 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,
+ 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 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}/cloudforce-one/v2/brand-protection/domain/matches",
+ 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,
+ 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 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}/cloudforce-one/v2/brand-protection/domain/matches",
+ 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..a632d5e3e35
--- /dev/null
+++ b/src/cloudflare/resources/brand_protection/v2/queries.py
@@ -0,0 +1,175 @@
+# 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 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,
+ 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 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}/cloudforce-one/v2/brand-protection/domain/queries",
+ 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,
+ 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 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}/cloudforce-one/v2/brand-protection/domain/queries",
+ 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/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/crawl.py b/src/cloudflare/resources/browser_rendering/crawl.py
new file mode 100644
index 00000000000..1429915bd07
--- /dev/null
+++ b/src/cloudflare/resources/browser_rendering/crawl.py
@@ -0,0 +1,1115 @@
+# 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 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,
+ 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 `