Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
53c2e1f
chore(api): update composite API spec
stainless-app[bot] Apr 15, 2026
e17fb79
codegen metadata
stainless-app[bot] Apr 15, 2026
33fd9e6
codegen metadata
stainless-app[bot] Apr 15, 2026
e7ee358
chore(api): update composite API spec
stainless-app[bot] Apr 15, 2026
5ec0a7b
feat: feat(radar): add AI markdown for agents and agent readiness end…
stainless-app[bot] Apr 15, 2026
435c73d
feat: feat(registrar): add registrar registrations list method on main
stainless-app[bot] Apr 15, 2026
919dbc1
codegen metadata
stainless-app[bot] Apr 15, 2026
1373bb4
feat: feat: enable treeshaking and client options for setting zone an…
stainless-app[bot] Apr 15, 2026
29a0e8f
feat: feat(api): Add mapping for `/dlp/settings` endpoint for DLP-454…
stainless-app[bot] Apr 15, 2026
c69cf24
codegen metadata
stainless-app[bot] Apr 15, 2026
7a61c6f
codegen metadata
stainless-app[bot] Apr 15, 2026
384f624
codegen metadata
stainless-app[bot] Apr 15, 2026
de3711e
codegen metadata
stainless-app[bot] Apr 15, 2026
458012e
feat: feat(ai_search): RAG-934 add namespace endpoints and remove non…
stainless-app[bot] Apr 15, 2026
6505fee
codegen metadata
stainless-app[bot] Apr 15, 2026
dd4f5d0
chore(api): update composite API spec
stainless-app[bot] Apr 15, 2026
ed35936
codegen metadata
stainless-app[bot] Apr 15, 2026
2685e87
codegen metadata
stainless-app[bot] Apr 16, 2026
1f4de90
chore(api): update composite API spec
stainless-app[bot] Apr 16, 2026
be02a41
chore(api): update composite API spec
stainless-app[bot] Apr 16, 2026
18a17f5
codegen metadata
stainless-app[bot] Apr 16, 2026
45b58ae
chore(internal): codegen related update
stainless-app[bot] Apr 16, 2026
becb369
codegen metadata
stainless-app[bot] Apr 16, 2026
926d1ec
chore(api): update composite API spec
stainless-app[bot] Apr 16, 2026
3a1b2f7
chore(api): update composite API spec
stainless-app[bot] Apr 17, 2026
8d31f23
codegen metadata
stainless-app[bot] Apr 17, 2026
ab9ac01
chore(api): update composite API spec
stainless-app[bot] Apr 17, 2026
ab4bf86
feat: chore: skip tests
stainless-app[bot] Apr 17, 2026
fc1a60d
feat: chore: trigger build
stainless-app[bot] Apr 17, 2026
905f27f
feat: fix: add test skips for custom_pages.assets, fix YAML syntax
stainless-app[bot] Apr 17, 2026
0d64642
chore(api): upload stainless config from cloudflare-config
stainless-app[bot] Apr 22, 2026
3b83baa
feat(api): api update
stainless-app[bot] Apr 19, 2026
802fde1
codegen metadata
stainless-app[bot] Apr 20, 2026
42c4dbf
chore(api): update composite API spec
stainless-app[bot] Apr 20, 2026
46a538c
codegen metadata
stainless-app[bot] Apr 20, 2026
0a576fa
chore(internal): version bump
stainless-app[bot] Apr 20, 2026
4560e3c
codegen metadata
stainless-app[bot] Apr 21, 2026
0fd3baf
chore(api): update composite API spec
stainless-app[bot] Apr 21, 2026
67db9e9
chore(api): update composite API spec
stainless-app[bot] Apr 21, 2026
fd0fca0
chore(api): update composite API spec
stainless-app[bot] Apr 21, 2026
c7b5b51
feat: feat(cache): Add origin cloud regions resource to docs/sdk for …
stainless-app[bot] Apr 21, 2026
90d72f0
codegen metadata
stainless-app[bot] Apr 22, 2026
6bf05ea
chore(api): update composite API spec
stainless-app[bot] Apr 22, 2026
0ee5719
chore(api): update composite API spec
stainless-app[bot] Apr 22, 2026
73ab202
codegen metadata
stainless-app[bot] Apr 22, 2026
13b6d32
Merge remote-tracking branch 'origin/next' into staging-next
musa-cf Apr 22, 2026
cb00d08
feat: feat(iam): add user_groups and user_group_members terraform res…
stainless-app[bot] Apr 22, 2026
4a89216
Merge remote-tracking branch 'origin/next' into staging-next
stainless-app[bot] Apr 22, 2026
511b508
chore(api): update composite API spec
stainless-app[bot] Apr 23, 2026
988df86
feat: chore: remove account_id and zone_id client options
stainless-app[bot] Apr 23, 2026
4e50276
codegen metadata
stainless-app[bot] Apr 23, 2026
6810580
feat: feat: add organization audit logs endpoint
stainless-app[bot] Apr 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 2184
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3d7d43f051a510c54ae71adb4b85cbb422565a40942cde4de0c3f8eb6ba8023b.yml
openapi_spec_hash: e85824f16c3ba923a34e514c06dac7cd
config_hash: a84b6a70b6374c30a50b477fe248eb3a
configured_endpoints: 2194
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0ce49e6bb0d3819f135b9a567b661205fdf5df21cff157eab2b7abd7b5b50347.yml
openapi_spec_hash: 512a5bb3a32860590c8949765605d65a
config_hash: 5367ae3e3a9a0d6578c2756965a99e3a
177 changes: 177 additions & 0 deletions CHANGELOG-v5.0.0-beta.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
# v5.0.0-beta.2

> This is a beta release. The API surface may change before the stable release.

Full diff: [`v5.0.0-beta.1...next`](https://github.com/cloudflare/cloudflare-python/compare/v5.0.0-beta.1...next)

This release adds 163 new methods across 4 new top-level resources and numerous sub-resource
expansions, restructures the `api.md` surface into per-resource files, and includes codegen
updates across all existing resources.

## General Changes

### Client-level `account_id` and `zone_id` configuration

You can now set `account_id` and `zone_id` once on the client instead of passing them to every
method call. When set, these values are used as defaults for all methods that accept them. You
can still override per-call by passing the parameter explicitly.

```python
from cloudflare import Cloudflare

# Set account_id once at the client level
client = Cloudflare(account_id="my-account-id")

# No need to pass account_id on every call
workers = client.workers.scripts.list()
rules = client.rules.lists.list()
```

Both options also read from environment variables:

- `account_id` from `CLOUDFLARE_ACCOUNT_ID`
- `zone_id` from `CLOUDFLARE_ZONE_ID`

```python
# Or configure via environment variables
# export CLOUDFLARE_ACCOUNT_ID=my-account-id
# export CLOUDFLARE_ZONE_ID=my-zone-id
client = Cloudflare()
```

All methods that previously required `account_id` or `zone_id` as a positional/keyword argument
now accept `None` as a default and fall back to the client-level value. If neither is set, a
`ValueError` is raised with a clear message.

## Breaking Changes

### Restructured Resources

- **AISearch**: `aisearch.instances.items` (`get`, `list`) has been replaced by the new
namespace-based architecture under `aisearch.namespaces.instances.items` (see New Resources
below)

- **Registrar**: `registrar.domains` (`get`, `list`, `update`) has been replaced by
`registrar.registrations` with expanded functionality including `create`, `edit`, `get`, `list`,
plus new `registrar.check`, `registrar.search`, `registrar.registration_status.get`, and
`registrar.update_status.get` methods

- **Custom Pages**: `custom_pages` (`get`, `list`, `update`) has been replaced by
`custom_pages.assets` (`create`, `delete`, `get`, `list`, `update`)

### Removed Methods

- `cloudforce_one.threat_events.delete`

## New API Resources

### Top-Level Resources

- **VulnerabilityScanner** -- Full CRUD for vulnerability scanning
- `credential_sets` -- `create`, `delete`, `edit`, `get`, `list`, `update`
- `credential_sets.credentials` -- `create`, `delete`, `edit`, `get`, `list`, `update`
- `scans` -- `create`, `get`, `list`
- `target_environments` -- `create`, `delete`, `edit`, `get`, `list`, `update`

- **GoogleTagGateway** -- Google Tag Gateway configuration
- `config` -- `get`, `update`

- **EmailSending** -- Email sending with subdomain management
- `send`, `send_raw`
- `subdomains` -- `create`, `delete`, `get`, `list`
- `subdomains.dns` -- `get`

- **ResourceTagging** -- Resource tagging and key/value management
- `list`
- `account_tags` -- `delete`, `get`, `update`
- `zone_tags` -- `delete`, `get`, `update`
- `keys` -- `list`
- `values` -- `list`

### New Sub-Resources on Existing Resources

- **AISearch** (restructured) -- Expanded namespace-based architecture
- `aisearch.namespaces` -- `create`, `delete`, `list`, `read`, `search`, `update`,
`chat_completions`
- `aisearch.namespaces.instances` -- `create`, `list`, `read`, `search`, `stats`, `update`,
`chat_completions`
- `aisearch.namespaces.instances.items` -- `chunks`, `create_or_update`, `delete`, `download`,
`get`, `list`, `logs`, `sync`, `upload`
- `aisearch.namespaces.instances.jobs` -- `create`, `get`, `list`, `logs`, `update`

- **APIGateway Labels** -- Label management for API Gateway operations
- `api_gateway.labels` -- `list`
- `api_gateway.labels.managed` -- `get`
- `api_gateway.labels.managed.resources.operation` -- `update`
- `api_gateway.labels.user` -- `bulk_create`, `bulk_delete`, `delete`, `edit`, `get`, `update`
- `api_gateway.labels.user.resources.operation` -- `update`
- `api_gateway.operations.labels` -- `bulk_create`, `bulk_delete`, `bulk_update`, `create`,
`delete`, `update`

- **BrowserRendering** -- DevTools and crawl APIs
- `browser_rendering.crawl` -- `create`, `delete`, `get`
- `browser_rendering.devtools.browser` -- `connect`, `create`, `delete`, `launch`, `protocol`,
`version`
- `browser_rendering.devtools.browser.page` -- `get`
- `browser_rendering.devtools.browser.targets` -- `activate`, `create`, `get`, `list`
- `browser_rendering.devtools.session` -- `get`, `list`

- **Custom Pages Assets** -- Custom page asset management
- `custom_pages.assets` -- `create`, `delete`, `get`, `list`, `update`

- **ACM Custom Trust Store** -- Custom origin trust store
- `acm.custom_trust_store` -- `create`, `delete`, `get`, `list`

- **Workers Observability Destinations** -- Log destinations for Workers observability
- `workers.observability.destinations` -- `create`, `delete`, `list`, `update`

- **Registrar** (expanded) -- Domain registration with full lifecycle management
- `registrar.registrations` -- `create`, `edit`, `get`, `list`
- `registrar.check`, `registrar.search`
- `registrar.registration_status` -- `get`
- `registrar.update_status` -- `get`

- **Zero Trust** additions
- `zero_trust.access.users` -- `create`, `delete`, `get`, `update`
- `zero_trust.devices.ip_profiles` -- `create`, `delete`, `get`, `list`, `update`
- `zero_trust.dex.rules` -- `create`, `delete`, `get`, `list`, `update`
- `zero_trust.dlp.settings` -- `delete`, `edit`, `get`, `update`
- `zero_trust.gateway.pacfiles` -- `create`, `delete`, `get`, `list`, `update`
- `zero_trust.networks.subnets.warp` -- `create`, `delete`, `edit`, `get`
- `zero_trust.tunnels.warp_connector.connections` -- `get`
- `zero_trust.tunnels.warp_connector.connectors` -- `get`
- `zero_trust.tunnels.warp_connector.failover` -- `update`

- **Zones Environments** -- Zone environment management
- `zones.environments` -- `create`, `delete`, `edit`, `list`, `rollback`, `update`

- **Radar** additions
- `radar.agent_readiness` -- `summary`
- `radar.ai.markdown_for_agents` -- `summary`, `timeseries`
- `radar.entities.asns` -- `botnet_threat_feed`
- `radar.post_quantum.origin` -- `summary`, `timeseries_groups`
- `radar.post_quantum.tls` -- `support`

- **Billing Usage** -- PayGo billing usage
- `billing.usage` -- `paygo`

- **Email Security** -- PhishGuard reporting
- `email_security.phishguard.reports` -- `list`

- **Brand Protection** -- v2 endpoints
- `brand_protection.v2` additions

## Bug Fixes

- **fix(dlp)**: Add missing `model_rebuild()`/`update_forward_refs()` calls for
`CustomProfileSharedEntryCustomEntry` and `IntegrationProfileSharedEntryCustomEntry`, fixing
pydantic v1 validation errors on DLP profile types.
- **fix(workers)**: Make `RunQueryParametersNeedleValue` a `BaseModel` with
`arbitrary_types_allowed` to prevent pydantic config errors.

## Internal

- `api.md` has been restructured from a single monolithic file into per-resource files under
`src/cloudflare/resources/*/api.md`. The root `api.md` now contains shared types and links to
each resource's documentation.
- Codegen updates applied across all resources with updated type annotations and method signatures.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ It is generated with [Stainless](https://www.stainless.com/).

Use the Cloudflare MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.

[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=cloudflare-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImNsb3VkZmxhcmUtbWNwIl0sImVudiI6eyJDTE9VREZMQVJFX0FQSV9UT0tFTiI6IlNuM2xaSlRCWDZra2c3T2RjQlVBeE9POTYzR0VJeUdRcW5GVE9GWVkiLCJDTE9VREZMQVJFX0FQSV9LRVkiOiIxNDRjOWRlZmFjMDQ5NjljN2JmYWQ4ZWZhYThlYTE5NCIsIk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IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22cloudflare-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22cloudflare-mcp%22%5D%2C%22env%22%3A%7B%22CLOUDFLARE_API_TOKEN%22%3A%22Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY%22%2C%22CLOUDFLARE_API_KEY%22%3A%22144c9defac04969c7bfad8efaa8ea194%22%2C%22CLOUDFLARE_EMAIL%22%3A%22user%40example.com%22%2C%22CLOUDFLARE_API_USER_SERVICE_KEY%22%3A%22v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719%22%2C%22CLOUDFLARE_ACCOUNT_ID%22%3A%22f037e56e89293a057740de681ac9accp%22%2C%22CLOUDFLARE_ZONE_ID%22%3A%22f037e56e89293a057740de681ac9accp%22%7D%7D)
[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=cloudflare-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImNsb3VkZmxhcmUtbWNwIl0s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IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22cloudflare-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22cloudflare-mcp%22%5D%2C%22env%22%3A%7B%22CLOUDFLARE_API_TOKEN%22%3A%22Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY%22%2C%22CLOUDFLARE_API_KEY%22%3A%22144c9defac04969c7bfad8efaa8ea194%22%2C%22CLOUDFLARE_EMAIL%22%3A%22user%40example.com%22%2C%22CLOUDFLARE_API_USER_SERVICE_KEY%22%3A%22v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719%22%7D%7D)

> Note: You may need to set environment variables in your MCP client.

Expand Down
72 changes: 0 additions & 72 deletions src/cloudflare/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,6 @@ class Cloudflare(SyncAPIClient):
api_key: str | None
api_email: str | None
user_service_key: str | None
account_id: str | None
zone_id: str | None

def __init__(
self,
Expand All @@ -321,8 +319,6 @@ def __init__(
api_key: str | None = None,
api_email: str | None = None,
user_service_key: str | None = None,
account_id: str | None = None,
zone_id: str | None = None,
base_url: str | httpx.URL | None = None,
api_version: str | None = None,
timeout: float | Timeout | None | NotGiven = not_given,
Expand Down Expand Up @@ -350,8 +346,6 @@ def __init__(
- `api_key` from `CLOUDFLARE_API_KEY`
- `api_email` from `CLOUDFLARE_EMAIL`
- `user_service_key` from `CLOUDFLARE_API_USER_SERVICE_KEY`
- `account_id` from `CLOUDFLARE_ACCOUNT_ID`
- `zone_id` from `CLOUDFLARE_ZONE_ID`
"""
if api_token is None:
api_token = os.environ.get("CLOUDFLARE_API_TOKEN")
Expand All @@ -369,14 +363,6 @@ def __init__(
user_service_key = os.environ.get("CLOUDFLARE_API_USER_SERVICE_KEY")
self.user_service_key = user_service_key

if account_id is None:
account_id = os.environ.get("CLOUDFLARE_ACCOUNT_ID")
self.account_id = account_id

if zone_id is None:
zone_id = os.environ.get("CLOUDFLARE_ZONE_ID")
self.zone_id = zone_id

if base_url is None:
base_url = os.environ.get("CLOUDFLARE_BASE_URL")
if base_url is None:
Expand Down Expand Up @@ -1123,8 +1109,6 @@ def copy(
api_key: str | None = None,
api_email: str | None = None,
user_service_key: str | None = None,
account_id: str | None = None,
zone_id: str | None = None,
base_url: str | httpx.URL | None = None,
api_version: str | None = None,
timeout: float | Timeout | None | NotGiven = not_given,
Expand Down Expand Up @@ -1163,8 +1147,6 @@ def copy(
api_key=api_key or self.api_key,
api_email=api_email or self.api_email,
user_service_key=user_service_key or self.user_service_key,
account_id=account_id or self.account_id,
zone_id=zone_id or self.zone_id,
base_url=base_url or self.base_url,
api_version=api_version or self.api_version,
timeout=self.timeout if isinstance(timeout, NotGiven) else timeout,
Expand All @@ -1179,24 +1161,6 @@ def copy(
# client.with_options(timeout=10).foo.create(...)
with_options = copy

def _get_account_id_path_param(self) -> str:
from_client = self.account_id
if from_client is not None:
return from_client

raise ValueError(
"Missing account_id argument; Please provide it at the client level, e.g. Cloudflare(account_id='abcd') or per method."
)

def _get_zone_id_path_param(self) -> str:
from_client = self.zone_id
if from_client is not None:
return from_client

raise ValueError(
"Missing zone_id argument; Please provide it at the client level, e.g. Cloudflare(zone_id='abcd') or per method."
)

@override
def _make_status_error(
self,
Expand Down Expand Up @@ -1237,8 +1201,6 @@ class AsyncCloudflare(AsyncAPIClient):
api_key: str | None
api_email: str | None
user_service_key: str | None
account_id: str | None
zone_id: str | None

def __init__(
self,
Expand All @@ -1247,8 +1209,6 @@ def __init__(
api_key: str | None = None,
api_email: str | None = None,
user_service_key: str | None = None,
account_id: str | None = None,
zone_id: str | None = None,
base_url: str | httpx.URL | None = None,
api_version: str | None = None,
timeout: float | Timeout | None | NotGiven = not_given,
Expand Down Expand Up @@ -1276,8 +1236,6 @@ def __init__(
- `api_key` from `CLOUDFLARE_API_KEY`
- `api_email` from `CLOUDFLARE_EMAIL`
- `user_service_key` from `CLOUDFLARE_API_USER_SERVICE_KEY`
- `account_id` from `CLOUDFLARE_ACCOUNT_ID`
- `zone_id` from `CLOUDFLARE_ZONE_ID`
"""
if api_token is None:
api_token = os.environ.get("CLOUDFLARE_API_TOKEN")
Expand All @@ -1295,14 +1253,6 @@ def __init__(
user_service_key = os.environ.get("CLOUDFLARE_API_USER_SERVICE_KEY")
self.user_service_key = user_service_key

if account_id is None:
account_id = os.environ.get("CLOUDFLARE_ACCOUNT_ID")
self.account_id = account_id

if zone_id is None:
zone_id = os.environ.get("CLOUDFLARE_ZONE_ID")
self.zone_id = zone_id

if base_url is None:
base_url = os.environ.get("CLOUDFLARE_BASE_URL")
if base_url is None:
Expand Down Expand Up @@ -2049,8 +1999,6 @@ def copy(
api_key: str | None = None,
api_email: str | None = None,
user_service_key: str | None = None,
account_id: str | None = None,
zone_id: str | None = None,
base_url: str | httpx.URL | None = None,
api_version: str | None = None,
timeout: float | Timeout | None | NotGiven = not_given,
Expand Down Expand Up @@ -2089,8 +2037,6 @@ def copy(
api_key=api_key or self.api_key,
api_email=api_email or self.api_email,
user_service_key=user_service_key or self.user_service_key,
account_id=account_id or self.account_id,
zone_id=zone_id or self.zone_id,
base_url=base_url or self.base_url,
api_version=api_version or self.api_version,
timeout=self.timeout if isinstance(timeout, NotGiven) else timeout,
Expand All @@ -2105,24 +2051,6 @@ def copy(
# client.with_options(timeout=10).foo.create(...)
with_options = copy

def _get_account_id_path_param(self) -> str:
from_client = self.account_id
if from_client is not None:
return from_client

raise ValueError(
"Missing account_id argument; Please provide it at the client level, e.g. AsyncCloudflare(account_id='abcd') or per method."
)

def _get_zone_id_path_param(self) -> str:
from_client = self.zone_id
if from_client is not None:
return from_client

raise ValueError(
"Missing zone_id argument; Please provide it at the client level, e.g. AsyncCloudflare(zone_id='abcd') or per method."
)

@override
def _make_status_error(
self,
Expand Down
Loading
Loading