Skip to content

Commit ac1e643

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): update via SDK Studio (#343)
1 parent 91dbab3 commit ac1e643

Some content is hidden

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

41 files changed

+2944
-365
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
configured_endpoints: 1259
1+
configured_endpoints: 1266

api.md

+66-4
Original file line numberDiff line numberDiff line change
@@ -4389,14 +4389,38 @@ Methods:
43894389
Types:
43904390

43914391
```python
4392-
from cloudflare.types.stream import Caption, CaptionDeleteResponse, CaptionGetResponse
4392+
from cloudflare.types.stream import Caption, CaptionGetResponse
43934393
```
43944394

43954395
Methods:
43964396

4397-
- <code title="put /accounts/{account_id}/stream/{identifier}/captions/{language}">client.stream.captions.<a href="./src/cloudflare/resources/stream/captions.py">update</a>(language, \*, account_id, identifier, \*\*<a href="src/cloudflare/types/stream/caption_update_params.py">params</a>) -> <a href="./src/cloudflare/types/stream/caption.py">Optional</a></code>
4398-
- <code title="delete /accounts/{account_id}/stream/{identifier}/captions/{language}">client.stream.captions.<a href="./src/cloudflare/resources/stream/captions.py">delete</a>(language, \*, account_id, identifier, \*\*<a href="src/cloudflare/types/stream/caption_delete_params.py">params</a>) -> <a href="./src/cloudflare/types/stream/caption_delete_response.py">str</a></code>
4399-
- <code title="get /accounts/{account_id}/stream/{identifier}/captions">client.stream.captions.<a href="./src/cloudflare/resources/stream/captions.py">get</a>(identifier, \*, account_id) -> <a href="./src/cloudflare/types/stream/caption_get_response.py">Optional</a></code>
4397+
- <code title="get /accounts/{account_id}/stream/{identifier}/captions">client.stream.captions.<a href="./src/cloudflare/resources/stream/captions/captions.py">get</a>(identifier, \*, account_id) -> <a href="./src/cloudflare/types/stream/caption_get_response.py">Optional</a></code>
4398+
4399+
### Language
4400+
4401+
Types:
4402+
4403+
```python
4404+
from cloudflare.types.stream.captions import LanguageDeleteResponse
4405+
```
4406+
4407+
Methods:
4408+
4409+
- <code title="put /accounts/{account_id}/stream/{identifier}/captions/{language}">client.stream.captions.language.<a href="./src/cloudflare/resources/stream/captions/language/language.py">update</a>(language, \*, account_id, identifier, \*\*<a href="src/cloudflare/types/stream/captions/language_update_params.py">params</a>) -> <a href="./src/cloudflare/types/stream/caption.py">Optional</a></code>
4410+
- <code title="delete /accounts/{account_id}/stream/{identifier}/captions/{language}">client.stream.captions.language.<a href="./src/cloudflare/resources/stream/captions/language/language.py">delete</a>(language, \*, account_id, identifier, \*\*<a href="src/cloudflare/types/stream/captions/language_delete_params.py">params</a>) -> <a href="./src/cloudflare/types/stream/captions/language_delete_response.py">str</a></code>
4411+
- <code title="get /accounts/{account_id}/stream/{identifier}/captions/{language}">client.stream.captions.language.<a href="./src/cloudflare/resources/stream/captions/language/language.py">get</a>(language, \*, account_id, identifier) -> <a href="./src/cloudflare/types/stream/caption.py">Optional</a></code>
4412+
4413+
#### Vtt
4414+
4415+
Types:
4416+
4417+
```python
4418+
from cloudflare.types.stream.captions.language import VttGetResponse
4419+
```
4420+
4421+
Methods:
4422+
4423+
- <code title="get /accounts/{account_id}/stream/{identifier}/captions/{language}/vtt">client.stream.captions.language.vtt.<a href="./src/cloudflare/resources/stream/captions/language/vtt.py">get</a>(language, \*, account_id, identifier, \*\*<a href="src/cloudflare/types/stream/captions/language/vtt_get_params.py">params</a>) -> str</code>
44004424

44014425
## Downloads
44024426

@@ -5920,6 +5944,44 @@ Methods:
59205944
- <code title="delete /accounts/{account_id}/teamnet/virtual_networks/{virtual_network_id}">client.zero_trust.networks.virtual_networks.<a href="./src/cloudflare/resources/zero_trust/networks/virtual_networks.py">delete</a>(virtual_network_id, \*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/networks/virtual_network_delete_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/networks/virtual_network_delete_response.py">VirtualNetworkDeleteResponse</a></code>
59215945
- <code title="patch /accounts/{account_id}/teamnet/virtual_networks/{virtual_network_id}">client.zero_trust.networks.virtual_networks.<a href="./src/cloudflare/resources/zero_trust/networks/virtual_networks.py">edit</a>(virtual_network_id, \*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/networks/virtual_network_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/networks/virtual_network_edit_response.py">VirtualNetworkEditResponse</a></code>
59225946

5947+
## RiskScoring
5948+
5949+
Types:
5950+
5951+
```python
5952+
from cloudflare.types.zero_trust import RiskScoringGetResponse, RiskScoringResetResponse
5953+
```
5954+
5955+
Methods:
5956+
5957+
- <code title="get /accounts/{account_identifier}/zt_risk_scoring/{user_id}">client.zero_trust.risk_scoring.<a href="./src/cloudflare/resources/zero_trust/risk_scoring/risk_scoring.py">get</a>(user_id, \*, account_identifier, \*\*<a href="src/cloudflare/types/zero_trust/risk_scoring_get_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/risk_scoring_get_response.py">RiskScoringGetResponse</a></code>
5958+
- <code title="post /accounts/{account_identifier}/zt_risk_scoring/{user_id}/reset">client.zero_trust.risk_scoring.<a href="./src/cloudflare/resources/zero_trust/risk_scoring/risk_scoring.py">reset</a>(user_id, \*, account_identifier) -> <a href="./src/cloudflare/types/zero_trust/risk_scoring_reset_response.py">RiskScoringResetResponse</a></code>
5959+
5960+
### Behaviours
5961+
5962+
Types:
5963+
5964+
```python
5965+
from cloudflare.types.zero_trust.risk_scoring import BehaviourUpdateResponse, BehaviourGetResponse
5966+
```
5967+
5968+
Methods:
5969+
5970+
- <code title="put /accounts/{account_identifier}/zt_risk_scoring/behaviors">client.zero_trust.risk_scoring.behaviours.<a href="./src/cloudflare/resources/zero_trust/risk_scoring/behaviours.py">update</a>(account_identifier, \*\*<a href="src/cloudflare/types/zero_trust/risk_scoring/behaviour_update_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/risk_scoring/behaviour_update_response.py">BehaviourUpdateResponse</a></code>
5971+
- <code title="get /accounts/{account_identifier}/zt_risk_scoring/behaviors">client.zero_trust.risk_scoring.behaviours.<a href="./src/cloudflare/resources/zero_trust/risk_scoring/behaviours.py">get</a>(account_identifier) -> <a href="./src/cloudflare/types/zero_trust/risk_scoring/behaviour_get_response.py">BehaviourGetResponse</a></code>
5972+
5973+
### Summary
5974+
5975+
Types:
5976+
5977+
```python
5978+
from cloudflare.types.zero_trust.risk_scoring import SummaryGetResponse
5979+
```
5980+
5981+
Methods:
5982+
5983+
- <code title="get /accounts/{account_identifier}/zt_risk_scoring/summary">client.zero_trust.risk_scoring.summary.<a href="./src/cloudflare/resources/zero_trust/risk_scoring/summary.py">get</a>(account_identifier, \*\*<a href="src/cloudflare/types/zero_trust/risk_scoring/summary_get_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/risk_scoring/summary_get_response.py">SummaryGetResponse</a></code>
5984+
59235985
# Challenges
59245986

59255987
## Widgets
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from .captions import (
4+
Captions,
5+
AsyncCaptions,
6+
CaptionsWithRawResponse,
7+
AsyncCaptionsWithRawResponse,
8+
CaptionsWithStreamingResponse,
9+
AsyncCaptionsWithStreamingResponse,
10+
)
11+
from .language import (
12+
Language,
13+
AsyncLanguage,
14+
LanguageWithRawResponse,
15+
AsyncLanguageWithRawResponse,
16+
LanguageWithStreamingResponse,
17+
AsyncLanguageWithStreamingResponse,
18+
)
19+
20+
__all__ = [
21+
"Language",
22+
"AsyncLanguage",
23+
"LanguageWithRawResponse",
24+
"AsyncLanguageWithRawResponse",
25+
"LanguageWithStreamingResponse",
26+
"AsyncLanguageWithStreamingResponse",
27+
"Captions",
28+
"AsyncCaptions",
29+
"CaptionsWithRawResponse",
30+
"AsyncCaptionsWithRawResponse",
31+
"CaptionsWithStreamingResponse",
32+
"AsyncCaptionsWithStreamingResponse",
33+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing import Type, Optional, cast
6+
7+
import httpx
8+
9+
from .language import (
10+
Language,
11+
AsyncLanguage,
12+
LanguageWithRawResponse,
13+
AsyncLanguageWithRawResponse,
14+
LanguageWithStreamingResponse,
15+
AsyncLanguageWithStreamingResponse,
16+
)
17+
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
18+
from ...._compat import cached_property
19+
from ...._resource import SyncAPIResource, AsyncAPIResource
20+
from ...._response import (
21+
to_raw_response_wrapper,
22+
to_streamed_response_wrapper,
23+
async_to_raw_response_wrapper,
24+
async_to_streamed_response_wrapper,
25+
)
26+
from ...._wrappers import ResultWrapper
27+
from ...._base_client import (
28+
make_request_options,
29+
)
30+
from ....types.stream import CaptionGetResponse
31+
from .language.language import Language, AsyncLanguage
32+
33+
__all__ = ["Captions", "AsyncCaptions"]
34+
35+
36+
class Captions(SyncAPIResource):
37+
@cached_property
38+
def language(self) -> Language:
39+
return Language(self._client)
40+
41+
@cached_property
42+
def with_raw_response(self) -> CaptionsWithRawResponse:
43+
return CaptionsWithRawResponse(self)
44+
45+
@cached_property
46+
def with_streaming_response(self) -> CaptionsWithStreamingResponse:
47+
return CaptionsWithStreamingResponse(self)
48+
49+
def get(
50+
self,
51+
identifier: str,
52+
*,
53+
account_id: str,
54+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
55+
# The extra values given here take precedence over values defined on the client or passed to this method.
56+
extra_headers: Headers | None = None,
57+
extra_query: Query | None = None,
58+
extra_body: Body | None = None,
59+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
60+
) -> Optional[CaptionGetResponse]:
61+
"""
62+
Lists the available captions or subtitles for a specific video.
63+
64+
Args:
65+
account_id: Identifier
66+
67+
identifier: A Cloudflare-generated unique identifier for a media item.
68+
69+
extra_headers: Send extra headers
70+
71+
extra_query: Add additional query parameters to the request
72+
73+
extra_body: Add additional JSON properties to the request
74+
75+
timeout: Override the client-level default timeout for this request, in seconds
76+
"""
77+
if not account_id:
78+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
79+
if not identifier:
80+
raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}")
81+
return self._get(
82+
f"/accounts/{account_id}/stream/{identifier}/captions",
83+
options=make_request_options(
84+
extra_headers=extra_headers,
85+
extra_query=extra_query,
86+
extra_body=extra_body,
87+
timeout=timeout,
88+
post_parser=ResultWrapper[Optional[CaptionGetResponse]]._unwrapper,
89+
),
90+
cast_to=cast(Type[Optional[CaptionGetResponse]], ResultWrapper[CaptionGetResponse]),
91+
)
92+
93+
94+
class AsyncCaptions(AsyncAPIResource):
95+
@cached_property
96+
def language(self) -> AsyncLanguage:
97+
return AsyncLanguage(self._client)
98+
99+
@cached_property
100+
def with_raw_response(self) -> AsyncCaptionsWithRawResponse:
101+
return AsyncCaptionsWithRawResponse(self)
102+
103+
@cached_property
104+
def with_streaming_response(self) -> AsyncCaptionsWithStreamingResponse:
105+
return AsyncCaptionsWithStreamingResponse(self)
106+
107+
async def get(
108+
self,
109+
identifier: str,
110+
*,
111+
account_id: str,
112+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
113+
# The extra values given here take precedence over values defined on the client or passed to this method.
114+
extra_headers: Headers | None = None,
115+
extra_query: Query | None = None,
116+
extra_body: Body | None = None,
117+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
118+
) -> Optional[CaptionGetResponse]:
119+
"""
120+
Lists the available captions or subtitles for a specific video.
121+
122+
Args:
123+
account_id: Identifier
124+
125+
identifier: A Cloudflare-generated unique identifier for a media item.
126+
127+
extra_headers: Send extra headers
128+
129+
extra_query: Add additional query parameters to the request
130+
131+
extra_body: Add additional JSON properties to the request
132+
133+
timeout: Override the client-level default timeout for this request, in seconds
134+
"""
135+
if not account_id:
136+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
137+
if not identifier:
138+
raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}")
139+
return await self._get(
140+
f"/accounts/{account_id}/stream/{identifier}/captions",
141+
options=make_request_options(
142+
extra_headers=extra_headers,
143+
extra_query=extra_query,
144+
extra_body=extra_body,
145+
timeout=timeout,
146+
post_parser=ResultWrapper[Optional[CaptionGetResponse]]._unwrapper,
147+
),
148+
cast_to=cast(Type[Optional[CaptionGetResponse]], ResultWrapper[CaptionGetResponse]),
149+
)
150+
151+
152+
class CaptionsWithRawResponse:
153+
def __init__(self, captions: Captions) -> None:
154+
self._captions = captions
155+
156+
self.get = to_raw_response_wrapper(
157+
captions.get,
158+
)
159+
160+
@cached_property
161+
def language(self) -> LanguageWithRawResponse:
162+
return LanguageWithRawResponse(self._captions.language)
163+
164+
165+
class AsyncCaptionsWithRawResponse:
166+
def __init__(self, captions: AsyncCaptions) -> None:
167+
self._captions = captions
168+
169+
self.get = async_to_raw_response_wrapper(
170+
captions.get,
171+
)
172+
173+
@cached_property
174+
def language(self) -> AsyncLanguageWithRawResponse:
175+
return AsyncLanguageWithRawResponse(self._captions.language)
176+
177+
178+
class CaptionsWithStreamingResponse:
179+
def __init__(self, captions: Captions) -> None:
180+
self._captions = captions
181+
182+
self.get = to_streamed_response_wrapper(
183+
captions.get,
184+
)
185+
186+
@cached_property
187+
def language(self) -> LanguageWithStreamingResponse:
188+
return LanguageWithStreamingResponse(self._captions.language)
189+
190+
191+
class AsyncCaptionsWithStreamingResponse:
192+
def __init__(self, captions: AsyncCaptions) -> None:
193+
self._captions = captions
194+
195+
self.get = async_to_streamed_response_wrapper(
196+
captions.get,
197+
)
198+
199+
@cached_property
200+
def language(self) -> AsyncLanguageWithStreamingResponse:
201+
return AsyncLanguageWithStreamingResponse(self._captions.language)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from .vtt import (
4+
Vtt,
5+
AsyncVtt,
6+
VttWithRawResponse,
7+
AsyncVttWithRawResponse,
8+
VttWithStreamingResponse,
9+
AsyncVttWithStreamingResponse,
10+
)
11+
from .language import (
12+
Language,
13+
AsyncLanguage,
14+
LanguageWithRawResponse,
15+
AsyncLanguageWithRawResponse,
16+
LanguageWithStreamingResponse,
17+
AsyncLanguageWithStreamingResponse,
18+
)
19+
20+
__all__ = [
21+
"Vtt",
22+
"AsyncVtt",
23+
"VttWithRawResponse",
24+
"AsyncVttWithRawResponse",
25+
"VttWithStreamingResponse",
26+
"AsyncVttWithStreamingResponse",
27+
"Language",
28+
"AsyncLanguage",
29+
"LanguageWithRawResponse",
30+
"AsyncLanguageWithRawResponse",
31+
"LanguageWithStreamingResponse",
32+
"AsyncLanguageWithStreamingResponse",
33+
]

0 commit comments

Comments
 (0)