|
8 | 8 | import httpx |
9 | 9 |
|
10 | 10 | from ..types import ( |
| 11 | + brand_fonts_params, |
11 | 12 | brand_ai_query_params, |
12 | 13 | brand_prefetch_params, |
13 | 14 | brand_retrieve_params, |
|
32 | 33 | async_to_streamed_response_wrapper, |
33 | 34 | ) |
34 | 35 | from .._base_client import make_request_options |
| 36 | +from ..types.brand_fonts_response import BrandFontsResponse |
35 | 37 | from ..types.brand_ai_query_response import BrandAIQueryResponse |
36 | 38 | from ..types.brand_prefetch_response import BrandPrefetchResponse |
37 | 39 | from ..types.brand_retrieve_response import BrandRetrieveResponse |
@@ -239,6 +241,56 @@ def ai_query( |
239 | 241 | cast_to=BrandAIQueryResponse, |
240 | 242 | ) |
241 | 243 |
|
| 244 | + def fonts( |
| 245 | + self, |
| 246 | + *, |
| 247 | + domain: str, |
| 248 | + timeout_ms: int | Omit = omit, |
| 249 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 250 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 251 | + extra_headers: Headers | None = None, |
| 252 | + extra_query: Query | None = None, |
| 253 | + extra_body: Body | None = None, |
| 254 | + timeout: float | httpx.Timeout | None | NotGiven = not_given, |
| 255 | + ) -> BrandFontsResponse: |
| 256 | + """ |
| 257 | + Beta feature: Extract font information from a brand's website including font |
| 258 | + families, usage statistics, fallbacks, and element/word counts. |
| 259 | +
|
| 260 | + Args: |
| 261 | + domain: Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The |
| 262 | + domain will be automatically normalized and validated. |
| 263 | +
|
| 264 | + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer |
| 265 | + than this value, it will be aborted with a 408 status code. Maximum allowed |
| 266 | + value is 300000ms (5 minutes). |
| 267 | +
|
| 268 | + extra_headers: Send extra headers |
| 269 | +
|
| 270 | + extra_query: Add additional query parameters to the request |
| 271 | +
|
| 272 | + extra_body: Add additional JSON properties to the request |
| 273 | +
|
| 274 | + timeout: Override the client-level default timeout for this request, in seconds |
| 275 | + """ |
| 276 | + return self._get( |
| 277 | + "/brand/fonts", |
| 278 | + options=make_request_options( |
| 279 | + extra_headers=extra_headers, |
| 280 | + extra_query=extra_query, |
| 281 | + extra_body=extra_body, |
| 282 | + timeout=timeout, |
| 283 | + query=maybe_transform( |
| 284 | + { |
| 285 | + "domain": domain, |
| 286 | + "timeout_ms": timeout_ms, |
| 287 | + }, |
| 288 | + brand_fonts_params.BrandFontsParams, |
| 289 | + ), |
| 290 | + ), |
| 291 | + cast_to=BrandFontsResponse, |
| 292 | + ) |
| 293 | + |
242 | 294 | def identify_from_transaction( |
243 | 295 | self, |
244 | 296 | *, |
@@ -1612,6 +1664,56 @@ async def ai_query( |
1612 | 1664 | cast_to=BrandAIQueryResponse, |
1613 | 1665 | ) |
1614 | 1666 |
|
| 1667 | + async def fonts( |
| 1668 | + self, |
| 1669 | + *, |
| 1670 | + domain: str, |
| 1671 | + timeout_ms: int | Omit = omit, |
| 1672 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 1673 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 1674 | + extra_headers: Headers | None = None, |
| 1675 | + extra_query: Query | None = None, |
| 1676 | + extra_body: Body | None = None, |
| 1677 | + timeout: float | httpx.Timeout | None | NotGiven = not_given, |
| 1678 | + ) -> BrandFontsResponse: |
| 1679 | + """ |
| 1680 | + Beta feature: Extract font information from a brand's website including font |
| 1681 | + families, usage statistics, fallbacks, and element/word counts. |
| 1682 | +
|
| 1683 | + Args: |
| 1684 | + domain: Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The |
| 1685 | + domain will be automatically normalized and validated. |
| 1686 | +
|
| 1687 | + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer |
| 1688 | + than this value, it will be aborted with a 408 status code. Maximum allowed |
| 1689 | + value is 300000ms (5 minutes). |
| 1690 | +
|
| 1691 | + extra_headers: Send extra headers |
| 1692 | +
|
| 1693 | + extra_query: Add additional query parameters to the request |
| 1694 | +
|
| 1695 | + extra_body: Add additional JSON properties to the request |
| 1696 | +
|
| 1697 | + timeout: Override the client-level default timeout for this request, in seconds |
| 1698 | + """ |
| 1699 | + return await self._get( |
| 1700 | + "/brand/fonts", |
| 1701 | + options=make_request_options( |
| 1702 | + extra_headers=extra_headers, |
| 1703 | + extra_query=extra_query, |
| 1704 | + extra_body=extra_body, |
| 1705 | + timeout=timeout, |
| 1706 | + query=await async_maybe_transform( |
| 1707 | + { |
| 1708 | + "domain": domain, |
| 1709 | + "timeout_ms": timeout_ms, |
| 1710 | + }, |
| 1711 | + brand_fonts_params.BrandFontsParams, |
| 1712 | + ), |
| 1713 | + ), |
| 1714 | + cast_to=BrandFontsResponse, |
| 1715 | + ) |
| 1716 | + |
1615 | 1717 | async def identify_from_transaction( |
1616 | 1718 | self, |
1617 | 1719 | *, |
@@ -2804,6 +2906,9 @@ def __init__(self, brand: BrandResource) -> None: |
2804 | 2906 | self.ai_query = to_raw_response_wrapper( |
2805 | 2907 | brand.ai_query, |
2806 | 2908 | ) |
| 2909 | + self.fonts = to_raw_response_wrapper( |
| 2910 | + brand.fonts, |
| 2911 | + ) |
2807 | 2912 | self.identify_from_transaction = to_raw_response_wrapper( |
2808 | 2913 | brand.identify_from_transaction, |
2809 | 2914 | ) |
@@ -2846,6 +2951,9 @@ def __init__(self, brand: AsyncBrandResource) -> None: |
2846 | 2951 | self.ai_query = async_to_raw_response_wrapper( |
2847 | 2952 | brand.ai_query, |
2848 | 2953 | ) |
| 2954 | + self.fonts = async_to_raw_response_wrapper( |
| 2955 | + brand.fonts, |
| 2956 | + ) |
2849 | 2957 | self.identify_from_transaction = async_to_raw_response_wrapper( |
2850 | 2958 | brand.identify_from_transaction, |
2851 | 2959 | ) |
@@ -2888,6 +2996,9 @@ def __init__(self, brand: BrandResource) -> None: |
2888 | 2996 | self.ai_query = to_streamed_response_wrapper( |
2889 | 2997 | brand.ai_query, |
2890 | 2998 | ) |
| 2999 | + self.fonts = to_streamed_response_wrapper( |
| 3000 | + brand.fonts, |
| 3001 | + ) |
2891 | 3002 | self.identify_from_transaction = to_streamed_response_wrapper( |
2892 | 3003 | brand.identify_from_transaction, |
2893 | 3004 | ) |
@@ -2930,6 +3041,9 @@ def __init__(self, brand: AsyncBrandResource) -> None: |
2930 | 3041 | self.ai_query = async_to_streamed_response_wrapper( |
2931 | 3042 | brand.ai_query, |
2932 | 3043 | ) |
| 3044 | + self.fonts = async_to_streamed_response_wrapper( |
| 3045 | + brand.fonts, |
| 3046 | + ) |
2933 | 3047 | self.identify_from_transaction = async_to_streamed_response_wrapper( |
2934 | 3048 | brand.identify_from_transaction, |
2935 | 3049 | ) |
|
0 commit comments