Skip to content

Commit b35bfa8

Browse files
feat(api): api update
1 parent 38713c2 commit b35bfa8

4 files changed

Lines changed: 20 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: 16
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev/brand.dev-d4cdc8c2c8bb0012c2368aeae40ed20f3c93ea68dcd9892db18aa1e06642203d.yml
3-
openapi_spec_hash: e71b8ca8fa8041c8628f82afed471199
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev/brand.dev-661aa162bbdbb94bfa2a225feb7be095dec450591814eda5d5f7cbd10e0d131d.yml
3+
openapi_spec_hash: 3dc831d586372da3b88e4636213de7f0
44
config_hash: 91cf2dcefb99c39eb9cd3e98e15d6011

src/brand/dev/resources/brand.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2186,6 +2186,7 @@ def web_scrape_html(
21862186
max_age_ms: int | Omit = omit,
21872187
pdf: brand_web_scrape_html_params.Pdf | Omit = omit,
21882188
timeout_ms: int | Omit = omit,
2189+
use_main_content_only: bool | Omit = omit,
21892190
wait_for_ms: int | Omit = omit,
21902191
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
21912192
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -2225,6 +2226,9 @@ def web_scrape_html(
22252226
than this value, it will be aborted with a 408 status code. Maximum allowed
22262227
value is 300000ms (5 minutes).
22272228
2229+
use_main_content_only: When true, return only the page's main content in the HTML response, excluding
2230+
headers, footers, sidebars, and navigation when detectable.
2231+
22282232
wait_for_ms:
22292233
Optional browser wait time in milliseconds after initial page load. Min: 0. Max:
22302234
30000 (30 seconds).
@@ -2254,6 +2258,7 @@ def web_scrape_html(
22542258
"max_age_ms": max_age_ms,
22552259
"pdf": pdf,
22562260
"timeout_ms": timeout_ms,
2261+
"use_main_content_only": use_main_content_only,
22572262
"wait_for_ms": wait_for_ms,
22582263
},
22592264
brand_web_scrape_html_params.BrandWebScrapeHTMLParams,
@@ -4633,6 +4638,7 @@ async def web_scrape_html(
46334638
max_age_ms: int | Omit = omit,
46344639
pdf: brand_web_scrape_html_params.Pdf | Omit = omit,
46354640
timeout_ms: int | Omit = omit,
4641+
use_main_content_only: bool | Omit = omit,
46364642
wait_for_ms: int | Omit = omit,
46374643
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
46384644
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -4672,6 +4678,9 @@ async def web_scrape_html(
46724678
than this value, it will be aborted with a 408 status code. Maximum allowed
46734679
value is 300000ms (5 minutes).
46744680
4681+
use_main_content_only: When true, return only the page's main content in the HTML response, excluding
4682+
headers, footers, sidebars, and navigation when detectable.
4683+
46754684
wait_for_ms:
46764685
Optional browser wait time in milliseconds after initial page load. Min: 0. Max:
46774686
30000 (30 seconds).
@@ -4701,6 +4710,7 @@ async def web_scrape_html(
47014710
"max_age_ms": max_age_ms,
47024711
"pdf": pdf,
47034712
"timeout_ms": timeout_ms,
4713+
"use_main_content_only": use_main_content_only,
47044714
"wait_for_ms": wait_for_ms,
47054715
},
47064716
brand_web_scrape_html_params.BrandWebScrapeHTMLParams,

src/brand/dev/types/brand_web_scrape_html_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ class BrandWebScrapeHTMLParams(TypedDict, total=False):
6161
status code. Maximum allowed value is 300000ms (5 minutes).
6262
"""
6363

64+
use_main_content_only: Annotated[bool, PropertyInfo(alias="useMainContentOnly")]
65+
"""
66+
When true, return only the page's main content in the HTML response, excluding
67+
headers, footers, sidebars, and navigation when detectable.
68+
"""
69+
6470
wait_for_ms: Annotated[int, PropertyInfo(alias="waitForMs")]
6571
"""Optional browser wait time in milliseconds after initial page load.
6672

tests/api_resources/test_brand.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,7 @@ def test_method_web_scrape_html_with_all_params(self, client: BrandDev) -> None:
695695
"start": 1,
696696
},
697697
timeout_ms=1000,
698+
use_main_content_only=True,
698699
wait_for_ms=0,
699700
)
700701
assert_matches_type(BrandWebScrapeHTMLResponse, brand, path=["response"])
@@ -1548,6 +1549,7 @@ async def test_method_web_scrape_html_with_all_params(self, async_client: AsyncB
15481549
"start": 1,
15491550
},
15501551
timeout_ms=1000,
1552+
use_main_content_only=True,
15511553
wait_for_ms=0,
15521554
)
15531555
assert_matches_type(BrandWebScrapeHTMLResponse, brand, path=["response"])

0 commit comments

Comments
 (0)