Skip to content

Commit c651cd6

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): OpenAPI spec update via Stainless API (#315)
1 parent 88f1db1 commit c651cd6

32 files changed

+462
-475
lines changed

api.md

+35-35
Large diffs are not rendered by default.

src/cloudflare/resources/calls.py

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

33
from __future__ import annotations
44

5-
from typing import Type, cast
5+
from typing import Type, Optional, cast
66

77
import httpx
88

@@ -50,7 +50,7 @@ def create(
5050
extra_query: Query | None = None,
5151
extra_body: Body | None = None,
5252
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
53-
) -> CallsAppWithSecret:
53+
) -> Optional[CallsAppWithSecret]:
5454
"""Creates a new Cloudflare calls app.
5555
5656
An app is an unique enviroment where each
@@ -81,7 +81,7 @@ def create(
8181
timeout=timeout,
8282
post_parser=ResultWrapper._unwrapper,
8383
),
84-
cast_to=cast(Type[CallsAppWithSecret], ResultWrapper[CallsAppWithSecret]),
84+
cast_to=cast(Type[Optional[CallsAppWithSecret]], ResultWrapper[CallsAppWithSecret]),
8585
)
8686

8787
def update(
@@ -96,7 +96,7 @@ def update(
9696
extra_query: Query | None = None,
9797
extra_body: Body | None = None,
9898
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
99-
) -> CallsApp:
99+
) -> Optional[CallsApp]:
100100
"""
101101
Edit details for a single app.
102102
@@ -129,7 +129,7 @@ def update(
129129
timeout=timeout,
130130
post_parser=ResultWrapper._unwrapper,
131131
),
132-
cast_to=cast(Type[CallsApp], ResultWrapper[CallsApp]),
132+
cast_to=cast(Type[Optional[CallsApp]], ResultWrapper[CallsApp]),
133133
)
134134

135135
def list(
@@ -179,7 +179,7 @@ def delete(
179179
extra_query: Query | None = None,
180180
extra_body: Body | None = None,
181181
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
182-
) -> CallsApp:
182+
) -> Optional[CallsApp]:
183183
"""
184184
Deletes an app from Cloudflare Calls
185185
@@ -209,7 +209,7 @@ def delete(
209209
timeout=timeout,
210210
post_parser=ResultWrapper._unwrapper,
211211
),
212-
cast_to=cast(Type[CallsApp], ResultWrapper[CallsApp]),
212+
cast_to=cast(Type[Optional[CallsApp]], ResultWrapper[CallsApp]),
213213
)
214214

215215
def get(
@@ -223,7 +223,7 @@ def get(
223223
extra_query: Query | None = None,
224224
extra_body: Body | None = None,
225225
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
226-
) -> CallsApp:
226+
) -> Optional[CallsApp]:
227227
"""
228228
Fetches details for a single Calls app.
229229
@@ -253,7 +253,7 @@ def get(
253253
timeout=timeout,
254254
post_parser=ResultWrapper._unwrapper,
255255
),
256-
cast_to=cast(Type[CallsApp], ResultWrapper[CallsApp]),
256+
cast_to=cast(Type[Optional[CallsApp]], ResultWrapper[CallsApp]),
257257
)
258258

259259

@@ -277,7 +277,7 @@ async def create(
277277
extra_query: Query | None = None,
278278
extra_body: Body | None = None,
279279
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
280-
) -> CallsAppWithSecret:
280+
) -> Optional[CallsAppWithSecret]:
281281
"""Creates a new Cloudflare calls app.
282282
283283
An app is an unique enviroment where each
@@ -308,7 +308,7 @@ async def create(
308308
timeout=timeout,
309309
post_parser=ResultWrapper._unwrapper,
310310
),
311-
cast_to=cast(Type[CallsAppWithSecret], ResultWrapper[CallsAppWithSecret]),
311+
cast_to=cast(Type[Optional[CallsAppWithSecret]], ResultWrapper[CallsAppWithSecret]),
312312
)
313313

314314
async def update(
@@ -323,7 +323,7 @@ async def update(
323323
extra_query: Query | None = None,
324324
extra_body: Body | None = None,
325325
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
326-
) -> CallsApp:
326+
) -> Optional[CallsApp]:
327327
"""
328328
Edit details for a single app.
329329
@@ -356,7 +356,7 @@ async def update(
356356
timeout=timeout,
357357
post_parser=ResultWrapper._unwrapper,
358358
),
359-
cast_to=cast(Type[CallsApp], ResultWrapper[CallsApp]),
359+
cast_to=cast(Type[Optional[CallsApp]], ResultWrapper[CallsApp]),
360360
)
361361

362362
def list(
@@ -406,7 +406,7 @@ async def delete(
406406
extra_query: Query | None = None,
407407
extra_body: Body | None = None,
408408
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
409-
) -> CallsApp:
409+
) -> Optional[CallsApp]:
410410
"""
411411
Deletes an app from Cloudflare Calls
412412
@@ -436,7 +436,7 @@ async def delete(
436436
timeout=timeout,
437437
post_parser=ResultWrapper._unwrapper,
438438
),
439-
cast_to=cast(Type[CallsApp], ResultWrapper[CallsApp]),
439+
cast_to=cast(Type[Optional[CallsApp]], ResultWrapper[CallsApp]),
440440
)
441441

442442
async def get(
@@ -450,7 +450,7 @@ async def get(
450450
extra_query: Query | None = None,
451451
extra_body: Body | None = None,
452452
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
453-
) -> CallsApp:
453+
) -> Optional[CallsApp]:
454454
"""
455455
Fetches details for a single Calls app.
456456
@@ -480,7 +480,7 @@ async def get(
480480
timeout=timeout,
481481
post_parser=ResultWrapper._unwrapper,
482482
),
483-
cast_to=cast(Type[CallsApp], ResultWrapper[CallsApp]),
483+
cast_to=cast(Type[Optional[CallsApp]], ResultWrapper[CallsApp]),
484484
)
485485

486486

src/cloudflare/resources/stream/audio_tracks.py

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

33
from __future__ import annotations
44

5-
from typing import Any, Type, cast
5+
from typing import Any, Type, Optional, cast
66

77
import httpx
88

@@ -55,7 +55,7 @@ def delete(
5555
extra_query: Query | None = None,
5656
extra_body: Body | None = None,
5757
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
58-
) -> AudioTrackDeleteResponse:
58+
) -> Optional[AudioTrackDeleteResponse]:
5959
"""Deletes additional audio tracks on a video.
6060
6161
Deleting a default audio track is
@@ -83,7 +83,7 @@ def delete(
8383
if not audio_identifier:
8484
raise ValueError(f"Expected a non-empty value for `audio_identifier` but received {audio_identifier!r}")
8585
return cast(
86-
AudioTrackDeleteResponse,
86+
Optional[AudioTrackDeleteResponse],
8787
self._delete(
8888
f"/accounts/{account_id}/stream/{identifier}/audio/{audio_identifier}",
8989
options=make_request_options(
@@ -112,7 +112,7 @@ def copy(
112112
extra_query: Query | None = None,
113113
extra_body: Body | None = None,
114114
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
115-
) -> Audio:
115+
) -> Optional[Audio]:
116116
"""
117117
Adds an additional audio track to a video using the provided audio track URL.
118118
@@ -156,7 +156,7 @@ def copy(
156156
timeout=timeout,
157157
post_parser=ResultWrapper._unwrapper,
158158
),
159-
cast_to=cast(Type[Audio], ResultWrapper[Audio]),
159+
cast_to=cast(Type[Optional[Audio]], ResultWrapper[Audio]),
160160
)
161161

162162
def edit(
@@ -173,7 +173,7 @@ def edit(
173173
extra_query: Query | None = None,
174174
extra_body: Body | None = None,
175175
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
176-
) -> Audio:
176+
) -> Optional[Audio]:
177177
"""Edits additional audio tracks on a video.
178178
179179
Editing the default status of an audio
@@ -222,7 +222,7 @@ def edit(
222222
timeout=timeout,
223223
post_parser=ResultWrapper._unwrapper,
224224
),
225-
cast_to=cast(Type[Audio], ResultWrapper[Audio]),
225+
cast_to=cast(Type[Optional[Audio]], ResultWrapper[Audio]),
226226
)
227227

228228
def get(
@@ -236,7 +236,7 @@ def get(
236236
extra_query: Query | None = None,
237237
extra_body: Body | None = None,
238238
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
239-
) -> AudioTrackGetResponse:
239+
) -> Optional[AudioTrackGetResponse]:
240240
"""Lists additional audio tracks on a video.
241241
242242
Note this API will not return
@@ -268,7 +268,7 @@ def get(
268268
timeout=timeout,
269269
post_parser=ResultWrapper._unwrapper,
270270
),
271-
cast_to=cast(Type[AudioTrackGetResponse], ResultWrapper[AudioTrackGetResponse]),
271+
cast_to=cast(Type[Optional[AudioTrackGetResponse]], ResultWrapper[AudioTrackGetResponse]),
272272
)
273273

274274

@@ -293,7 +293,7 @@ async def delete(
293293
extra_query: Query | None = None,
294294
extra_body: Body | None = None,
295295
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
296-
) -> AudioTrackDeleteResponse:
296+
) -> Optional[AudioTrackDeleteResponse]:
297297
"""Deletes additional audio tracks on a video.
298298
299299
Deleting a default audio track is
@@ -321,7 +321,7 @@ async def delete(
321321
if not audio_identifier:
322322
raise ValueError(f"Expected a non-empty value for `audio_identifier` but received {audio_identifier!r}")
323323
return cast(
324-
AudioTrackDeleteResponse,
324+
Optional[AudioTrackDeleteResponse],
325325
await self._delete(
326326
f"/accounts/{account_id}/stream/{identifier}/audio/{audio_identifier}",
327327
options=make_request_options(
@@ -350,7 +350,7 @@ async def copy(
350350
extra_query: Query | None = None,
351351
extra_body: Body | None = None,
352352
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
353-
) -> Audio:
353+
) -> Optional[Audio]:
354354
"""
355355
Adds an additional audio track to a video using the provided audio track URL.
356356
@@ -394,7 +394,7 @@ async def copy(
394394
timeout=timeout,
395395
post_parser=ResultWrapper._unwrapper,
396396
),
397-
cast_to=cast(Type[Audio], ResultWrapper[Audio]),
397+
cast_to=cast(Type[Optional[Audio]], ResultWrapper[Audio]),
398398
)
399399

400400
async def edit(
@@ -411,7 +411,7 @@ async def edit(
411411
extra_query: Query | None = None,
412412
extra_body: Body | None = None,
413413
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
414-
) -> Audio:
414+
) -> Optional[Audio]:
415415
"""Edits additional audio tracks on a video.
416416
417417
Editing the default status of an audio
@@ -460,7 +460,7 @@ async def edit(
460460
timeout=timeout,
461461
post_parser=ResultWrapper._unwrapper,
462462
),
463-
cast_to=cast(Type[Audio], ResultWrapper[Audio]),
463+
cast_to=cast(Type[Optional[Audio]], ResultWrapper[Audio]),
464464
)
465465

466466
async def get(
@@ -474,7 +474,7 @@ async def get(
474474
extra_query: Query | None = None,
475475
extra_body: Body | None = None,
476476
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
477-
) -> AudioTrackGetResponse:
477+
) -> Optional[AudioTrackGetResponse]:
478478
"""Lists additional audio tracks on a video.
479479
480480
Note this API will not return
@@ -506,7 +506,7 @@ async def get(
506506
timeout=timeout,
507507
post_parser=ResultWrapper._unwrapper,
508508
),
509-
cast_to=cast(Type[AudioTrackGetResponse], ResultWrapper[AudioTrackGetResponse]),
509+
cast_to=cast(Type[Optional[AudioTrackGetResponse]], ResultWrapper[AudioTrackGetResponse]),
510510
)
511511

512512

0 commit comments

Comments
 (0)