Skip to content

Commit 707a6c3

Browse files
feat(api): api update
1 parent bbc2458 commit 707a6c3

7 files changed

Lines changed: 6 additions & 279 deletions

File tree

‎.stats.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 21
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-93024db99e0ac34b761b052b495751dddc318c87b9492cf88d8c1b03c7163277.yml
3-
openapi_spec_hash: bae5518ec851fa744b0025676df65ec6
1+
configured_endpoints: 20
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-fabb017ff3666dbd9571166423c32c9567f9c09448fd7189d147c06666bf0f39.yml
3+
openapi_spec_hash: 2175516001dec1c8c45a1c8416c6fe53
44
config_hash: 682b89b02a20f5d1c13e2c91ecbcf5ce

‎api.md‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,11 @@ Methods:
4141
Types:
4242

4343
```python
44-
from context.dev.types import StyleExtractFontsResponse, StyleExtractStyleguideResponse
44+
from context.dev.types import StyleExtractStyleguideResponse
4545
```
4646

4747
Methods:
4848

49-
- <code title="get /brand/fonts">client.style.<a href="./src/context/dev/resources/style.py">extract_fonts</a>(\*\*<a href="src/context/dev/types/style_extract_fonts_params.py">params</a>) -> <a href="./src/context/dev/types/style_extract_fonts_response.py">StyleExtractFontsResponse</a></code>
5049
- <code title="get /brand/styleguide">client.style.<a href="./src/context/dev/resources/style.py">extract_styleguide</a>(\*\*<a href="src/context/dev/types/style_extract_styleguide_params.py">params</a>) -> <a href="./src/context/dev/types/style_extract_styleguide_response.py">StyleExtractStyleguideResponse</a></code>
5150

5251
# Brand

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

Lines changed: 1 addition & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import httpx
66

7-
from ..types import style_extract_fonts_params, style_extract_styleguide_params
7+
from ..types import style_extract_styleguide_params
88
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
99
from .._utils import maybe_transform, async_maybe_transform
1010
from .._compat import cached_property
@@ -16,7 +16,6 @@
1616
async_to_streamed_response_wrapper,
1717
)
1818
from .._base_client import make_request_options
19-
from ..types.style_extract_fonts_response import StyleExtractFontsResponse
2019
from ..types.style_extract_styleguide_response import StyleExtractStyleguideResponse
2120

2221
__all__ = ["StyleResource", "AsyncStyleResource"]
@@ -42,56 +41,6 @@ def with_streaming_response(self) -> StyleResourceWithStreamingResponse:
4241
"""
4342
return StyleResourceWithStreamingResponse(self)
4443

45-
def extract_fonts(
46-
self,
47-
*,
48-
domain: str,
49-
timeout_ms: int | Omit = omit,
50-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
51-
# The extra values given here take precedence over values defined on the client or passed to this method.
52-
extra_headers: Headers | None = None,
53-
extra_query: Query | None = None,
54-
extra_body: Body | None = None,
55-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
56-
) -> StyleExtractFontsResponse:
57-
"""
58-
Extract font information from a brand's website including font families, usage
59-
statistics, fallbacks, and element/word counts.
60-
61-
Args:
62-
domain: Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The
63-
domain will be automatically normalized and validated.
64-
65-
timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
66-
than this value, it will be aborted with a 408 status code. Maximum allowed
67-
value is 300000ms (5 minutes).
68-
69-
extra_headers: Send extra headers
70-
71-
extra_query: Add additional query parameters to the request
72-
73-
extra_body: Add additional JSON properties to the request
74-
75-
timeout: Override the client-level default timeout for this request, in seconds
76-
"""
77-
return self._get(
78-
"/brand/fonts",
79-
options=make_request_options(
80-
extra_headers=extra_headers,
81-
extra_query=extra_query,
82-
extra_body=extra_body,
83-
timeout=timeout,
84-
query=maybe_transform(
85-
{
86-
"domain": domain,
87-
"timeout_ms": timeout_ms,
88-
},
89-
style_extract_fonts_params.StyleExtractFontsParams,
90-
),
91-
),
92-
cast_to=StyleExtractFontsResponse,
93-
)
94-
9544
def extract_styleguide(
9645
self,
9746
*,
@@ -170,56 +119,6 @@ def with_streaming_response(self) -> AsyncStyleResourceWithStreamingResponse:
170119
"""
171120
return AsyncStyleResourceWithStreamingResponse(self)
172121

173-
async def extract_fonts(
174-
self,
175-
*,
176-
domain: str,
177-
timeout_ms: int | Omit = omit,
178-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
179-
# The extra values given here take precedence over values defined on the client or passed to this method.
180-
extra_headers: Headers | None = None,
181-
extra_query: Query | None = None,
182-
extra_body: Body | None = None,
183-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
184-
) -> StyleExtractFontsResponse:
185-
"""
186-
Extract font information from a brand's website including font families, usage
187-
statistics, fallbacks, and element/word counts.
188-
189-
Args:
190-
domain: Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The
191-
domain will be automatically normalized and validated.
192-
193-
timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
194-
than this value, it will be aborted with a 408 status code. Maximum allowed
195-
value is 300000ms (5 minutes).
196-
197-
extra_headers: Send extra headers
198-
199-
extra_query: Add additional query parameters to the request
200-
201-
extra_body: Add additional JSON properties to the request
202-
203-
timeout: Override the client-level default timeout for this request, in seconds
204-
"""
205-
return await self._get(
206-
"/brand/fonts",
207-
options=make_request_options(
208-
extra_headers=extra_headers,
209-
extra_query=extra_query,
210-
extra_body=extra_body,
211-
timeout=timeout,
212-
query=await async_maybe_transform(
213-
{
214-
"domain": domain,
215-
"timeout_ms": timeout_ms,
216-
},
217-
style_extract_fonts_params.StyleExtractFontsParams,
218-
),
219-
),
220-
cast_to=StyleExtractFontsResponse,
221-
)
222-
223122
async def extract_styleguide(
224123
self,
225124
*,
@@ -282,9 +181,6 @@ class StyleResourceWithRawResponse:
282181
def __init__(self, style: StyleResource) -> None:
283182
self._style = style
284183

285-
self.extract_fonts = to_raw_response_wrapper(
286-
style.extract_fonts,
287-
)
288184
self.extract_styleguide = to_raw_response_wrapper(
289185
style.extract_styleguide,
290186
)
@@ -294,9 +190,6 @@ class AsyncStyleResourceWithRawResponse:
294190
def __init__(self, style: AsyncStyleResource) -> None:
295191
self._style = style
296192

297-
self.extract_fonts = async_to_raw_response_wrapper(
298-
style.extract_fonts,
299-
)
300193
self.extract_styleguide = async_to_raw_response_wrapper(
301194
style.extract_styleguide,
302195
)
@@ -306,9 +199,6 @@ class StyleResourceWithStreamingResponse:
306199
def __init__(self, style: StyleResource) -> None:
307200
self._style = style
308201

309-
self.extract_fonts = to_streamed_response_wrapper(
310-
style.extract_fonts,
311-
)
312202
self.extract_styleguide = to_streamed_response_wrapper(
313203
style.extract_styleguide,
314204
)
@@ -318,9 +208,6 @@ class AsyncStyleResourceWithStreamingResponse:
318208
def __init__(self, style: AsyncStyleResource) -> None:
319209
self._style = style
320210

321-
self.extract_fonts = async_to_streamed_response_wrapper(
322-
style.extract_fonts,
323-
)
324211
self.extract_styleguide = async_to_streamed_response_wrapper(
325212
style.extract_styleguide,
326213
)

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,10 @@
1515
from .utility_prefetch_response import UtilityPrefetchResponse as UtilityPrefetchResponse
1616
from .web_web_crawl_md_response import WebWebCrawlMdResponse as WebWebCrawlMdResponse
1717
from .ai_extract_products_params import AIExtractProductsParams as AIExtractProductsParams
18-
from .style_extract_fonts_params import StyleExtractFontsParams as StyleExtractFontsParams
1918
from .web_web_scrape_html_params import WebWebScrapeHTMLParams as WebWebScrapeHTMLParams
2019
from .web_web_scrape_md_response import WebWebScrapeMdResponse as WebWebScrapeMdResponse
2120
from .ai_extract_product_response import AIExtractProductResponse as AIExtractProductResponse
2221
from .ai_extract_products_response import AIExtractProductsResponse as AIExtractProductsResponse
23-
from .style_extract_fonts_response import StyleExtractFontsResponse as StyleExtractFontsResponse
2422
from .web_web_scrape_html_response import WebWebScrapeHTMLResponse as WebWebScrapeHTMLResponse
2523
from .web_web_scrape_images_params import WebWebScrapeImagesParams as WebWebScrapeImagesParams
2624
from .brand_retrieve_by_isin_params import BrandRetrieveByIsinParams as BrandRetrieveByIsinParams

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

Lines changed: 0 additions & 24 deletions
This file was deleted.

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

Lines changed: 0 additions & 44 deletions
This file was deleted.

‎tests/api_resources/test_style.py‎

Lines changed: 1 addition & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -9,60 +9,14 @@
99

1010
from context.dev import ContextDev, AsyncContextDev
1111
from tests.utils import assert_matches_type
12-
from context.dev.types import (
13-
StyleExtractFontsResponse,
14-
StyleExtractStyleguideResponse,
15-
)
12+
from context.dev.types import StyleExtractStyleguideResponse
1613

1714
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
1815

1916

2017
class TestStyle:
2118
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
2219

23-
@pytest.mark.skip(reason="Mock server tests are disabled")
24-
@parametrize
25-
def test_method_extract_fonts(self, client: ContextDev) -> None:
26-
style = client.style.extract_fonts(
27-
domain="domain",
28-
)
29-
assert_matches_type(StyleExtractFontsResponse, style, path=["response"])
30-
31-
@pytest.mark.skip(reason="Mock server tests are disabled")
32-
@parametrize
33-
def test_method_extract_fonts_with_all_params(self, client: ContextDev) -> None:
34-
style = client.style.extract_fonts(
35-
domain="domain",
36-
timeout_ms=1000,
37-
)
38-
assert_matches_type(StyleExtractFontsResponse, style, path=["response"])
39-
40-
@pytest.mark.skip(reason="Mock server tests are disabled")
41-
@parametrize
42-
def test_raw_response_extract_fonts(self, client: ContextDev) -> None:
43-
response = client.style.with_raw_response.extract_fonts(
44-
domain="domain",
45-
)
46-
47-
assert response.is_closed is True
48-
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
49-
style = response.parse()
50-
assert_matches_type(StyleExtractFontsResponse, style, path=["response"])
51-
52-
@pytest.mark.skip(reason="Mock server tests are disabled")
53-
@parametrize
54-
def test_streaming_response_extract_fonts(self, client: ContextDev) -> None:
55-
with client.style.with_streaming_response.extract_fonts(
56-
domain="domain",
57-
) as response:
58-
assert not response.is_closed
59-
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
60-
61-
style = response.parse()
62-
assert_matches_type(StyleExtractFontsResponse, style, path=["response"])
63-
64-
assert cast(Any, response.is_closed) is True
65-
6620
@pytest.mark.skip(reason="Mock server tests are disabled")
6721
@parametrize
6822
def test_method_extract_styleguide(self, client: ContextDev) -> None:
@@ -107,49 +61,6 @@ class TestAsyncStyle:
10761
"async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
10862
)
10963

110-
@pytest.mark.skip(reason="Mock server tests are disabled")
111-
@parametrize
112-
async def test_method_extract_fonts(self, async_client: AsyncContextDev) -> None:
113-
style = await async_client.style.extract_fonts(
114-
domain="domain",
115-
)
116-
assert_matches_type(StyleExtractFontsResponse, style, path=["response"])
117-
118-
@pytest.mark.skip(reason="Mock server tests are disabled")
119-
@parametrize
120-
async def test_method_extract_fonts_with_all_params(self, async_client: AsyncContextDev) -> None:
121-
style = await async_client.style.extract_fonts(
122-
domain="domain",
123-
timeout_ms=1000,
124-
)
125-
assert_matches_type(StyleExtractFontsResponse, style, path=["response"])
126-
127-
@pytest.mark.skip(reason="Mock server tests are disabled")
128-
@parametrize
129-
async def test_raw_response_extract_fonts(self, async_client: AsyncContextDev) -> None:
130-
response = await async_client.style.with_raw_response.extract_fonts(
131-
domain="domain",
132-
)
133-
134-
assert response.is_closed is True
135-
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
136-
style = await response.parse()
137-
assert_matches_type(StyleExtractFontsResponse, style, path=["response"])
138-
139-
@pytest.mark.skip(reason="Mock server tests are disabled")
140-
@parametrize
141-
async def test_streaming_response_extract_fonts(self, async_client: AsyncContextDev) -> None:
142-
async with async_client.style.with_streaming_response.extract_fonts(
143-
domain="domain",
144-
) as response:
145-
assert not response.is_closed
146-
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
147-
148-
style = await response.parse()
149-
assert_matches_type(StyleExtractFontsResponse, style, path=["response"])
150-
151-
assert cast(Any, response.is_closed) is True
152-
15364
@pytest.mark.skip(reason="Mock server tests are disabled")
15465
@parametrize
15566
async def test_method_extract_styleguide(self, async_client: AsyncContextDev) -> None:

0 commit comments

Comments
 (0)