Skip to content

Commit 2bdb356

Browse files
feat(api): api update
1 parent 2ac4e0c commit 2bdb356

4 files changed

Lines changed: 29 additions & 2 deletions

File tree

‎.stats.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 41
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-f23ab92b85d838bfa0c2741f96f4bf7acf09a22cc17aa88d78ae8a1cafb0c7f0.yml
3-
openapi_spec_hash: 641b62af26fa7bc744bbebc50aeb2ac6
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-a0e9f5a245a9ad4bf712a35826463af573957da6d3714136cfab643140664566.yml
3+
openapi_spec_hash: 20f2776cd458320c8b66fec4ec4f9332
44
config_hash: 0fb0ceca5946298c416cec0cca5260c7

‎src/context/dev/resources/web.py‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ def extract_styleguide(
386386
def screenshot(
387387
self,
388388
*,
389+
clear_popups: bool | Omit = omit,
389390
color_scheme: Literal["light", "dark"] | Omit = omit,
390391
country: Literal[
391392
"ad",
@@ -617,6 +618,12 @@ def screenshot(
617618
Capture a screenshot of a website.
618619
619620
Args:
621+
clear_popups: Optional parameter for comprehensive popup cleanup. If 'true', the browser
622+
dismisses detected cookie/consent UI and clears other detected obstructive
623+
popups and overlays before capture. If 'false' or not provided, this parameter
624+
requests no cleanup; handleCookiePopup can still request cookie/consent handling
625+
independently.
626+
620627
color_scheme: Optional parameter to choose the site's visual theme in the screenshot. Use
621628
'light' or 'dark' when the site offers both appearances.
622629
@@ -692,6 +699,7 @@ def screenshot(
692699
timeout=timeout,
693700
query=maybe_transform(
694701
{
702+
"clear_popups": clear_popups,
695703
"color_scheme": color_scheme,
696704
"country": country,
697705
"direct_url": direct_url,
@@ -2616,6 +2624,7 @@ async def extract_styleguide(
26162624
async def screenshot(
26172625
self,
26182626
*,
2627+
clear_popups: bool | Omit = omit,
26192628
color_scheme: Literal["light", "dark"] | Omit = omit,
26202629
country: Literal[
26212630
"ad",
@@ -2847,6 +2856,12 @@ async def screenshot(
28472856
Capture a screenshot of a website.
28482857
28492858
Args:
2859+
clear_popups: Optional parameter for comprehensive popup cleanup. If 'true', the browser
2860+
dismisses detected cookie/consent UI and clears other detected obstructive
2861+
popups and overlays before capture. If 'false' or not provided, this parameter
2862+
requests no cleanup; handleCookiePopup can still request cookie/consent handling
2863+
independently.
2864+
28502865
color_scheme: Optional parameter to choose the site's visual theme in the screenshot. Use
28512866
'light' or 'dark' when the site offers both appearances.
28522867
@@ -2922,6 +2937,7 @@ async def screenshot(
29222937
timeout=timeout,
29232938
query=await async_maybe_transform(
29242939
{
2940+
"clear_popups": clear_popups,
29252941
"color_scheme": color_scheme,
29262942
"country": country,
29272943
"direct_url": direct_url,

‎src/context/dev/types/web_screenshot_params.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@
1212

1313

1414
class WebScreenshotParams(TypedDict, total=False):
15+
clear_popups: Annotated[bool, PropertyInfo(alias="clearPopups")]
16+
"""Optional parameter for comprehensive popup cleanup.
17+
18+
If 'true', the browser dismisses detected cookie/consent UI and clears other
19+
detected obstructive popups and overlays before capture. If 'false' or not
20+
provided, this parameter requests no cleanup; handleCookiePopup can still
21+
request cookie/consent handling independently.
22+
"""
23+
1524
color_scheme: Annotated[Literal["light", "dark"], PropertyInfo(alias="colorScheme")]
1625
"""Optional parameter to choose the site's visual theme in the screenshot.
1726

‎tests/api_resources/test_web.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ def test_method_screenshot(self, client: ContextDev) -> None:
248248
@parametrize
249249
def test_method_screenshot_with_all_params(self, client: ContextDev) -> None:
250250
web = client.web.screenshot(
251+
clear_popups=True,
251252
color_scheme="light",
252253
country="de",
253254
direct_url="https://example.com",
@@ -894,6 +895,7 @@ async def test_method_screenshot(self, async_client: AsyncContextDev) -> None:
894895
@parametrize
895896
async def test_method_screenshot_with_all_params(self, async_client: AsyncContextDev) -> None:
896897
web = await async_client.web.screenshot(
898+
clear_popups=True,
897899
color_scheme="light",
898900
country="de",
899901
direct_url="https://example.com",

0 commit comments

Comments
 (0)