Skip to content

Commit 4d07c92

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): OpenAPI spec update via Stainless API (#1123)
1 parent 406cd14 commit 4d07c92

File tree

6 files changed

+47
-3
lines changed

6 files changed

+47
-3
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1353
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b08744cc72a6a0538b81cebc0779ae8bcad774e16194cfad3050d741995479a5.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e3d243830285383252b295328e3dd96610460dd746c9a668c767961bebe05156.yml

api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6447,7 +6447,7 @@ from cloudflare.types.url_scanner import (
64476447
Methods:
64486448

64496449
- <code title="post /accounts/{accountId}/urlscanner/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>
6450-
- <code title="get /accounts/{accountId}/urlscanner/scan/{scanId}">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>
6450+
- <code title="get /accounts/{accountId}/urlscanner/scan/{scanId}">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_params.py">params</a>) -> <a href="./src/cloudflare/types/url_scanner/scan_get_response.py">ScanGetResponse</a></code>
64516451
- <code title="get /accounts/{accountId}/urlscanner/scan/{scanId}/har">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>
64526452
- <code title="get /accounts/{accountId}/urlscanner/scan/{scanId}/screenshot">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>
64536453

src/cloudflare/resources/url_scanner/scans.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
from ..._base_client import (
3333
make_request_options,
3434
)
35-
from ...types.url_scanner import scan_create_params, scan_screenshot_params
35+
from ...types.url_scanner import scan_get_params, scan_create_params, scan_screenshot_params
3636
from ...types.url_scanner.scan_get_response import ScanGetResponse
3737
from ...types.url_scanner.scan_har_response import ScanHarResponse
3838
from ...types.url_scanner.scan_create_response import ScanCreateResponse
@@ -119,6 +119,7 @@ def get(
119119
scan_id: str,
120120
*,
121121
account_id: str,
122+
full: bool | NotGiven = NOT_GIVEN,
122123
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
123124
# The extra values given here take precedence over values defined on the client or passed to this method.
124125
extra_headers: Headers | None = None,
@@ -134,6 +135,8 @@ def get(
134135
135136
scan_id: Scan uuid
136137
138+
full: Whether to return full report (scan summary and network log).
139+
137140
extra_headers: Send extra headers
138141
139142
extra_query: Add additional query parameters to the request
@@ -153,6 +156,7 @@ def get(
153156
extra_query=extra_query,
154157
extra_body=extra_body,
155158
timeout=timeout,
159+
query=maybe_transform({"full": full}, scan_get_params.ScanGetParams),
156160
post_parser=ResultWrapper[ScanGetResponse]._unwrapper,
157161
),
158162
cast_to=cast(Type[ScanGetResponse], ResultWrapper[ScanGetResponse]),
@@ -332,6 +336,7 @@ async def get(
332336
scan_id: str,
333337
*,
334338
account_id: str,
339+
full: bool | NotGiven = NOT_GIVEN,
335340
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
336341
# The extra values given here take precedence over values defined on the client or passed to this method.
337342
extra_headers: Headers | None = None,
@@ -347,6 +352,8 @@ async def get(
347352
348353
scan_id: Scan uuid
349354
355+
full: Whether to return full report (scan summary and network log).
356+
350357
extra_headers: Send extra headers
351358
352359
extra_query: Add additional query parameters to the request
@@ -366,6 +373,7 @@ async def get(
366373
extra_query=extra_query,
367374
extra_body=extra_body,
368375
timeout=timeout,
376+
query=await async_maybe_transform({"full": full}, scan_get_params.ScanGetParams),
369377
post_parser=ResultWrapper[ScanGetResponse]._unwrapper,
370378
),
371379
cast_to=cast(Type[ScanGetResponse], ResultWrapper[ScanGetResponse]),

src/cloudflare/types/url_scanner/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
from .scan_get_params import ScanGetParams as ScanGetParams
56
from .scan_get_response import ScanGetResponse as ScanGetResponse
67
from .scan_har_response import ScanHarResponse as ScanHarResponse
78
from .scan_create_params import ScanCreateParams as ScanCreateParams
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import Required, Annotated, TypedDict
6+
7+
from ..._utils import PropertyInfo
8+
9+
__all__ = ["ScanGetParams"]
10+
11+
12+
class ScanGetParams(TypedDict, total=False):
13+
account_id: Required[Annotated[str, PropertyInfo(alias="accountId")]]
14+
"""Account Id"""
15+
16+
full: bool
17+
"""Whether to return full report (scan summary and network log)."""

tests/api_resources/url_scanner/test_scans.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,15 @@ def test_method_get(self, client: Cloudflare) -> None:
9090
)
9191
assert_matches_type(ScanGetResponse, scan, path=["response"])
9292

93+
@parametrize
94+
def test_method_get_with_all_params(self, client: Cloudflare) -> None:
95+
scan = client.url_scanner.scans.get(
96+
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
97+
account_id="string",
98+
full=True,
99+
)
100+
assert_matches_type(ScanGetResponse, scan, path=["response"])
101+
93102
@parametrize
94103
def test_raw_response_get(self, client: Cloudflare) -> None:
95104
response = client.url_scanner.scans.with_raw_response.get(
@@ -325,6 +334,15 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None:
325334
)
326335
assert_matches_type(ScanGetResponse, scan, path=["response"])
327336

337+
@parametrize
338+
async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None:
339+
scan = await async_client.url_scanner.scans.get(
340+
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
341+
account_id="string",
342+
full=True,
343+
)
344+
assert_matches_type(ScanGetResponse, scan, path=["response"])
345+
328346
@parametrize
329347
async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
330348
response = await async_client.url_scanner.scans.with_raw_response.get(

0 commit comments

Comments
 (0)