Skip to content

Commit 3c43943

Browse files
feat(api): api update
1 parent 1e80ffb commit 3c43943

File tree

4 files changed

+49
-5
lines changed

4 files changed

+49
-5
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 20
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-e6540b8abe35309c0b139a2b5985bf318903714d712b866e282da36b87f1ee72.yml
3-
openapi_spec_hash: 2c1b55e2428c0b6c5a91d1d6a2ba9980
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-1cd00999a087b24743cf3a2849c9bd0ea1ed6b5a0dac3a8f0e26c6a58d26d6bf.yml
3+
openapi_spec_hash: f95a256f049293caa5abc0912939a9ff
44
config_hash: 25b721dbe22baba168a4d891909090e9

src/brand/dev/resources/brand.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2122,6 +2122,7 @@ def web_scrape_sitemap(
21222122
self,
21232123
*,
21242124
domain: str,
2125+
max_links: int | Omit = omit,
21252126
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
21262127
# The extra values given here take precedence over values defined on the client or passed to this method.
21272128
extra_headers: Headers | None = None,
@@ -2138,6 +2139,9 @@ def web_scrape_sitemap(
21382139
domain: Domain name to crawl sitemaps for (e.g., 'example.com'). The domain will be
21392140
automatically normalized and validated.
21402141
2142+
max_links: Maximum number of links to return from the sitemap crawl. Defaults to 10,000.
2143+
Minimum is 1, maximum is 100,000.
2144+
21412145
extra_headers: Send extra headers
21422146
21432147
extra_query: Add additional query parameters to the request
@@ -2153,7 +2157,13 @@ def web_scrape_sitemap(
21532157
extra_query=extra_query,
21542158
extra_body=extra_body,
21552159
timeout=timeout,
2156-
query=maybe_transform({"domain": domain}, brand_web_scrape_sitemap_params.BrandWebScrapeSitemapParams),
2160+
query=maybe_transform(
2161+
{
2162+
"domain": domain,
2163+
"max_links": max_links,
2164+
},
2165+
brand_web_scrape_sitemap_params.BrandWebScrapeSitemapParams,
2166+
),
21572167
),
21582168
cast_to=BrandWebScrapeSitemapResponse,
21592169
)
@@ -4219,6 +4229,7 @@ async def web_scrape_sitemap(
42194229
self,
42204230
*,
42214231
domain: str,
4232+
max_links: int | Omit = omit,
42224233
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
42234234
# The extra values given here take precedence over values defined on the client or passed to this method.
42244235
extra_headers: Headers | None = None,
@@ -4235,6 +4246,9 @@ async def web_scrape_sitemap(
42354246
domain: Domain name to crawl sitemaps for (e.g., 'example.com'). The domain will be
42364247
automatically normalized and validated.
42374248
4249+
max_links: Maximum number of links to return from the sitemap crawl. Defaults to 10,000.
4250+
Minimum is 1, maximum is 100,000.
4251+
42384252
extra_headers: Send extra headers
42394253
42404254
extra_query: Add additional query parameters to the request
@@ -4251,7 +4265,11 @@ async def web_scrape_sitemap(
42514265
extra_body=extra_body,
42524266
timeout=timeout,
42534267
query=await async_maybe_transform(
4254-
{"domain": domain}, brand_web_scrape_sitemap_params.BrandWebScrapeSitemapParams
4268+
{
4269+
"domain": domain,
4270+
"max_links": max_links,
4271+
},
4272+
brand_web_scrape_sitemap_params.BrandWebScrapeSitemapParams,
42554273
),
42564274
),
42574275
cast_to=BrandWebScrapeSitemapResponse,

src/brand/dev/types/brand_web_scrape_sitemap_params.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
from __future__ import annotations
44

5-
from typing_extensions import Required, TypedDict
5+
from typing_extensions import Required, Annotated, TypedDict
6+
7+
from .._utils import PropertyInfo
68

79
__all__ = ["BrandWebScrapeSitemapParams"]
810

@@ -13,3 +15,9 @@ class BrandWebScrapeSitemapParams(TypedDict, total=False):
1315
1416
The domain will be automatically normalized and validated.
1517
"""
18+
19+
max_links: Annotated[int, PropertyInfo(alias="maxLinks")]
20+
"""Maximum number of links to return from the sitemap crawl.
21+
22+
Defaults to 10,000. Minimum is 1, maximum is 100,000.
23+
"""

tests/api_resources/test_brand.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,15 @@ def test_method_web_scrape_sitemap(self, client: BrandDev) -> None:
959959
)
960960
assert_matches_type(BrandWebScrapeSitemapResponse, brand, path=["response"])
961961

962+
@pytest.mark.skip(reason="Mock server tests are disabled")
963+
@parametrize
964+
def test_method_web_scrape_sitemap_with_all_params(self, client: BrandDev) -> None:
965+
brand = client.brand.web_scrape_sitemap(
966+
domain="domain",
967+
max_links=1,
968+
)
969+
assert_matches_type(BrandWebScrapeSitemapResponse, brand, path=["response"])
970+
962971
@pytest.mark.skip(reason="Mock server tests are disabled")
963972
@parametrize
964973
def test_raw_response_web_scrape_sitemap(self, client: BrandDev) -> None:
@@ -1912,6 +1921,15 @@ async def test_method_web_scrape_sitemap(self, async_client: AsyncBrandDev) -> N
19121921
)
19131922
assert_matches_type(BrandWebScrapeSitemapResponse, brand, path=["response"])
19141923

1924+
@pytest.mark.skip(reason="Mock server tests are disabled")
1925+
@parametrize
1926+
async def test_method_web_scrape_sitemap_with_all_params(self, async_client: AsyncBrandDev) -> None:
1927+
brand = await async_client.brand.web_scrape_sitemap(
1928+
domain="domain",
1929+
max_links=1,
1930+
)
1931+
assert_matches_type(BrandWebScrapeSitemapResponse, brand, path=["response"])
1932+
19151933
@pytest.mark.skip(reason="Mock server tests are disabled")
19161934
@parametrize
19171935
async def test_raw_response_web_scrape_sitemap(self, async_client: AsyncBrandDev) -> None:

0 commit comments

Comments
 (0)