Skip to content

Commit dfa79a8

Browse files
committed
feat(url_scanner): update generated types and methods
1 parent 58fdc98 commit dfa79a8

9 files changed

Lines changed: 1289 additions & 39 deletions

File tree

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# URLScanner
2+
3+
Types:
4+
5+
```python
6+
from cloudflare.types.url_scanner import URLScannerDomain, URLScannerTask
7+
```
8+
9+
## Responses
10+
11+
Types:
12+
13+
```python
14+
from cloudflare.types.url_scanner import ResponseGetResponse
15+
```
16+
17+
Methods:
18+
19+
- <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>
20+
21+
## Scans
22+
23+
Types:
24+
25+
```python
26+
from cloudflare.types.url_scanner import (
27+
ScanCreateResponse,
28+
ScanListResponse,
29+
ScanBulkCreateResponse,
30+
ScanDOMResponse,
31+
ScanGetResponse,
32+
ScanHARResponse,
33+
)
34+
```
35+
36+
Methods:
37+
38+
- <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">ScanCreateResponse</a></code>
39+
- <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>
40+
- <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>
41+
- <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>
42+
- <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>
43+
- <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>
44+
- <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>

src/cloudflare/resources/url_scanner/responses.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import httpx
66

77
from ..._types import Body, Query, Headers, NotGiven, not_given
8+
from ..._utils import path_template
89
from ..._compat import cached_property
910
from ..._resource import SyncAPIResource, AsyncAPIResource
1011
from ..._response import (
@@ -42,7 +43,7 @@ def get(
4243
self,
4344
response_id: str,
4445
*,
45-
account_id: str,
46+
account_id: str | None = None,
4647
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
4748
# The extra values given here take precedence over values defined on the client or passed to this method.
4849
extra_headers: Headers | None = None,
@@ -68,13 +69,19 @@ def get(
6869
6970
timeout: Override the client-level default timeout for this request, in seconds
7071
"""
72+
if account_id is None:
73+
account_id = self._client._get_account_id_path_param()
7174
if not account_id:
7275
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
7376
if not response_id:
7477
raise ValueError(f"Expected a non-empty value for `response_id` but received {response_id!r}")
7578
extra_headers = {"Accept": "text/plain", **(extra_headers or {})}
7679
return self._get(
77-
f"/accounts/{account_id}/urlscanner/v2/responses/{response_id}",
80+
path_template(
81+
"/accounts/{account_id}/urlscanner/v2/responses/{response_id}",
82+
account_id=account_id,
83+
response_id=response_id,
84+
),
7885
options=make_request_options(
7986
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
8087
),
@@ -106,7 +113,7 @@ async def get(
106113
self,
107114
response_id: str,
108115
*,
109-
account_id: str,
116+
account_id: str | None = None,
110117
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
111118
# The extra values given here take precedence over values defined on the client or passed to this method.
112119
extra_headers: Headers | None = None,
@@ -132,13 +139,19 @@ async def get(
132139
133140
timeout: Override the client-level default timeout for this request, in seconds
134141
"""
142+
if account_id is None:
143+
account_id = self._client._get_account_id_path_param()
135144
if not account_id:
136145
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
137146
if not response_id:
138147
raise ValueError(f"Expected a non-empty value for `response_id` but received {response_id!r}")
139148
extra_headers = {"Accept": "text/plain", **(extra_headers or {})}
140149
return await self._get(
141-
f"/accounts/{account_id}/urlscanner/v2/responses/{response_id}",
150+
path_template(
151+
"/accounts/{account_id}/urlscanner/v2/responses/{response_id}",
152+
account_id=account_id,
153+
response_id=response_id,
154+
),
142155
options=make_request_options(
143156
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
144157
),

0 commit comments

Comments
 (0)