Skip to content

Commit df84d3a

Browse files
feat(api): manual updates (#2302)
1 parent 91253c2 commit df84d3a

22 files changed

+3471
-2
lines changed

.stats.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 1475
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-663ea50351c42f1c51f49f099c888745f6a06cf22b8fe46cf1fa9ae89fdfdd61.yml
1+
configured_endpoints: 1483
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f9dc65d353b377858f3d63d594de47559ed3a9d562295719690867315b8ec2fe.yml

api.md

+45
Original file line numberDiff line numberDiff line change
@@ -6594,6 +6594,51 @@ Methods:
65946594
- <code title="get /accounts/{account_id}/vectorize/v2/indexes/{index_name}/metadata_index/list">client.vectorize.indexes.metadata_index.<a href="./src/cloudflare/resources/vectorize/indexes/metadata_index.py">list</a>(index_name, \*, account_id) -> <a href="./src/cloudflare/types/vectorize/indexes/metadata_index_list_response.py">Optional[MetadataIndexListResponse]</a></code>
65956595
- <code title="post /accounts/{account_id}/vectorize/v2/indexes/{index_name}/metadata_index/delete">client.vectorize.indexes.metadata_index.<a href="./src/cloudflare/resources/vectorize/indexes/metadata_index.py">delete</a>(index_name, \*, account_id, \*\*<a href="src/cloudflare/types/vectorize/indexes/metadata_index_delete_params.py">params</a>) -> <a href="./src/cloudflare/types/vectorize/indexes/metadata_index_delete_response.py">Optional[MetadataIndexDeleteResponse]</a></code>
65966596

6597+
# URLScanner
6598+
6599+
Types:
6600+
6601+
```python
6602+
from cloudflare.types.url_scanner import URLScannerDomain, URLScannerTask
6603+
```
6604+
6605+
## Responses
6606+
6607+
Types:
6608+
6609+
```python
6610+
from cloudflare.types.url_scanner import ResponseGetResponse
6611+
```
6612+
6613+
Methods:
6614+
6615+
- <code title="get /accounts/{account_id}/urlscanner/v2/responses/{response_id}">client.url_scanner.responses.<a href="./src/cloudflare/resources/url_scanner/responses.py">get</a>(response_id, \*, account_id) -> str</code>
6616+
6617+
## Scans
6618+
6619+
Types:
6620+
6621+
```python
6622+
from cloudflare.types.url_scanner import (
6623+
ScanCreateResponse,
6624+
ScanListResponse,
6625+
ScanBulkCreateResponse,
6626+
ScanDOMResponse,
6627+
ScanGetResponse,
6628+
ScanHARResponse,
6629+
)
6630+
```
6631+
6632+
Methods:
6633+
6634+
- <code title="post /accounts/{account_id}/urlscanner/v2/scan">client.url_scanner.scans.<a href="./src/cloudflare/resources/url_scanner/scans.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/url_scanner/scan_create_params.py">params</a>) -> <a href="./src/cloudflare/types/url_scanner/scan_create_response.py">str</a></code>
6635+
- <code title="get /accounts/{account_id}/urlscanner/v2/search">client.url_scanner.scans.<a href="./src/cloudflare/resources/url_scanner/scans.py">list</a>(\*, account_id, \*\*<a href="src/cloudflare/types/url_scanner/scan_list_params.py">params</a>) -> <a href="./src/cloudflare/types/url_scanner/scan_list_response.py">ScanListResponse</a></code>
6636+
- <code title="post /accounts/{account_id}/urlscanner/v2/bulk">client.url_scanner.scans.<a href="./src/cloudflare/resources/url_scanner/scans.py">bulk_create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/url_scanner/scan_bulk_create_params.py">params</a>) -> <a href="./src/cloudflare/types/url_scanner/scan_bulk_create_response.py">ScanBulkCreateResponse</a></code>
6637+
- <code title="get /accounts/{account_id}/urlscanner/v2/dom/{scan_id}">client.url_scanner.scans.<a href="./src/cloudflare/resources/url_scanner/scans.py">dom</a>(scan_id, \*, account_id) -> str</code>
6638+
- <code title="get /accounts/{account_id}/urlscanner/v2/result/{scan_id}">client.url_scanner.scans.<a href="./src/cloudflare/resources/url_scanner/scans.py">get</a>(scan_id, \*, account_id) -> <a href="./src/cloudflare/types/url_scanner/scan_get_response.py">ScanGetResponse</a></code>
6639+
- <code title="get /accounts/{account_id}/urlscanner/v2/har/{scan_id}">client.url_scanner.scans.<a href="./src/cloudflare/resources/url_scanner/scans.py">har</a>(scan_id, \*, account_id) -> <a href="./src/cloudflare/types/url_scanner/scan_har_response.py">ScanHARResponse</a></code>
6640+
- <code title="get /accounts/{account_id}/urlscanner/v2/screenshots/{scan_id}.png">client.url_scanner.scans.<a href="./src/cloudflare/resources/url_scanner/scans.py">screenshot</a>(scan_id, \*, account_id, \*\*<a href="src/cloudflare/types/url_scanner/scan_screenshot_params.py">params</a>) -> BinaryAPIResponse</code>
6641+
65976642
# Radar
65986643

65996644
## AI

src/cloudflare/_client.py

+38
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
memberships,
8989
page_shield,
9090
rate_limits,
91+
url_scanner,
9192
dns_firewall,
9293
healthchecks,
9394
security_txt,
@@ -185,6 +186,7 @@
185186
from .resources.botnet_feed.botnet_feed import BotnetFeedResource, AsyncBotnetFeedResource
186187
from .resources.diagnostics.diagnostics import DiagnosticsResource, AsyncDiagnosticsResource
187188
from .resources.page_shield.page_shield import PageShieldResource, AsyncPageShieldResource
189+
from .resources.url_scanner.url_scanner import URLScannerResource, AsyncURLScannerResource
188190
from .resources.dns_firewall.dns_firewall import DNSFirewallResource, AsyncDNSFirewallResource
189191
from .resources.healthchecks.healthchecks import HealthchecksResource, AsyncHealthchecksResource
190192
from .resources.email_routing.email_routing import EmailRoutingResource, AsyncEmailRoutingResource
@@ -704,6 +706,12 @@ def vectorize(self) -> VectorizeResource:
704706

705707
return VectorizeResource(self)
706708

709+
@cached_property
710+
def url_scanner(self) -> URLScannerResource:
711+
from .resources.url_scanner import URLScannerResource
712+
713+
return URLScannerResource(self)
714+
707715
@cached_property
708716
def radar(self) -> RadarResource:
709717
from .resources.radar import RadarResource
@@ -1469,6 +1477,12 @@ def vectorize(self) -> AsyncVectorizeResource:
14691477

14701478
return AsyncVectorizeResource(self)
14711479

1480+
@cached_property
1481+
def url_scanner(self) -> AsyncURLScannerResource:
1482+
from .resources.url_scanner import AsyncURLScannerResource
1483+
1484+
return AsyncURLScannerResource(self)
1485+
14721486
@cached_property
14731487
def radar(self) -> AsyncRadarResource:
14741488
from .resources.radar import AsyncRadarResource
@@ -2167,6 +2181,12 @@ def vectorize(self) -> vectorize.VectorizeResourceWithRawResponse:
21672181

21682182
return VectorizeResourceWithRawResponse(self._client.vectorize)
21692183

2184+
@cached_property
2185+
def url_scanner(self) -> url_scanner.URLScannerResourceWithRawResponse:
2186+
from .resources.url_scanner import URLScannerResourceWithRawResponse
2187+
2188+
return URLScannerResourceWithRawResponse(self._client.url_scanner)
2189+
21702190
@cached_property
21712191
def radar(self) -> radar.RadarResourceWithRawResponse:
21722192
from .resources.radar import RadarResourceWithRawResponse
@@ -2686,6 +2706,12 @@ def vectorize(self) -> vectorize.AsyncVectorizeResourceWithRawResponse:
26862706

26872707
return AsyncVectorizeResourceWithRawResponse(self._client.vectorize)
26882708

2709+
@cached_property
2710+
def url_scanner(self) -> url_scanner.AsyncURLScannerResourceWithRawResponse:
2711+
from .resources.url_scanner import AsyncURLScannerResourceWithRawResponse
2712+
2713+
return AsyncURLScannerResourceWithRawResponse(self._client.url_scanner)
2714+
26892715
@cached_property
26902716
def radar(self) -> radar.AsyncRadarResourceWithRawResponse:
26912717
from .resources.radar import AsyncRadarResourceWithRawResponse
@@ -3205,6 +3231,12 @@ def vectorize(self) -> vectorize.VectorizeResourceWithStreamingResponse:
32053231

32063232
return VectorizeResourceWithStreamingResponse(self._client.vectorize)
32073233

3234+
@cached_property
3235+
def url_scanner(self) -> url_scanner.URLScannerResourceWithStreamingResponse:
3236+
from .resources.url_scanner import URLScannerResourceWithStreamingResponse
3237+
3238+
return URLScannerResourceWithStreamingResponse(self._client.url_scanner)
3239+
32083240
@cached_property
32093241
def radar(self) -> radar.RadarResourceWithStreamingResponse:
32103242
from .resources.radar import RadarResourceWithStreamingResponse
@@ -3728,6 +3760,12 @@ def vectorize(self) -> vectorize.AsyncVectorizeResourceWithStreamingResponse:
37283760

37293761
return AsyncVectorizeResourceWithStreamingResponse(self._client.vectorize)
37303762

3763+
@cached_property
3764+
def url_scanner(self) -> url_scanner.AsyncURLScannerResourceWithStreamingResponse:
3765+
from .resources.url_scanner import AsyncURLScannerResourceWithStreamingResponse
3766+
3767+
return AsyncURLScannerResourceWithStreamingResponse(self._client.url_scanner)
3768+
37313769
@cached_property
37323770
def radar(self) -> radar.AsyncRadarResourceWithStreamingResponse:
37333771
from .resources.radar import AsyncRadarResourceWithStreamingResponse
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from .scans import (
4+
ScansResource,
5+
AsyncScansResource,
6+
ScansResourceWithRawResponse,
7+
AsyncScansResourceWithRawResponse,
8+
ScansResourceWithStreamingResponse,
9+
AsyncScansResourceWithStreamingResponse,
10+
)
11+
from .responses import (
12+
ResponsesResource,
13+
AsyncResponsesResource,
14+
ResponsesResourceWithRawResponse,
15+
AsyncResponsesResourceWithRawResponse,
16+
ResponsesResourceWithStreamingResponse,
17+
AsyncResponsesResourceWithStreamingResponse,
18+
)
19+
from .url_scanner import (
20+
URLScannerResource,
21+
AsyncURLScannerResource,
22+
URLScannerResourceWithRawResponse,
23+
AsyncURLScannerResourceWithRawResponse,
24+
URLScannerResourceWithStreamingResponse,
25+
AsyncURLScannerResourceWithStreamingResponse,
26+
)
27+
28+
__all__ = [
29+
"ResponsesResource",
30+
"AsyncResponsesResource",
31+
"ResponsesResourceWithRawResponse",
32+
"AsyncResponsesResourceWithRawResponse",
33+
"ResponsesResourceWithStreamingResponse",
34+
"AsyncResponsesResourceWithStreamingResponse",
35+
"ScansResource",
36+
"AsyncScansResource",
37+
"ScansResourceWithRawResponse",
38+
"AsyncScansResourceWithRawResponse",
39+
"ScansResourceWithStreamingResponse",
40+
"AsyncScansResourceWithStreamingResponse",
41+
"URLScannerResource",
42+
"AsyncURLScannerResource",
43+
"URLScannerResourceWithRawResponse",
44+
"AsyncURLScannerResourceWithRawResponse",
45+
"URLScannerResourceWithStreamingResponse",
46+
"AsyncURLScannerResourceWithStreamingResponse",
47+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
import httpx
6+
7+
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
8+
from ..._compat import cached_property
9+
from ..._resource import SyncAPIResource, AsyncAPIResource
10+
from ..._response import (
11+
to_raw_response_wrapper,
12+
to_streamed_response_wrapper,
13+
async_to_raw_response_wrapper,
14+
async_to_streamed_response_wrapper,
15+
)
16+
from ..._base_client import make_request_options
17+
18+
__all__ = ["ResponsesResource", "AsyncResponsesResource"]
19+
20+
21+
class ResponsesResource(SyncAPIResource):
22+
@cached_property
23+
def with_raw_response(self) -> ResponsesResourceWithRawResponse:
24+
"""
25+
This property can be used as a prefix for any HTTP method call to return the
26+
the raw response object instead of the parsed content.
27+
28+
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
29+
"""
30+
return ResponsesResourceWithRawResponse(self)
31+
32+
@cached_property
33+
def with_streaming_response(self) -> ResponsesResourceWithStreamingResponse:
34+
"""
35+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
36+
37+
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
38+
"""
39+
return ResponsesResourceWithStreamingResponse(self)
40+
41+
def get(
42+
self,
43+
response_id: str,
44+
*,
45+
account_id: str,
46+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
47+
# The extra values given here take precedence over values defined on the client or passed to this method.
48+
extra_headers: Headers | None = None,
49+
extra_query: Query | None = None,
50+
extra_body: Body | None = None,
51+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
52+
) -> str:
53+
"""Returns the raw response of the network request.
54+
55+
If HTML, a plain text response
56+
will be returned.
57+
58+
Args:
59+
account_id: Account ID.
60+
61+
response_id: Response hash.
62+
63+
extra_headers: Send extra headers
64+
65+
extra_query: Add additional query parameters to the request
66+
67+
extra_body: Add additional JSON properties to the request
68+
69+
timeout: Override the client-level default timeout for this request, in seconds
70+
"""
71+
if not account_id:
72+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
73+
if not response_id:
74+
raise ValueError(f"Expected a non-empty value for `response_id` but received {response_id!r}")
75+
extra_headers = {"Accept": "text/plain", **(extra_headers or {})}
76+
return self._get(
77+
f"/accounts/{account_id}/urlscanner/v2/responses/{response_id}",
78+
options=make_request_options(
79+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
80+
),
81+
cast_to=str,
82+
)
83+
84+
85+
class AsyncResponsesResource(AsyncAPIResource):
86+
@cached_property
87+
def with_raw_response(self) -> AsyncResponsesResourceWithRawResponse:
88+
"""
89+
This property can be used as a prefix for any HTTP method call to return the
90+
the raw response object instead of the parsed content.
91+
92+
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
93+
"""
94+
return AsyncResponsesResourceWithRawResponse(self)
95+
96+
@cached_property
97+
def with_streaming_response(self) -> AsyncResponsesResourceWithStreamingResponse:
98+
"""
99+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
100+
101+
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
102+
"""
103+
return AsyncResponsesResourceWithStreamingResponse(self)
104+
105+
async def get(
106+
self,
107+
response_id: str,
108+
*,
109+
account_id: str,
110+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
111+
# The extra values given here take precedence over values defined on the client or passed to this method.
112+
extra_headers: Headers | None = None,
113+
extra_query: Query | None = None,
114+
extra_body: Body | None = None,
115+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
116+
) -> str:
117+
"""Returns the raw response of the network request.
118+
119+
If HTML, a plain text response
120+
will be returned.
121+
122+
Args:
123+
account_id: Account ID.
124+
125+
response_id: Response hash.
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 response_id:
138+
raise ValueError(f"Expected a non-empty value for `response_id` but received {response_id!r}")
139+
extra_headers = {"Accept": "text/plain", **(extra_headers or {})}
140+
return await self._get(
141+
f"/accounts/{account_id}/urlscanner/v2/responses/{response_id}",
142+
options=make_request_options(
143+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
144+
),
145+
cast_to=str,
146+
)
147+
148+
149+
class ResponsesResourceWithRawResponse:
150+
def __init__(self, responses: ResponsesResource) -> None:
151+
self._responses = responses
152+
153+
self.get = to_raw_response_wrapper(
154+
responses.get,
155+
)
156+
157+
158+
class AsyncResponsesResourceWithRawResponse:
159+
def __init__(self, responses: AsyncResponsesResource) -> None:
160+
self._responses = responses
161+
162+
self.get = async_to_raw_response_wrapper(
163+
responses.get,
164+
)
165+
166+
167+
class ResponsesResourceWithStreamingResponse:
168+
def __init__(self, responses: ResponsesResource) -> None:
169+
self._responses = responses
170+
171+
self.get = to_streamed_response_wrapper(
172+
responses.get,
173+
)
174+
175+
176+
class AsyncResponsesResourceWithStreamingResponse:
177+
def __init__(self, responses: AsyncResponsesResource) -> None:
178+
self._responses = responses
179+
180+
self.get = async_to_streamed_response_wrapper(
181+
responses.get,
182+
)

0 commit comments

Comments
 (0)