Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#315)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Apr 22, 2024
1 parent 51169d3 commit d42b574
Show file tree
Hide file tree
Showing 32 changed files with 462 additions and 475 deletions.
70 changes: 35 additions & 35 deletions api.md

Large diffs are not rendered by default.

34 changes: 17 additions & 17 deletions src/cloudflare/resources/calls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Type, cast
from typing import Type, Optional, cast

import httpx

Expand Down Expand Up @@ -50,7 +50,7 @@ def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> CallsAppWithSecret:
) -> Optional[CallsAppWithSecret]:
"""Creates a new Cloudflare calls app.
An app is an unique enviroment where each
Expand Down Expand Up @@ -81,7 +81,7 @@ def create(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[CallsAppWithSecret], ResultWrapper[CallsAppWithSecret]),
cast_to=cast(Type[Optional[CallsAppWithSecret]], ResultWrapper[CallsAppWithSecret]),
)

def update(
Expand All @@ -96,7 +96,7 @@ def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> CallsApp:
) -> Optional[CallsApp]:
"""
Edit details for a single app.
Expand Down Expand Up @@ -129,7 +129,7 @@ def update(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[CallsApp], ResultWrapper[CallsApp]),
cast_to=cast(Type[Optional[CallsApp]], ResultWrapper[CallsApp]),
)

def list(
Expand Down Expand Up @@ -179,7 +179,7 @@ def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> CallsApp:
) -> Optional[CallsApp]:
"""
Deletes an app from Cloudflare Calls
Expand Down Expand Up @@ -209,7 +209,7 @@ def delete(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[CallsApp], ResultWrapper[CallsApp]),
cast_to=cast(Type[Optional[CallsApp]], ResultWrapper[CallsApp]),
)

def get(
Expand All @@ -223,7 +223,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> CallsApp:
) -> Optional[CallsApp]:
"""
Fetches details for a single Calls app.
Expand Down Expand Up @@ -253,7 +253,7 @@ def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[CallsApp], ResultWrapper[CallsApp]),
cast_to=cast(Type[Optional[CallsApp]], ResultWrapper[CallsApp]),
)


Expand All @@ -277,7 +277,7 @@ async def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> CallsAppWithSecret:
) -> Optional[CallsAppWithSecret]:
"""Creates a new Cloudflare calls app.
An app is an unique enviroment where each
Expand Down Expand Up @@ -308,7 +308,7 @@ async def create(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[CallsAppWithSecret], ResultWrapper[CallsAppWithSecret]),
cast_to=cast(Type[Optional[CallsAppWithSecret]], ResultWrapper[CallsAppWithSecret]),
)

async def update(
Expand All @@ -323,7 +323,7 @@ async def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> CallsApp:
) -> Optional[CallsApp]:
"""
Edit details for a single app.
Expand Down Expand Up @@ -356,7 +356,7 @@ async def update(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[CallsApp], ResultWrapper[CallsApp]),
cast_to=cast(Type[Optional[CallsApp]], ResultWrapper[CallsApp]),
)

def list(
Expand Down Expand Up @@ -406,7 +406,7 @@ async def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> CallsApp:
) -> Optional[CallsApp]:
"""
Deletes an app from Cloudflare Calls
Expand Down Expand Up @@ -436,7 +436,7 @@ async def delete(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[CallsApp], ResultWrapper[CallsApp]),
cast_to=cast(Type[Optional[CallsApp]], ResultWrapper[CallsApp]),
)

async def get(
Expand All @@ -450,7 +450,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> CallsApp:
) -> Optional[CallsApp]:
"""
Fetches details for a single Calls app.
Expand Down Expand Up @@ -480,7 +480,7 @@ async def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[CallsApp], ResultWrapper[CallsApp]),
cast_to=cast(Type[Optional[CallsApp]], ResultWrapper[CallsApp]),
)


Expand Down
34 changes: 17 additions & 17 deletions src/cloudflare/resources/stream/audio_tracks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Any, Type, cast
from typing import Any, Type, Optional, cast

import httpx

Expand Down Expand Up @@ -55,7 +55,7 @@ def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AudioTrackDeleteResponse:
) -> Optional[AudioTrackDeleteResponse]:
"""Deletes additional audio tracks on a video.
Deleting a default audio track is
Expand Down Expand Up @@ -83,7 +83,7 @@ def delete(
if not audio_identifier:
raise ValueError(f"Expected a non-empty value for `audio_identifier` but received {audio_identifier!r}")
return cast(
AudioTrackDeleteResponse,
Optional[AudioTrackDeleteResponse],
self._delete(
f"/accounts/{account_id}/stream/{identifier}/audio/{audio_identifier}",
options=make_request_options(
Expand Down Expand Up @@ -112,7 +112,7 @@ def copy(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Audio:
) -> Optional[Audio]:
"""
Adds an additional audio track to a video using the provided audio track URL.
Expand Down Expand Up @@ -156,7 +156,7 @@ def copy(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Audio], ResultWrapper[Audio]),
cast_to=cast(Type[Optional[Audio]], ResultWrapper[Audio]),
)

def edit(
Expand All @@ -173,7 +173,7 @@ def edit(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Audio:
) -> Optional[Audio]:
"""Edits additional audio tracks on a video.
Editing the default status of an audio
Expand Down Expand Up @@ -222,7 +222,7 @@ def edit(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Audio], ResultWrapper[Audio]),
cast_to=cast(Type[Optional[Audio]], ResultWrapper[Audio]),
)

def get(
Expand All @@ -236,7 +236,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AudioTrackGetResponse:
) -> Optional[AudioTrackGetResponse]:
"""Lists additional audio tracks on a video.
Note this API will not return
Expand Down Expand Up @@ -268,7 +268,7 @@ def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[AudioTrackGetResponse], ResultWrapper[AudioTrackGetResponse]),
cast_to=cast(Type[Optional[AudioTrackGetResponse]], ResultWrapper[AudioTrackGetResponse]),
)


Expand All @@ -293,7 +293,7 @@ async def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AudioTrackDeleteResponse:
) -> Optional[AudioTrackDeleteResponse]:
"""Deletes additional audio tracks on a video.
Deleting a default audio track is
Expand Down Expand Up @@ -321,7 +321,7 @@ async def delete(
if not audio_identifier:
raise ValueError(f"Expected a non-empty value for `audio_identifier` but received {audio_identifier!r}")
return cast(
AudioTrackDeleteResponse,
Optional[AudioTrackDeleteResponse],
await self._delete(
f"/accounts/{account_id}/stream/{identifier}/audio/{audio_identifier}",
options=make_request_options(
Expand Down Expand Up @@ -350,7 +350,7 @@ async def copy(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Audio:
) -> Optional[Audio]:
"""
Adds an additional audio track to a video using the provided audio track URL.
Expand Down Expand Up @@ -394,7 +394,7 @@ async def copy(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Audio], ResultWrapper[Audio]),
cast_to=cast(Type[Optional[Audio]], ResultWrapper[Audio]),
)

async def edit(
Expand All @@ -411,7 +411,7 @@ async def edit(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Audio:
) -> Optional[Audio]:
"""Edits additional audio tracks on a video.
Editing the default status of an audio
Expand Down Expand Up @@ -460,7 +460,7 @@ async def edit(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Audio], ResultWrapper[Audio]),
cast_to=cast(Type[Optional[Audio]], ResultWrapper[Audio]),
)

async def get(
Expand All @@ -474,7 +474,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AudioTrackGetResponse:
) -> Optional[AudioTrackGetResponse]:
"""Lists additional audio tracks on a video.
Note this API will not return
Expand Down Expand Up @@ -506,7 +506,7 @@ async def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[AudioTrackGetResponse], ResultWrapper[AudioTrackGetResponse]),
cast_to=cast(Type[Optional[AudioTrackGetResponse]], ResultWrapper[AudioTrackGetResponse]),
)


Expand Down
Loading

0 comments on commit d42b574

Please sign in to comment.