Skip to content

Commit c5ce2f3

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat: update via SDK Studio (#70)
1 parent b28434f commit c5ce2f3

File tree

17 files changed

+615
-79
lines changed

17 files changed

+615
-79
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
configured_endpoints: 1235
1+
configured_endpoints: 1236

api.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -4829,7 +4829,7 @@ Methods:
48294829
Types:
48304830

48314831
```python
4832-
from cloudflare.types.request_tracers import TraceCreateResponse
4832+
from cloudflare.types.request_tracers import HhgJaXcvTrace, TraceCreateResponse
48334833
```
48344834

48354835
Methods:
@@ -6013,6 +6013,18 @@ Methods:
60136013
- <code title="patch /accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/settings">client.workers_for_platforms.dispatch.namespaces.scripts.settings.<a href="./src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/settings.py">edit</a>(script_name, \*, account_id, dispatch_namespace, \*\*<a href="src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_response.py">SettingEditResponse</a></code>
60146014
- <code title="get /accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/settings">client.workers_for_platforms.dispatch.namespaces.scripts.settings.<a href="./src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/settings.py">get</a>(script_name, \*, account_id, dispatch_namespace) -> <a href="./src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_get_response.py">SettingGetResponse</a></code>
60156015

6016+
##### Bindings
6017+
6018+
Types:
6019+
6020+
```python
6021+
from cloudflare.types.workers_for_platforms.dispatch.namespaces.scripts import BindingGetResponse
6022+
```
6023+
6024+
Methods:
6025+
6026+
- <code title="get /accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/bindings">client.workers_for_platforms.dispatch.namespaces.scripts.bindings.<a href="./src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/bindings.py">get</a>(script_name, \*, account_id, dispatch_namespace) -> <a href="./src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/binding_get_response.py">BindingGetResponse</a></code>
6027+
60166028
# ZeroTrust
60176029

60186030
## ConnectivitySettings

src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/__init__.py

+14
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@
1616
ScriptsWithStreamingResponse,
1717
AsyncScriptsWithStreamingResponse,
1818
)
19+
from .bindings import (
20+
Bindings,
21+
AsyncBindings,
22+
BindingsWithRawResponse,
23+
AsyncBindingsWithRawResponse,
24+
BindingsWithStreamingResponse,
25+
AsyncBindingsWithStreamingResponse,
26+
)
1927
from .settings import (
2028
Settings,
2129
AsyncSettings,
@@ -38,6 +46,12 @@
3846
"AsyncSettingsWithRawResponse",
3947
"SettingsWithStreamingResponse",
4048
"AsyncSettingsWithStreamingResponse",
49+
"Bindings",
50+
"AsyncBindings",
51+
"BindingsWithRawResponse",
52+
"AsyncBindingsWithRawResponse",
53+
"BindingsWithStreamingResponse",
54+
"AsyncBindingsWithStreamingResponse",
4155
"Scripts",
4256
"AsyncScripts",
4357
"ScriptsWithRawResponse",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
# File generated from our OpenAPI spec by Stainless.
2+
3+
from __future__ import annotations
4+
5+
from typing import Any, cast
6+
7+
import httpx
8+
9+
from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven
10+
from ......_compat import cached_property
11+
from ......_resource import SyncAPIResource, AsyncAPIResource
12+
from ......_response import (
13+
to_raw_response_wrapper,
14+
to_streamed_response_wrapper,
15+
async_to_raw_response_wrapper,
16+
async_to_streamed_response_wrapper,
17+
)
18+
from ......_base_client import (
19+
make_request_options,
20+
)
21+
from ......types.workers_for_platforms.dispatch.namespaces.scripts import BindingGetResponse
22+
23+
__all__ = ["Bindings", "AsyncBindings"]
24+
25+
26+
class Bindings(SyncAPIResource):
27+
@cached_property
28+
def with_raw_response(self) -> BindingsWithRawResponse:
29+
return BindingsWithRawResponse(self)
30+
31+
@cached_property
32+
def with_streaming_response(self) -> BindingsWithStreamingResponse:
33+
return BindingsWithStreamingResponse(self)
34+
35+
def get(
36+
self,
37+
script_name: str,
38+
*,
39+
account_id: str,
40+
dispatch_namespace: str,
41+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
42+
# The extra values given here take precedence over values defined on the client or passed to this method.
43+
extra_headers: Headers | None = None,
44+
extra_query: Query | None = None,
45+
extra_body: Body | None = None,
46+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
47+
) -> BindingGetResponse:
48+
"""
49+
Fetch script bindings from a script uploaded to a Workers for Platforms
50+
namespace.
51+
52+
Args:
53+
account_id: Identifier
54+
55+
dispatch_namespace: Name of the Workers for Platforms dispatch namespace.
56+
57+
script_name: Name of the script, used in URLs and route configuration.
58+
59+
extra_headers: Send extra headers
60+
61+
extra_query: Add additional query parameters to the request
62+
63+
extra_body: Add additional JSON properties to the request
64+
65+
timeout: Override the client-level default timeout for this request, in seconds
66+
"""
67+
if not account_id:
68+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
69+
if not dispatch_namespace:
70+
raise ValueError(f"Expected a non-empty value for `dispatch_namespace` but received {dispatch_namespace!r}")
71+
if not script_name:
72+
raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}")
73+
return cast(
74+
BindingGetResponse,
75+
self._get(
76+
f"/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/bindings",
77+
options=make_request_options(
78+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
79+
),
80+
cast_to=cast(
81+
Any, BindingGetResponse
82+
), # Union types cannot be passed in as arguments in the type system
83+
),
84+
)
85+
86+
87+
class AsyncBindings(AsyncAPIResource):
88+
@cached_property
89+
def with_raw_response(self) -> AsyncBindingsWithRawResponse:
90+
return AsyncBindingsWithRawResponse(self)
91+
92+
@cached_property
93+
def with_streaming_response(self) -> AsyncBindingsWithStreamingResponse:
94+
return AsyncBindingsWithStreamingResponse(self)
95+
96+
async def get(
97+
self,
98+
script_name: str,
99+
*,
100+
account_id: str,
101+
dispatch_namespace: str,
102+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
103+
# The extra values given here take precedence over values defined on the client or passed to this method.
104+
extra_headers: Headers | None = None,
105+
extra_query: Query | None = None,
106+
extra_body: Body | None = None,
107+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
108+
) -> BindingGetResponse:
109+
"""
110+
Fetch script bindings from a script uploaded to a Workers for Platforms
111+
namespace.
112+
113+
Args:
114+
account_id: Identifier
115+
116+
dispatch_namespace: Name of the Workers for Platforms dispatch namespace.
117+
118+
script_name: Name of the script, used in URLs and route configuration.
119+
120+
extra_headers: Send extra headers
121+
122+
extra_query: Add additional query parameters to the request
123+
124+
extra_body: Add additional JSON properties to the request
125+
126+
timeout: Override the client-level default timeout for this request, in seconds
127+
"""
128+
if not account_id:
129+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
130+
if not dispatch_namespace:
131+
raise ValueError(f"Expected a non-empty value for `dispatch_namespace` but received {dispatch_namespace!r}")
132+
if not script_name:
133+
raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}")
134+
return cast(
135+
BindingGetResponse,
136+
await self._get(
137+
f"/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/bindings",
138+
options=make_request_options(
139+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
140+
),
141+
cast_to=cast(
142+
Any, BindingGetResponse
143+
), # Union types cannot be passed in as arguments in the type system
144+
),
145+
)
146+
147+
148+
class BindingsWithRawResponse:
149+
def __init__(self, bindings: Bindings) -> None:
150+
self._bindings = bindings
151+
152+
self.get = to_raw_response_wrapper(
153+
bindings.get,
154+
)
155+
156+
157+
class AsyncBindingsWithRawResponse:
158+
def __init__(self, bindings: AsyncBindings) -> None:
159+
self._bindings = bindings
160+
161+
self.get = async_to_raw_response_wrapper(
162+
bindings.get,
163+
)
164+
165+
166+
class BindingsWithStreamingResponse:
167+
def __init__(self, bindings: Bindings) -> None:
168+
self._bindings = bindings
169+
170+
self.get = to_streamed_response_wrapper(
171+
bindings.get,
172+
)
173+
174+
175+
class AsyncBindingsWithStreamingResponse:
176+
def __init__(self, bindings: AsyncBindings) -> None:
177+
self._bindings = bindings
178+
179+
self.get = async_to_streamed_response_wrapper(
180+
bindings.get,
181+
)

src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/scripts.py

+32
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@
1010
ContentWithStreamingResponse,
1111
AsyncContentWithStreamingResponse,
1212
)
13+
from .bindings import (
14+
Bindings,
15+
AsyncBindings,
16+
BindingsWithRawResponse,
17+
AsyncBindingsWithRawResponse,
18+
BindingsWithStreamingResponse,
19+
AsyncBindingsWithStreamingResponse,
20+
)
1321
from .settings import (
1422
Settings,
1523
AsyncSettings,
@@ -33,6 +41,10 @@ def content(self) -> Content:
3341
def settings(self) -> Settings:
3442
return Settings(self._client)
3543

44+
@cached_property
45+
def bindings(self) -> Bindings:
46+
return Bindings(self._client)
47+
3648
@cached_property
3749
def with_raw_response(self) -> ScriptsWithRawResponse:
3850
return ScriptsWithRawResponse(self)
@@ -51,6 +63,10 @@ def content(self) -> AsyncContent:
5163
def settings(self) -> AsyncSettings:
5264
return AsyncSettings(self._client)
5365

66+
@cached_property
67+
def bindings(self) -> AsyncBindings:
68+
return AsyncBindings(self._client)
69+
5470
@cached_property
5571
def with_raw_response(self) -> AsyncScriptsWithRawResponse:
5672
return AsyncScriptsWithRawResponse(self)
@@ -72,6 +88,10 @@ def content(self) -> ContentWithRawResponse:
7288
def settings(self) -> SettingsWithRawResponse:
7389
return SettingsWithRawResponse(self._scripts.settings)
7490

91+
@cached_property
92+
def bindings(self) -> BindingsWithRawResponse:
93+
return BindingsWithRawResponse(self._scripts.bindings)
94+
7595

7696
class AsyncScriptsWithRawResponse:
7797
def __init__(self, scripts: AsyncScripts) -> None:
@@ -85,6 +105,10 @@ def content(self) -> AsyncContentWithRawResponse:
85105
def settings(self) -> AsyncSettingsWithRawResponse:
86106
return AsyncSettingsWithRawResponse(self._scripts.settings)
87107

108+
@cached_property
109+
def bindings(self) -> AsyncBindingsWithRawResponse:
110+
return AsyncBindingsWithRawResponse(self._scripts.bindings)
111+
88112

89113
class ScriptsWithStreamingResponse:
90114
def __init__(self, scripts: Scripts) -> None:
@@ -98,6 +122,10 @@ def content(self) -> ContentWithStreamingResponse:
98122
def settings(self) -> SettingsWithStreamingResponse:
99123
return SettingsWithStreamingResponse(self._scripts.settings)
100124

125+
@cached_property
126+
def bindings(self) -> BindingsWithStreamingResponse:
127+
return BindingsWithStreamingResponse(self._scripts.bindings)
128+
101129

102130
class AsyncScriptsWithStreamingResponse:
103131
def __init__(self, scripts: AsyncScripts) -> None:
@@ -110,3 +138,7 @@ def content(self) -> AsyncContentWithStreamingResponse:
110138
@cached_property
111139
def settings(self) -> AsyncSettingsWithStreamingResponse:
112140
return AsyncSettingsWithStreamingResponse(self._scripts.settings)
141+
142+
@cached_property
143+
def bindings(self) -> AsyncBindingsWithStreamingResponse:
144+
return AsyncBindingsWithStreamingResponse(self._scripts.bindings)

src/cloudflare/types/radar/email/security/top/__init__.py

-3
This file was deleted.

src/cloudflare/types/radar/email/security/top/ases/__init__.py

-3
This file was deleted.

src/cloudflare/types/radar/email/security/top/locations/__init__.py

-3
This file was deleted.

src/cloudflare/types/request_tracers/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22

33
from __future__ import annotations
44

5+
from .hhg_ja_xcv_trace import HhgJaXcvTrace as HhgJaXcvTrace
56
from .trace_create_params import TraceCreateParams as TraceCreateParams
67
from .trace_create_response import TraceCreateResponse as TraceCreateResponse
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# File generated from our OpenAPI spec by Stainless.
2+
3+
from __future__ import annotations
4+
5+
from typing import List, Optional
6+
7+
from ..._compat import PYDANTIC_V2
8+
from ..._models import BaseModel
9+
10+
__all__ = ["HhgJaXcvTrace", "HhgJaXcvTraceItem"]
11+
12+
13+
class HhgJaXcvTraceItem(BaseModel):
14+
action: Optional[str] = None
15+
"""If step type is rule, then action performed by this rule"""
16+
17+
action_parameters: Optional[object] = None
18+
"""If step type is rule, then action parameters of this rule as JSON"""
19+
20+
description: Optional[str] = None
21+
"""If step type is rule or ruleset, the description of this entity"""
22+
23+
expression: Optional[str] = None
24+
"""If step type is rule, then expression used to match for this rule"""
25+
26+
kind: Optional[str] = None
27+
"""If step type is ruleset, then kind of this ruleset"""
28+
29+
matched: Optional[bool] = None
30+
"""Whether tracing step affected tracing request/response"""
31+
32+
name: Optional[str] = None
33+
"""If step type is ruleset, then name of this ruleset"""
34+
35+
step_name: Optional[str] = None
36+
"""Tracing step identifying name"""
37+
38+
trace: Optional[HhgJaXcvTrace] = None
39+
40+
type: Optional[str] = None
41+
"""Tracing step type"""
42+
43+
44+
HhgJaXcvTrace = List[HhgJaXcvTraceItem]
45+
46+
if PYDANTIC_V2:
47+
HhgJaXcvTraceItem.model_rebuild()
48+
else:
49+
HhgJaXcvTraceItem.update_forward_refs() # type: ignore

0 commit comments

Comments
 (0)