Skip to content

Commit 03aa0f5

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat: OpenAPI spec update via Stainless API (#17)
1 parent eecdf85 commit 03aa0f5

File tree

3,270 files changed

+41883
-19488
lines changed

Some content is hidden

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

3,270 files changed

+41883
-19488
lines changed

README.md

+30-23
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ client = Cloudflare(
3030
)
3131

3232
zone_create_response = client.zones.create(
33-
account={"id": "023e105f4ecef8ad9ca31a8372d0c353"},
33+
account={
34+
"id": "023e105f4ecef8ad9ca31a8372d0c353"
35+
},
3436
name="example.com",
3537
type="full",
3638
)
@@ -56,15 +58,15 @@ client = AsyncCloudflare(
5658
api_email=os.environ.get("CLOUDFLARE_EMAIL"),
5759
)
5860

59-
6061
async def main() -> None:
61-
zone_create_response = await client.zones.create(
62-
account={"id": "023e105f4ecef8ad9ca31a8372d0c353"},
63-
name="example.com",
64-
type="full",
65-
)
66-
print(zone_create_response.id)
67-
62+
zone_create_response = await client.zones.create(
63+
account={
64+
"id": "023e105f4ecef8ad9ca31a8372d0c353"
65+
},
66+
name="example.com",
67+
type="full",
68+
)
69+
print(zone_create_response.id)
6870

6971
asyncio.run(main())
7072
```
@@ -97,13 +99,15 @@ client = Cloudflare()
9799

98100
try:
99101
client.zones.create(
100-
account={"id": "023e105f4ecef8ad9ca31a8372d0c353"},
102+
account={
103+
"id": "023e105f4ecef8ad9ca31a8372d0c353"
104+
},
101105
name="example.com",
102106
type="full",
103107
)
104108
except cloudflare.APIConnectionError as e:
105109
print("The server could not be reached")
106-
print(e.__cause__) # an underlying Exception, likely raised within httpx.
110+
print(e.__cause__) # an underlying Exception, likely raised within httpx.
107111
except cloudflare.RateLimitError as e:
108112
print("A 429 status code was received; we should back off a bit.")
109113
except cloudflare.APIStatusError as e:
@@ -143,8 +147,10 @@ client = Cloudflare(
143147
)
144148

145149
# Or, configure per-request:
146-
client.with_options(max_retries=5).zones.create(
147-
account={"id": "023e105f4ecef8ad9ca31a8372d0c353"},
150+
client.with_options(max_retries = 5).zones.create(
151+
account={
152+
"id": "023e105f4ecef8ad9ca31a8372d0c353"
153+
},
148154
name="example.com",
149155
type="full",
150156
)
@@ -170,8 +176,10 @@ client = Cloudflare(
170176
)
171177

172178
# Override per-request:
173-
client.with_options(timeout=5 * 1000).zones.create(
174-
account={"id": "023e105f4ecef8ad9ca31a8372d0c353"},
179+
client.with_options(timeout = 5 * 1000).zones.create(
180+
account={
181+
"id": "023e105f4ecef8ad9ca31a8372d0c353"
182+
},
175183
name="example.com",
176184
type="full",
177185
)
@@ -238,14 +246,16 @@ To stream the response body, use `.with_streaming_response` instead, which requi
238246

239247
```python
240248
with client.zones.with_streaming_response.create(
241-
account={"id": "023e105f4ecef8ad9ca31a8372d0c353"},
249+
account={
250+
"id": "023e105f4ecef8ad9ca31a8372d0c353"
251+
},
242252
name="example.com",
243253
type="full",
244-
) as response:
245-
print(response.headers.get("X-My-Header"))
254+
) as response :
255+
print(response.headers.get('X-My-Header'))
246256

247257
for line in response.iter_lines():
248-
print(line)
258+
print(line)
249259
```
250260

251261
The context manager is required so that the response will reliably be closed.
@@ -265,10 +275,7 @@ from cloudflare import Cloudflare
265275
client = Cloudflare(
266276
# Or use the `CLOUDFLARE_BASE_URL` env var
267277
base_url="http://my.test.server.example.com:8083",
268-
http_client=httpx.Client(
269-
proxies="http://my.test.proxy.example.com",
270-
transport=httpx.HTTPTransport(local_address="0.0.0.0"),
271-
),
278+
http_client=httpx.Client(proxies="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0")),
272279
)
273280
```
274281

0 commit comments

Comments
 (0)