Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: 5.0.0 #2359

Open
wants to merge 358 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
358 commits
Select commit Hold shift + click to select a range
7cfc2cd
feat(api): api update (#2423)
stainless-app[bot] Feb 4, 2025
a10f15f
feat(api): api update (#2424)
stainless-app[bot] Feb 4, 2025
198c3b1
fix: improve names for conflicting params (#2425)
stainless-app[bot] Feb 4, 2025
ca92978
codegen metadata
stainless-app[bot] Feb 4, 2025
d3f7ffb
feat(api): api update (#2426)
stainless-app[bot] Feb 4, 2025
9d996ca
codegen metadata
stainless-app[bot] Feb 4, 2025
5ee78ee
feat(terraform): add datasource for `zero_trust_tunnel_cloudflared_to…
stainless-app[bot] Feb 4, 2025
0eb2862
feat(client): send `X-Stainless-Read-Timeout` header (#2428)
stainless-app[bot] Feb 5, 2025
8e3c4b8
feat(api): api update (#2429)
stainless-app[bot] Feb 5, 2025
414a9d6
feat(api): api update (#2430)
stainless-app[bot] Feb 5, 2025
246265a
feat(api_token_permission_groups): define `get` operation for datasou…
stainless-app[bot] Feb 5, 2025
63e2a26
feat(api): automatic updates (#2432)
stainless-app[bot] Feb 6, 2025
bf55994
feat(api): api update (#2433)
stainless-app[bot] Feb 6, 2025
e71215d
chore(internal): fix type traversing dictionary params (#2434)
stainless-app[bot] Feb 6, 2025
0286bd2
codegen metadata
stainless-app[bot] Feb 6, 2025
440bfad
codegen metadata
stainless-app[bot] Feb 6, 2025
48261bd
codegen metadata
stainless-app[bot] Feb 6, 2025
a61bc44
codegen metadata
stainless-app[bot] Feb 6, 2025
06e91c3
chore(internal): minor type handling changes (#2435)
stainless-app[bot] Feb 6, 2025
ea1f7c4
codegen metadata
stainless-app[bot] Feb 6, 2025
ec602a2
codegen metadata
stainless-app[bot] Feb 6, 2025
be2ab33
codegen metadata
stainless-app[bot] Feb 6, 2025
2f32745
codegen metadata
stainless-app[bot] Feb 7, 2025
e60bc44
codegen metadata
stainless-app[bot] Feb 7, 2025
949ab06
chore: minor change to tests (#2436)
stainless-app[bot] Feb 7, 2025
67f7a8a
feat(api): api update (#2437)
stainless-app[bot] Feb 8, 2025
62bceb0
feat(r2_bucket_event_notification): add resource and flatten method h…
stainless-app[bot] Feb 9, 2025
493bb1f
feat(access): make `access_requests` singular for model (#2439)
stainless-app[bot] Feb 9, 2025
0b114b7
feat(api): update internal path (#2440)
stainless-app[bot] Feb 9, 2025
46da531
codegen metadata
stainless-app[bot] Feb 10, 2025
57c7803
codegen metadata
stainless-app[bot] Feb 10, 2025
46f72f2
codegen metadata
stainless-app[bot] Feb 10, 2025
96e6825
codegen metadata
stainless-app[bot] Feb 10, 2025
59e5b54
codegen metadata
stainless-app[bot] Feb 10, 2025
7e7052a
codegen metadata
stainless-app[bot] Feb 10, 2025
8fc517a
codegen metadata
stainless-app[bot] Feb 10, 2025
e361a1b
codegen metadata
stainless-app[bot] Feb 10, 2025
f014b76
codegen metadata
stainless-app[bot] Feb 10, 2025
af0e354
codegen metadata
stainless-app[bot] Feb 10, 2025
02f5c17
codegen metadata
stainless-app[bot] Feb 10, 2025
18a3477
codegen metadata
stainless-app[bot] Feb 10, 2025
c4c3100
codegen metadata
stainless-app[bot] Feb 10, 2025
a8db601
codegen metadata
stainless-app[bot] Feb 10, 2025
ab45e5c
codegen metadata
stainless-app[bot] Feb 10, 2025
cf47166
codegen metadata
stainless-app[bot] Feb 10, 2025
3722cde
codegen metadata
stainless-app[bot] Feb 10, 2025
9be71a8
codegen metadata
stainless-app[bot] Feb 10, 2025
86b0313
codegen metadata
stainless-app[bot] Feb 10, 2025
5c34539
feat(roles): enable correct pagination parameters (#2441)
stainless-app[bot] Feb 11, 2025
fa77ae7
codegen metadata
stainless-app[bot] Feb 11, 2025
5cb60b5
codegen metadata
stainless-app[bot] Feb 11, 2025
87f05ac
codegen metadata
stainless-app[bot] Feb 11, 2025
0378708
feat(api): api update (#2442)
stainless-app[bot] Feb 11, 2025
81783bb
chore(internal): codegen related update (#2443)
stainless-app[bot] Feb 11, 2025
898893c
feat(api): api update (#2444)
stainless-app[bot] Feb 11, 2025
65bd38b
codegen metadata
stainless-app[bot] Feb 11, 2025
92989eb
codegen metadata
stainless-app[bot] Feb 11, 2025
5772c86
codegen metadata
stainless-app[bot] Feb 11, 2025
baa76ee
codegen metadata
stainless-app[bot] Feb 12, 2025
596bf05
codegen metadata
stainless-app[bot] Feb 12, 2025
4b19e0f
codegen metadata
stainless-app[bot] Feb 12, 2025
425db54
codegen metadata
stainless-app[bot] Feb 12, 2025
b0bbb91
codegen metadata
stainless-app[bot] Feb 12, 2025
de38205
codegen metadata
stainless-app[bot] Feb 12, 2025
2bb957b
codegen metadata
stainless-app[bot] Feb 12, 2025
300f182
codegen metadata
stainless-app[bot] Feb 12, 2025
6994fa7
codegen metadata
stainless-app[bot] Feb 12, 2025
cb0dfdb
chore(internal): update client tests (#2445)
stainless-app[bot] Feb 12, 2025
dc1bd45
codegen metadata
stainless-app[bot] Feb 12, 2025
2a0324d
feat(api): api update (#2446)
stainless-app[bot] Feb 12, 2025
2516853
feat(api): api update (#2447)
stainless-app[bot] Feb 12, 2025
d2a217c
codegen metadata
stainless-app[bot] Feb 12, 2025
2a844c6
chore(internal): codegen related update (#2448)
stainless-app[bot] Feb 12, 2025
aefcfac
codegen metadata
stainless-app[bot] Feb 12, 2025
92668c7
codegen metadata
stainless-app[bot] Feb 13, 2025
24d88fa
feat(api): enable zero_trust_tunnel_cloudflared_token (#2449)
stainless-app[bot] Feb 13, 2025
0de14b3
codegen metadata
stainless-app[bot] Feb 13, 2025
b10d100
codegen metadata
stainless-app[bot] Feb 13, 2025
40fd764
codegen metadata
stainless-app[bot] Feb 13, 2025
f6a1477
fix: asyncify on non-asyncio runtimes (#2450)
stainless-app[bot] Feb 13, 2025
01fb305
codegen metadata
stainless-app[bot] Feb 13, 2025
f79a722
codegen metadata
stainless-app[bot] Feb 13, 2025
a490e47
codegen metadata
stainless-app[bot] Feb 13, 2025
0ef9ac3
codegen metadata
stainless-app[bot] Feb 13, 2025
4af9551
feat(api): api update (#2451)
stainless-app[bot] Feb 13, 2025
d072e2c
codegen metadata
stainless-app[bot] Feb 13, 2025
2603b2e
codegen metadata
stainless-app[bot] Feb 13, 2025
93ca448
codegen metadata
stainless-app[bot] Feb 13, 2025
b35a36d
feat(api): api update (#2452)
stainless-app[bot] Feb 13, 2025
0b8c6dd
codegen metadata
stainless-app[bot] Feb 13, 2025
819be80
feat(tunnels)!: move all cloudflared resources into dedicated namespa…
stainless-app[bot] Feb 14, 2025
260750c
feat(zero_trust): add subnets (#2454)
stainless-app[bot] Feb 14, 2025
a2cc34d
codegen metadata
stainless-app[bot] Feb 14, 2025
4b72937
codegen metadata
stainless-app[bot] Feb 14, 2025
7f3ac24
codegen metadata
stainless-app[bot] Feb 14, 2025
4c4c434
codegen metadata
stainless-app[bot] Feb 14, 2025
ff901b7
codegen metadata
stainless-app[bot] Feb 14, 2025
d9a5eb2
chore: change api.md to use accounts_or_zones (#2455)
stainless-app[bot] Feb 14, 2025
5bd9672
codegen metadata
stainless-app[bot] Feb 18, 2025
02c1e4e
feat(api): api update (#2456)
stainless-app[bot] Feb 18, 2025
89e9d32
chore(internal): codegen related update (#2457)
stainless-app[bot] Feb 18, 2025
9491b05
codegen metadata
stainless-app[bot] Feb 18, 2025
67abb9e
codegen metadata
stainless-app[bot] Feb 18, 2025
7b08f99
codegen metadata
stainless-app[bot] Feb 18, 2025
25d39d1
feat(api): api update (#2458)
stainless-app[bot] Feb 18, 2025
b181496
feat(api): api update (#2459)
stainless-app[bot] Feb 18, 2025
0616d2f
codegen metadata
stainless-app[bot] Feb 18, 2025
08ac5af
codegen metadata
stainless-app[bot] Feb 18, 2025
bf47c61
codegen metadata
stainless-app[bot] Feb 18, 2025
3614d2e
feat(zaraz): re-enable resources (#2460)
stainless-app[bot] Feb 18, 2025
83dc1e3
feat(connectors): add `telemetry` and `snapshots` (#2461)
stainless-app[bot] Feb 18, 2025
bd30260
feat(firewall_rules): remove duplicated `id` query parameter (#2462)
stainless-app[bot] Feb 18, 2025
b85440a
codegen metadata
stainless-app[bot] Feb 19, 2025
a9188fc
codegen metadata
stainless-app[bot] Feb 19, 2025
d49a36a
codegen metadata
stainless-app[bot] Feb 19, 2025
8a0e563
codegen metadata
stainless-app[bot] Feb 19, 2025
eae9e64
feat(api): api update (#2463)
stainless-app[bot] Feb 19, 2025
a1fe38d
codegen metadata
stainless-app[bot] Feb 19, 2025
9be865f
codegen metadata
stainless-app[bot] Feb 19, 2025
69b8193
feat(connectors): `telemetry` => `events` (#2464)
stainless-app[bot] Feb 19, 2025
822dafa
codegen metadata
stainless-app[bot] Feb 19, 2025
6996e20
feat(api): api update (#2465)
stainless-app[bot] Feb 19, 2025
400cb8a
codegen metadata
stainless-app[bot] Feb 19, 2025
933d13f
codegen metadata
stainless-app[bot] Feb 19, 2025
f614aed
codegen metadata
stainless-app[bot] Feb 20, 2025
7713cd1
codegen metadata
stainless-app[bot] Feb 20, 2025
08def6d
codegen metadata
stainless-app[bot] Feb 20, 2025
d5914ce
codegen metadata
stainless-app[bot] Feb 20, 2025
68a0ec5
codegen metadata
stainless-app[bot] Feb 20, 2025
5e9710b
codegen metadata
stainless-app[bot] Feb 20, 2025
6932570
codegen metadata
stainless-app[bot] Feb 20, 2025
dfd04b2
feat(api): api update (#2467)
stainless-app[bot] Feb 20, 2025
6930f2f
codegen metadata
stainless-app[bot] Feb 20, 2025
6954cfe
codegen metadata
stainless-app[bot] Feb 20, 2025
70cd662
codegen metadata
stainless-app[bot] Feb 20, 2025
bf67fb6
codegen metadata
stainless-app[bot] Feb 20, 2025
a95ac20
codegen metadata
stainless-app[bot] Feb 20, 2025
bcc55df
codegen metadata
stainless-app[bot] Feb 20, 2025
1f74700
codegen metadata
stainless-app[bot] Feb 20, 2025
baa8583
codegen metadata
stainless-app[bot] Feb 20, 2025
4784311
codegen metadata
stainless-app[bot] Feb 20, 2025
0bec580
codegen metadata
stainless-app[bot] Feb 20, 2025
534dbe0
codegen metadata
stainless-app[bot] Feb 20, 2025
2f6ae57
feat(client): allow passing `NotGiven` for body (#2468)
stainless-app[bot] Feb 20, 2025
fe3cc83
codegen metadata
stainless-app[bot] Feb 20, 2025
cf75545
codegen metadata
stainless-app[bot] Feb 21, 2025
68ca21e
codegen metadata
stainless-app[bot] Feb 21, 2025
60f0a0f
codegen metadata
stainless-app[bot] Feb 21, 2025
f3ea490
feat(api): api update (#2469)
stainless-app[bot] Feb 21, 2025
76522e5
codegen metadata
stainless-app[bot] Feb 21, 2025
0b5ad5f
chore(internal): fix devcontainers setup (#2470)
stainless-app[bot] Feb 21, 2025
cc270fe
feat(api): api update (#2471)
stainless-app[bot] Feb 21, 2025
b0e2e29
codegen metadata
stainless-app[bot] Feb 21, 2025
c519963
codegen metadata
stainless-app[bot] Feb 21, 2025
f730f6f
codegen metadata
stainless-app[bot] Feb 21, 2025
c99c706
codegen metadata
stainless-app[bot] Feb 21, 2025
c6b9f8f
codegen metadata
stainless-app[bot] Feb 21, 2025
7a579ba
codegen metadata
stainless-app[bot] Feb 21, 2025
0e99f4a
codegen metadata
stainless-app[bot] Feb 21, 2025
45dfd6c
codegen metadata
stainless-app[bot] Feb 22, 2025
20bf19b
codegen metadata
stainless-app[bot] Feb 22, 2025
a2414a3
codegen metadata
stainless-app[bot] Feb 22, 2025
2ed96df
codegen metadata
stainless-app[bot] Feb 22, 2025
c45af1f
codegen metadata
stainless-app[bot] Feb 23, 2025
2101785
codegen metadata
stainless-app[bot] Feb 24, 2025
f655304
codegen metadata
stainless-app[bot] Feb 24, 2025
3ec2a25
codegen metadata
stainless-app[bot] Feb 24, 2025
f15ee4a
codegen metadata
stainless-app[bot] Feb 24, 2025
b51122f
codegen metadata
stainless-app[bot] Feb 24, 2025
5cdc70f
codegen metadata
stainless-app[bot] Feb 24, 2025
2187b87
codegen metadata
stainless-app[bot] Feb 24, 2025
8251c62
codegen metadata
stainless-app[bot] Feb 24, 2025
d1cc93b
codegen metadata
stainless-app[bot] Feb 24, 2025
f3a9ec0
codegen metadata
stainless-app[bot] Feb 24, 2025
6b81c50
feat(api): api update (#2472)
stainless-app[bot] Feb 24, 2025
7901dff
codegen metadata
stainless-app[bot] Feb 24, 2025
6637061
codegen metadata
stainless-app[bot] Feb 24, 2025
9823b64
codegen metadata
stainless-app[bot] Feb 24, 2025
eb8ac49
feat(api): api update (#2473)
stainless-app[bot] Feb 24, 2025
3545e7d
codegen metadata
stainless-app[bot] Feb 24, 2025
a12ddc4
codegen metadata
stainless-app[bot] Feb 24, 2025
608ab19
codegen metadata
stainless-app[bot] Feb 25, 2025
4653649
codegen metadata
stainless-app[bot] Feb 25, 2025
759427e
codegen metadata
stainless-app[bot] Feb 25, 2025
93ae6bf
codegen metadata
stainless-app[bot] Feb 25, 2025
79066b0
codegen metadata
stainless-app[bot] Feb 25, 2025
d9c0b6c
codegen metadata
stainless-app[bot] Feb 25, 2025
d009183
codegen metadata
stainless-app[bot] Feb 25, 2025
ecdbb3e
codegen metadata
stainless-app[bot] Feb 25, 2025
2013c51
codegen metadata
stainless-app[bot] Feb 25, 2025
f4b821b
codegen metadata
stainless-app[bot] Feb 25, 2025
15e1979
codegen metadata
stainless-app[bot] Feb 25, 2025
277d4ee
codegen metadata
stainless-app[bot] Feb 25, 2025
f7a03e2
feat(api): api update (#2474)
stainless-app[bot] Feb 25, 2025
f21c9fa
codegen metadata
stainless-app[bot] Feb 25, 2025
329c314
chore(internal): codegen related update (#2475)
stainless-app[bot] Feb 25, 2025
48bdd22
feat(api): api update (#2476)
stainless-app[bot] Feb 25, 2025
9698a7e
codegen metadata
stainless-app[bot] Feb 25, 2025
c941451
codegen metadata
stainless-app[bot] Feb 25, 2025
4c75074
codegen metadata
stainless-app[bot] Feb 25, 2025
cc5c8f2
codegen metadata
stainless-app[bot] Feb 26, 2025
b96d855
codegen metadata
stainless-app[bot] Feb 26, 2025
7a2cb16
codegen metadata
stainless-app[bot] Feb 26, 2025
6ac26de
codegen metadata
stainless-app[bot] Feb 26, 2025
902af53
codegen metadata
stainless-app[bot] Feb 26, 2025
0556f5b
codegen metadata
stainless-app[bot] Feb 26, 2025
f1edb50
codegen metadata
stainless-app[bot] Feb 26, 2025
e1da61d
codegen metadata
stainless-app[bot] Feb 26, 2025
a633f27
codegen metadata
stainless-app[bot] Feb 26, 2025
6d435c7
codegen metadata
stainless-app[bot] Feb 26, 2025
f4496c0
codegen metadata
stainless-app[bot] Feb 26, 2025
da2ce0d
feat(api): api update (#2477)
stainless-app[bot] Feb 26, 2025
96bdc12
codegen metadata
stainless-app[bot] Feb 26, 2025
b097e45
codegen metadata
stainless-app[bot] Feb 26, 2025
083d115
codegen metadata
stainless-app[bot] Feb 26, 2025
94e997a
feat(api): api update (#2478)
stainless-app[bot] Feb 26, 2025
5aa1abb
codegen metadata
stainless-app[bot] Feb 26, 2025
3d0496f
codegen metadata
stainless-app[bot] Feb 26, 2025
edb66a9
codegen metadata
stainless-app[bot] Feb 27, 2025
0ddf9ee
codegen metadata
stainless-app[bot] Feb 27, 2025
eda9490
codegen metadata
stainless-app[bot] Feb 27, 2025
06feaa9
codegen metadata
stainless-app[bot] Feb 27, 2025
9acefc1
codegen metadata
stainless-app[bot] Feb 27, 2025
b42c7ed
codegen metadata
stainless-app[bot] Feb 27, 2025
4b6c160
codegen metadata
stainless-app[bot] Feb 27, 2025
b49f05d
feat(api): api update (#2479)
stainless-app[bot] Feb 27, 2025
fa43cb7
codegen metadata
stainless-app[bot] Feb 27, 2025
b77d84f
codegen metadata
stainless-app[bot] Feb 27, 2025
b27f1bb
feat(api): api update (#2480)
stainless-app[bot] Feb 27, 2025
aa9ffe9
codegen metadata
stainless-app[bot] Feb 27, 2025
3994c22
codegen metadata
stainless-app[bot] Feb 27, 2025
fe98b1d
docs: update URLs from stainlessapi.com to stainless.com (#2481)
stainless-app[bot] Feb 27, 2025
015fd49
codegen metadata
stainless-app[bot] Feb 27, 2025
e98bd28
chore(docs): update client docstring (#2483)
stainless-app[bot] Feb 27, 2025
6739a41
feat(browsing_rendering): add support for subresources (#2484)
stainless-app[bot] Feb 27, 2025
9fb8139
codegen metadata
stainless-app[bot] Feb 28, 2025
904614f
feat(vpc_flows): add token support (#2485)
stainless-app[bot] Feb 28, 2025
f0b00be
chore(internal): mark VPC and PDF as initialisms (#2486)
stainless-app[bot] Feb 28, 2025
a5d4c51
feat(radar): add DNS endpoint (#2487)
stainless-app[bot] Feb 28, 2025
3289f18
codegen metadata
stainless-app[bot] Feb 28, 2025
4080dc3
codegen metadata
stainless-app[bot] Feb 28, 2025
329da0a
codegen metadata
stainless-app[bot] Feb 28, 2025
b643ba4
codegen metadata
stainless-app[bot] Feb 28, 2025
af5e2dd
codegen metadata
stainless-app[bot] Feb 28, 2025
6b3425f
feat(api): rename browsing_rendering to browser_rendering (#2488)
stainless-app[bot] Feb 28, 2025
912fa23
codegen metadata
stainless-app[bot] Feb 28, 2025
3445a0b
codegen metadata
stainless-app[bot] Feb 28, 2025
7f6d335
feat(api): api update (#2489)
stainless-app[bot] Feb 28, 2025
5132cff
codegen metadata
stainless-app[bot] Feb 28, 2025
91f86d5
release: 5.0.0
stainless-app[bot] Feb 28, 2025
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
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ USER vscode
RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.35.0" RYE_INSTALL_OPTION="--yes" bash
ENV PATH=/home/vscode/.rye/shims:$PATH

RUN echo "[[ -d .venv ]] && source .venv/bin/activate" >> /home/vscode/.bashrc
RUN echo "[[ -d .venv ]] && source .venv/bin/activate || export PATH=\$PATH" >> /home/vscode/.bashrc
3 changes: 3 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
}
}
}
},
"features": {
"ghcr.io/devcontainers/features/node:1": {}
}

// Features to add to the dev container. More info: https://containers.dev/features.
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:

- name: Run lints
run: ./scripts/lint

test:
name: test
runs-on: ubuntu-latest
Expand All @@ -56,6 +57,7 @@ jobs:

- name: Run tests
run: ./scripts/test

examples:
name: examples
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "4.0.0"
".": "5.0.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1493
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3d78f855257b55bbb80884f99c3802cae877968d140eed3557fcb2cdd5f937b3.yml
configured_endpoints: 1570
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9058a9acdb217b68158480c5535c441446cb75f9dc5c5ade62297645df626656.yml
108 changes: 108 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,25 @@ for account in first_page.result:
# Remove `await` for non-async usage.
```

## File uploads

Request parameters that correspond to file uploads can be passed as `bytes`, a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`.

```python
from pathlib import Path
from cloudflare import Cloudflare

client = Cloudflare()

client.api_gateway.user_schemas.create(
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
file=Path("/path/to/file"),
kind="openapi_v3",
)
```

The async client uses the exact same interface. If you pass a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance, the file contents will be read asynchronously automatically.

## Handling errors

When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `cloudflare.APIConnectionError` is raised.
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Reporting Security Vulnerabilities

Please see [this page](https://www.cloudflare.com/.well-known/security.txt) for information on how to report a vulnerability to Cloudflare. Thanks!
Please see [this page](https://www.cloudflare.com/.well-known/security.txt) for information on how to report a vulnerability to Cloudflare. Thanks!
1,253 changes: 845 additions & 408 deletions api.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ cache_fine_grained = True
# ```
# Changing this codegen to make mypy happy would increase complexity
# and would not be worth it.
disable_error_code = func-returns-value
disable_error_code = func-returns-value,overload-cannot-match

# https://github.com/python/mypy/issues/12162
[mypy.overrides]
Expand Down
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "cloudflare"
version = "4.0.0"
version = "5.0.0"
description = "The official Python library for the cloudflare API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down Expand Up @@ -54,6 +54,7 @@ dev-dependencies = [
"dirty-equals>=0.6.0",
"importlib-metadata>=6.7.0",
"rich>=13.7.1",
"nest_asyncio==1.6.0",
]

[tool.rye.scripts]
Expand Down Expand Up @@ -128,6 +129,7 @@ testpaths = ["tests"]
addopts = "--tb=short"
xfail_strict = true
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "session"
filterwarnings = [
"error"
]
Expand Down Expand Up @@ -176,7 +178,7 @@ select = [
"T201",
"T203",
# misuse of typing.TYPE_CHECKING
"TCH004",
"TC004",
# import rules
"TID251",
]
Expand Down
7 changes: 4 additions & 3 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ markdown-it-py==3.0.0
# via rich
mdurl==0.1.2
# via markdown-it-py
mypy==1.13.0
mypy==1.14.1
mypy-extensions==1.0.0
# via mypy
nest-asyncio==1.6.0
nodeenv==1.8.0
# via pyright
nox==2023.4.22
Expand All @@ -67,7 +68,7 @@ pydantic-core==2.27.1
# via pydantic
pygments==2.18.0
# via rich
pyright==1.1.390
pyright==1.1.392.post0
pytest==8.3.3
# via pytest-asyncio
pytest-asyncio==0.24.0
Expand All @@ -77,7 +78,7 @@ pytz==2023.3.post1
# via dirty-equals
respx==0.22.0
rich==13.7.1
ruff==0.6.9
ruff==0.9.4
setuptools==68.2.2
# via nodeenv
six==1.16.0
Expand Down
2 changes: 1 addition & 1 deletion scripts/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e

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

if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then
if ! command -v rye >/dev/null 2>&1 && [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then
brew bundle check >/dev/null 2>&1 || {
echo "==> Installing Homebrew dependencies…"
brew bundle
Expand Down
1 change: 0 additions & 1 deletion scripts/lint
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ rye run lint

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

4 changes: 2 additions & 2 deletions scripts/utils/ruffen-docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def _md_match(match: Match[str]) -> str:
with _collect_error(match):
code = format_code_block(code)
code = textwrap.indent(code, match["indent"])
return f'{match["before"]}{code}{match["after"]}'
return f"{match['before']}{code}{match['after']}"

def _pycon_match(match: Match[str]) -> str:
code = ""
Expand Down Expand Up @@ -97,7 +97,7 @@ def finish_fragment() -> None:
def _md_pycon_match(match: Match[str]) -> str:
code = _pycon_match(match)
code = textwrap.indent(code, match["indent"])
return f'{match["before"]}{code}{match["after"]}'
return f"{match['before']}{code}{match['after']}"

src = MD_RE.sub(_md_match, src)
src = MD_PYCON_RE.sub(_md_pycon_match, src)
Expand Down
21 changes: 17 additions & 4 deletions src/cloudflare/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
ModelBuilderProtocol,
)
from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping
from ._compat import model_copy, model_dump
from ._compat import PYDANTIC_V2, model_copy, model_dump
from ._models import GenericModel, FinalRequestOptions, validate_type, construct_type
from ._response import (
APIResponse,
Expand Down Expand Up @@ -207,6 +207,9 @@ def _set_private_attributes(
model: Type[_T],
options: FinalRequestOptions,
) -> None:
if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
self.__pydantic_private__ = {}

self._model = model
self._client = client
self._options = options
Expand Down Expand Up @@ -292,6 +295,9 @@ def _set_private_attributes(
client: AsyncAPIClient,
options: FinalRequestOptions,
) -> None:
if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
self.__pydantic_private__ = {}

self._model = model
self._client = client
self._options = options
Expand Down Expand Up @@ -418,10 +424,17 @@ def _build_headers(self, options: FinalRequestOptions, *, retries_taken: int = 0
if idempotency_header and options.method.lower() != "get" and idempotency_header not in headers:
headers[idempotency_header] = options.idempotency_key or self._idempotency_key()

# Don't set the retry count header if it was already set or removed by the caller. We check
# Don't set these headers if they were already set or removed by the caller. We check
# `custom_headers`, which can contain `Omit()`, instead of `headers` to account for the removal case.
if "x-stainless-retry-count" not in (header.lower() for header in custom_headers):
lower_custom_headers = [header.lower() for header in custom_headers]
if "x-stainless-retry-count" not in lower_custom_headers:
headers["x-stainless-retry-count"] = str(retries_taken)
if "x-stainless-read-timeout" not in lower_custom_headers:
timeout = self.timeout if isinstance(options.timeout, NotGiven) else options.timeout
if isinstance(timeout, Timeout):
timeout = timeout.read
if timeout is not None:
headers["x-stainless-read-timeout"] = str(timeout)

return headers

Expand Down Expand Up @@ -511,7 +524,7 @@ def _build_request(
# so that passing a `TypedDict` doesn't cause an error.
# https://github.com/microsoft/pyright/issues/3526#event-6715453066
params=self.qs.stringify(cast(Mapping[str, Any], params)) if params else None,
json=json_data,
json=json_data if is_given(json_data) else None,
files=files,
**kwargs,
)
Expand Down
Loading
Loading