Skip to content

Commit 4e01b1c

Browse files
authored
Merge pull request #482 from cloudflare/release-please--branches--main--changes--next
release: 3.0.0-beta.10
2 parents 5cb63bc + 7bd7ef6 commit 4e01b1c

File tree

690 files changed

+59787
-9239
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

690 files changed

+59787
-9239
lines changed

.devcontainer/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}
33

44
USER vscode
55

6-
RUN curl -sSf https://rye-up.com/get | RYE_VERSION="0.24.0" RYE_INSTALL_OPTION="--yes" bash
6+
RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.24.0" RYE_INSTALL_OPTION="--yes" bash
77
ENV PATH=/home/vscode/.rye/shims:$PATH
88

99
RUN echo "[[ -d .venv ]] && source .venv/bin/activate" >> /home/vscode/.bashrc

.github/workflows/ci.yml

+6-16
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,17 @@ jobs:
1818

1919
- name: Install Rye
2020
run: |
21-
curl -sSf https://rye-up.com/get | bash
21+
curl -sSf https://rye.astral.sh/get | bash
2222
echo "$HOME/.rye/shims" >> $GITHUB_PATH
2323
env:
2424
RYE_VERSION: 0.24.0
2525
RYE_INSTALL_OPTION: '--yes'
2626

2727
- name: Install dependencies
28-
run: |
29-
rye sync --all-features
30-
31-
- name: Run ruff
32-
run: |
33-
rye run check:ruff
28+
run: rye sync --all-features
3429

35-
- name: Run type checking
36-
run: |
37-
rye run typecheck
38-
39-
- name: Ensure importable
40-
run: |
41-
rye run python -c 'import cloudflare'
30+
- name: Run lints
31+
run: ./scripts/lint
4232
test:
4333
name: test
4434
runs-on: ubuntu-latest
@@ -48,7 +38,7 @@ jobs:
4838

4939
- name: Install Rye
5040
run: |
51-
curl -sSf https://rye-up.com/get | bash
41+
curl -sSf https://rye.astral.sh/get | bash
5242
echo "$HOME/.rye/shims" >> $GITHUB_PATH
5343
env:
5444
RYE_VERSION: 0.24.0
@@ -68,7 +58,7 @@ jobs:
6858

6959
- name: Install Rye
7060
run: |
71-
curl -sSf https://rye-up.com/get | bash
61+
curl -sSf https://rye.astral.sh/get | bash
7262
echo "$HOME/.rye/shims" >> $GITHUB_PATH
7363
env:
7464
RYE_VERSION: 0.24.0

.github/workflows/publish-pypi.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
- name: Install Rye
2020
run: |
21-
curl -sSf https://rye-up.com/get | bash
21+
curl -sSf https://rye.astral.sh/get | bash
2222
echo "$HOME/.rye/shims" >> $GITHUB_PATH
2323
env:
2424
RYE_VERSION: 0.24.0

.release-please-manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "3.0.0-beta.9"
2+
".": "3.0.0-beta.10"
33
}

.stats.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 1274
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-07ec76fab00de3d6227209faf0af1ed586cde9e2f243c13d3db555da20f13d99.yml
1+
configured_endpoints: 1348
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-49d54760f87326f9200c777f867e4ea579c92a43f481207ae252db9748c9b07b.yml

CHANGELOG.md

+307
Large diffs are not rendered by default.

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
### With Rye
44

5-
We use [Rye](https://rye-up.com/) to manage dependencies so we highly recommend [installing it](https://rye-up.com/guide/installation/) as it will automatically provision a Python environment with the expected Python version.
5+
We use [Rye](https://rye.astral.sh/) to manage dependencies so we highly recommend [installing it](https://rye.astral.sh/guide/installation/) as it will automatically provision a Python environment with the expected Python version.
66

77
After installing Rye, you'll just have to run this command:
88

SECURITY.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Security Policy
2+
3+
## Reporting Security Issues
4+
5+
This SDK is generated by [Stainless Software Inc](http://stainlessapi.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken.
6+
7+
To report a security issue, please contact the Stainless team at [email protected].
8+
9+
## Responsible Disclosure
10+
11+
We appreciate the efforts of security researchers and individuals who help us maintain the security of
12+
SDKs we generate. If you believe you have found a security vulnerability, please adhere to responsible
13+
disclosure practices by allowing us a reasonable amount of time to investigate and address the issue
14+
before making any information public.
15+
16+
## Reporting Non-SDK Related Security Issues
17+
18+
If you encounter security issues that are not directly related to SDKs but pertain to the services
19+
or products provided by Cloudflare please follow the respective company's security reporting guidelines.
20+
21+
### Cloudflare Terms and Policies
22+
23+
Please contact [email protected] for any questions or concerns regarding security of our services.
24+
25+
---
26+
27+
Thank you for helping us keep the SDKs and systems they interact with secure.

api.md

+583-160
Large diffs are not rendered by default.

mypy.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ show_error_codes = True
55
# Exclude _files.py because mypy isn't smart enough to apply
66
# the correct type narrowing and as this is an internal module
77
# it's fine to just use Pyright.
8-
exclude = ^(src/cloudflare/_files\.py|_dev/.*\.py|src/cloudflare/resources/zero_trust/identity_providers\.py|src/cloudflare/resources/zero_trust/access/applications/applications\.py|src/cloudflare/resources/workers/ai\.py)$
8+
exclude = ^(src/cloudflare/_files\.py|_dev/.*\.py|src/cloudflare/resources/zero_trust/identity_providers\.py|src/cloudflare/resources/zero_trust/access/applications/applications\.py|src/cloudflare/resources/workers/ai\.py|src/cloudflare/resources/magic_transit/apps\.py)$
99

1010
strict_equality = True
1111
implicit_reexport = True

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "cloudflare"
3-
version = "3.0.0-beta.9"
3+
version = "3.0.0-beta.10"
44
description = "The official Python library for the cloudflare API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"

requirements-dev.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ pluggy==1.3.0
5959
# via pytest
6060
py==1.11.0
6161
# via pytest
62-
pydantic==2.4.2
62+
pydantic==2.7.1
6363
# via cloudflare
64-
pydantic-core==2.10.1
64+
pydantic-core==2.18.2
6565
# via pydantic
66-
pyright==1.1.359
66+
pyright==1.1.364
6767
pytest==7.1.1
6868
# via pytest-asyncio
6969
pytest-asyncio==0.21.1

requirements.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ httpx==0.25.2
2929
idna==3.4
3030
# via anyio
3131
# via httpx
32-
pydantic==2.4.2
32+
pydantic==2.7.1
3333
# via cloudflare
34-
pydantic-core==2.10.1
34+
pydantic-core==2.18.2
3535
# via pydantic
3636
sniffio==1.3.0
3737
# via anyio

scripts/bootstrap

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ echo "==> Installing Python dependencies…"
1616
# experimental uv support makes installations significantly faster
1717
rye config --set-bool behavior.use-uv=true
1818

19-
rye sync
19+
rye sync --all-features

scripts/format

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ set -e
44

55
cd "$(dirname "$0")/.."
66

7+
echo "==> Running formatters"
78
rye run format
8-

scripts/lint

+4
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,9 @@ set -e
44

55
cd "$(dirname "$0")/.."
66

7+
echo "==> Running lints"
78
rye run lint
89

10+
echo "==> Making sure it imports"
11+
rye run python -c 'import cloudflare'
12+

scripts/test

-1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,5 @@ else
5252
echo
5353
fi
5454

55-
# Run tests
5655
echo "==> Running tests"
5756
rye run pytest "$@"

src/cloudflare/_base_client.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ def _build_request(
456456
raise RuntimeError(f"Unexpected JSON data type, {type(json_data)}, cannot merge with `extra_body`")
457457

458458
headers = self._build_headers(options)
459-
params = _merge_mappings(self._custom_query, options.params)
459+
params = _merge_mappings(self.default_query, options.params)
460460
content_type = headers.get("Content-Type")
461461

462462
# If the given Content-Type header is multipart/form-data then it
@@ -592,6 +592,12 @@ def default_headers(self) -> dict[str, str | Omit]:
592592
**self._custom_headers,
593593
}
594594

595+
@property
596+
def default_query(self) -> dict[str, object]:
597+
return {
598+
**self._custom_query,
599+
}
600+
595601
def _validate_headers(
596602
self,
597603
headers: Headers, # noqa: ARG002

src/cloudflare/_client.py

+16
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ class Cloudflare(SyncAPIClient):
8585
kv: resources.KVResource
8686
durable_objects: resources.DurableObjectsResource
8787
queues: resources.QueuesResource
88+
api_gateway: resources.APIGatewayResource
8889
managed_headers: resources.ManagedHeadersResource
8990
page_shield: resources.PageShieldResource
9091
rulesets: resources.RulesetsResource
@@ -129,6 +130,7 @@ class Cloudflare(SyncAPIClient):
129130
cloudforce_one: resources.CloudforceOneResource
130131
event_notifications: resources.EventNotificationsResource
131132
ai_gateway: resources.AIGatewayResource
133+
iam: resources.IAMResource
132134
with_raw_response: CloudflareWithRawResponse
133135
with_streaming_response: CloudflareWithStreamedResponse
134136

@@ -242,6 +244,7 @@ def __init__(
242244
self.kv = resources.KVResource(self)
243245
self.durable_objects = resources.DurableObjectsResource(self)
244246
self.queues = resources.QueuesResource(self)
247+
self.api_gateway = resources.APIGatewayResource(self)
245248
self.managed_headers = resources.ManagedHeadersResource(self)
246249
self.page_shield = resources.PageShieldResource(self)
247250
self.rulesets = resources.RulesetsResource(self)
@@ -286,6 +289,7 @@ def __init__(
286289
self.cloudforce_one = resources.CloudforceOneResource(self)
287290
self.event_notifications = resources.EventNotificationsResource(self)
288291
self.ai_gateway = resources.AIGatewayResource(self)
292+
self.iam = resources.IAMResource(self)
289293
self.with_raw_response = CloudflareWithRawResponse(self)
290294
self.with_streaming_response = CloudflareWithStreamedResponse(self)
291295

@@ -502,6 +506,7 @@ class AsyncCloudflare(AsyncAPIClient):
502506
kv: resources.AsyncKVResource
503507
durable_objects: resources.AsyncDurableObjectsResource
504508
queues: resources.AsyncQueuesResource
509+
api_gateway: resources.AsyncAPIGatewayResource
505510
managed_headers: resources.AsyncManagedHeadersResource
506511
page_shield: resources.AsyncPageShieldResource
507512
rulesets: resources.AsyncRulesetsResource
@@ -546,6 +551,7 @@ class AsyncCloudflare(AsyncAPIClient):
546551
cloudforce_one: resources.AsyncCloudforceOneResource
547552
event_notifications: resources.AsyncEventNotificationsResource
548553
ai_gateway: resources.AsyncAIGatewayResource
554+
iam: resources.AsyncIAMResource
549555
with_raw_response: AsyncCloudflareWithRawResponse
550556
with_streaming_response: AsyncCloudflareWithStreamedResponse
551557

@@ -659,6 +665,7 @@ def __init__(
659665
self.kv = resources.AsyncKVResource(self)
660666
self.durable_objects = resources.AsyncDurableObjectsResource(self)
661667
self.queues = resources.AsyncQueuesResource(self)
668+
self.api_gateway = resources.AsyncAPIGatewayResource(self)
662669
self.managed_headers = resources.AsyncManagedHeadersResource(self)
663670
self.page_shield = resources.AsyncPageShieldResource(self)
664671
self.rulesets = resources.AsyncRulesetsResource(self)
@@ -703,6 +710,7 @@ def __init__(
703710
self.cloudforce_one = resources.AsyncCloudforceOneResource(self)
704711
self.event_notifications = resources.AsyncEventNotificationsResource(self)
705712
self.ai_gateway = resources.AsyncAIGatewayResource(self)
713+
self.iam = resources.AsyncIAMResource(self)
706714
self.with_raw_response = AsyncCloudflareWithRawResponse(self)
707715
self.with_streaming_response = AsyncCloudflareWithStreamedResponse(self)
708716

@@ -926,6 +934,7 @@ def __init__(self, client: Cloudflare) -> None:
926934
self.kv = resources.KVResourceWithRawResponse(client.kv)
927935
self.durable_objects = resources.DurableObjectsResourceWithRawResponse(client.durable_objects)
928936
self.queues = resources.QueuesResourceWithRawResponse(client.queues)
937+
self.api_gateway = resources.APIGatewayResourceWithRawResponse(client.api_gateway)
929938
self.managed_headers = resources.ManagedHeadersResourceWithRawResponse(client.managed_headers)
930939
self.page_shield = resources.PageShieldResourceWithRawResponse(client.page_shield)
931940
self.rulesets = resources.RulesetsResourceWithRawResponse(client.rulesets)
@@ -974,6 +983,7 @@ def __init__(self, client: Cloudflare) -> None:
974983
self.cloudforce_one = resources.CloudforceOneResourceWithRawResponse(client.cloudforce_one)
975984
self.event_notifications = resources.EventNotificationsResourceWithRawResponse(client.event_notifications)
976985
self.ai_gateway = resources.AIGatewayResourceWithRawResponse(client.ai_gateway)
986+
self.iam = resources.IAMResourceWithRawResponse(client.iam)
977987

978988

979989
class AsyncCloudflareWithRawResponse:
@@ -1024,6 +1034,7 @@ def __init__(self, client: AsyncCloudflare) -> None:
10241034
self.kv = resources.AsyncKVResourceWithRawResponse(client.kv)
10251035
self.durable_objects = resources.AsyncDurableObjectsResourceWithRawResponse(client.durable_objects)
10261036
self.queues = resources.AsyncQueuesResourceWithRawResponse(client.queues)
1037+
self.api_gateway = resources.AsyncAPIGatewayResourceWithRawResponse(client.api_gateway)
10271038
self.managed_headers = resources.AsyncManagedHeadersResourceWithRawResponse(client.managed_headers)
10281039
self.page_shield = resources.AsyncPageShieldResourceWithRawResponse(client.page_shield)
10291040
self.rulesets = resources.AsyncRulesetsResourceWithRawResponse(client.rulesets)
@@ -1074,6 +1085,7 @@ def __init__(self, client: AsyncCloudflare) -> None:
10741085
self.cloudforce_one = resources.AsyncCloudforceOneResourceWithRawResponse(client.cloudforce_one)
10751086
self.event_notifications = resources.AsyncEventNotificationsResourceWithRawResponse(client.event_notifications)
10761087
self.ai_gateway = resources.AsyncAIGatewayResourceWithRawResponse(client.ai_gateway)
1088+
self.iam = resources.AsyncIAMResourceWithRawResponse(client.iam)
10771089

10781090

10791091
class CloudflareWithStreamedResponse:
@@ -1124,6 +1136,7 @@ def __init__(self, client: Cloudflare) -> None:
11241136
self.kv = resources.KVResourceWithStreamingResponse(client.kv)
11251137
self.durable_objects = resources.DurableObjectsResourceWithStreamingResponse(client.durable_objects)
11261138
self.queues = resources.QueuesResourceWithStreamingResponse(client.queues)
1139+
self.api_gateway = resources.APIGatewayResourceWithStreamingResponse(client.api_gateway)
11271140
self.managed_headers = resources.ManagedHeadersResourceWithStreamingResponse(client.managed_headers)
11281141
self.page_shield = resources.PageShieldResourceWithStreamingResponse(client.page_shield)
11291142
self.rulesets = resources.RulesetsResourceWithStreamingResponse(client.rulesets)
@@ -1174,6 +1187,7 @@ def __init__(self, client: Cloudflare) -> None:
11741187
self.cloudforce_one = resources.CloudforceOneResourceWithStreamingResponse(client.cloudforce_one)
11751188
self.event_notifications = resources.EventNotificationsResourceWithStreamingResponse(client.event_notifications)
11761189
self.ai_gateway = resources.AIGatewayResourceWithStreamingResponse(client.ai_gateway)
1190+
self.iam = resources.IAMResourceWithStreamingResponse(client.iam)
11771191

11781192

11791193
class AsyncCloudflareWithStreamedResponse:
@@ -1230,6 +1244,7 @@ def __init__(self, client: AsyncCloudflare) -> None:
12301244
self.kv = resources.AsyncKVResourceWithStreamingResponse(client.kv)
12311245
self.durable_objects = resources.AsyncDurableObjectsResourceWithStreamingResponse(client.durable_objects)
12321246
self.queues = resources.AsyncQueuesResourceWithStreamingResponse(client.queues)
1247+
self.api_gateway = resources.AsyncAPIGatewayResourceWithStreamingResponse(client.api_gateway)
12331248
self.managed_headers = resources.AsyncManagedHeadersResourceWithStreamingResponse(client.managed_headers)
12341249
self.page_shield = resources.AsyncPageShieldResourceWithStreamingResponse(client.page_shield)
12351250
self.rulesets = resources.AsyncRulesetsResourceWithStreamingResponse(client.rulesets)
@@ -1282,6 +1297,7 @@ def __init__(self, client: AsyncCloudflare) -> None:
12821297
client.event_notifications
12831298
)
12841299
self.ai_gateway = resources.AsyncAIGatewayResourceWithStreamingResponse(client.ai_gateway)
1300+
self.iam = resources.AsyncIAMResourceWithStreamingResponse(client.iam)
12851301

12861302

12871303
Client = Cloudflare

0 commit comments

Comments
 (0)