33from __future__ import annotations
44
55from typing import Iterable
6- from typing_extensions import Literal
6+ from typing_extensions import Literal , overload
77
88import httpx
99
2525 brand_identify_from_transaction_params ,
2626)
2727from .._types import Body , Omit , Query , Headers , NotGiven , omit , not_given
28- from .._utils import maybe_transform , async_maybe_transform
28+ from .._utils import required_args , maybe_transform , async_maybe_transform
2929from .._compat import cached_property
3030from .._resource import SyncAPIResource , AsyncAPIResource
3131from .._response import (
@@ -189,11 +189,11 @@ def retrieve(
189189 cast_to = BrandRetrieveResponse ,
190190 )
191191
192+ @overload
192193 def ai_products (
193194 self ,
194195 * ,
195- direct_url : str | Omit = omit ,
196- domain : str | Omit = omit ,
196+ domain : str ,
197197 max_products : int | Omit = omit ,
198198 timeout_ms : int | Omit = omit ,
199199 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -210,19 +210,51 @@ def ai_products(
210210 description, image, pricing, features, and more.
211211
212212 Args:
213- direct_url: A specific URL to use directly as the starting point for extraction without
214- domain resolution. Useful when you want to extract products from a specific page
215- rather than discovering the site's product pages automatically. Either 'domain'
216- or 'directUrl' must be provided, but not both.
213+ domain: The domain name to analyze.
214+
215+ max_products: Maximum number of products to extract.
216+
217+ timeout_ms: Optional timeout in milliseconds for the request. Maximum allowed value is
218+ 300000ms (5 minutes).
219+
220+ extra_headers: Send extra headers
221+
222+ extra_query: Add additional query parameters to the request
223+
224+ extra_body: Add additional JSON properties to the request
225+
226+ timeout: Override the client-level default timeout for this request, in seconds
227+ """
228+ ...
229+
230+ @overload
231+ def ai_products (
232+ self ,
233+ * ,
234+ direct_url : str ,
235+ max_products : int | Omit = omit ,
236+ timeout_ms : int | Omit = omit ,
237+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
238+ # The extra values given here take precedence over values defined on the client or passed to this method.
239+ extra_headers : Headers | None = None ,
240+ extra_query : Query | None = None ,
241+ extra_body : Body | None = None ,
242+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
243+ ) -> BrandAIProductsResponse :
244+ """Beta feature: Extract product information from a brand's website.
217245
218- domain: The domain name to analyze. Either 'domain' or 'directUrl' must be provided, but
219- not both.
246+ Brand.dev will
247+ analyze the website and return a list of products with details such as name,
248+ description, image, pricing, features, and more.
249+
250+ Args:
251+ direct_url: A specific URL to use directly as the starting point for extraction without
252+ domain resolution.
220253
221254 max_products: Maximum number of products to extract.
222255
223- timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
224- than this value, it will be aborted with a 408 status code. Maximum allowed
225- value is 300000ms (5 minutes).
256+ timeout_ms: Optional timeout in milliseconds for the request. Maximum allowed value is
257+ 300000ms (5 minutes).
226258
227259 extra_headers: Send extra headers
228260
@@ -232,14 +264,31 @@ def ai_products(
232264
233265 timeout: Override the client-level default timeout for this request, in seconds
234266 """
267+ ...
268+
269+ @required_args (["domain" ], ["direct_url" ])
270+ def ai_products (
271+ self ,
272+ * ,
273+ domain : str | Omit = omit ,
274+ max_products : int | Omit = omit ,
275+ timeout_ms : int | Omit = omit ,
276+ direct_url : str | Omit = omit ,
277+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
278+ # The extra values given here take precedence over values defined on the client or passed to this method.
279+ extra_headers : Headers | None = None ,
280+ extra_query : Query | None = None ,
281+ extra_body : Body | None = None ,
282+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
283+ ) -> BrandAIProductsResponse :
235284 return self ._post (
236285 "/brand/ai/products" ,
237286 body = maybe_transform (
238287 {
239- "direct_url" : direct_url ,
240288 "domain" : domain ,
241289 "max_products" : max_products ,
242290 "timeout_ms" : timeout_ms ,
291+ "direct_url" : direct_url ,
243292 },
244293 brand_ai_products_params .BrandAIProductsParams ,
245294 ),
@@ -1736,11 +1785,11 @@ async def retrieve(
17361785 cast_to = BrandRetrieveResponse ,
17371786 )
17381787
1788+ @overload
17391789 async def ai_products (
17401790 self ,
17411791 * ,
1742- direct_url : str | Omit = omit ,
1743- domain : str | Omit = omit ,
1792+ domain : str ,
17441793 max_products : int | Omit = omit ,
17451794 timeout_ms : int | Omit = omit ,
17461795 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -1757,19 +1806,51 @@ async def ai_products(
17571806 description, image, pricing, features, and more.
17581807
17591808 Args:
1760- direct_url: A specific URL to use directly as the starting point for extraction without
1761- domain resolution. Useful when you want to extract products from a specific page
1762- rather than discovering the site's product pages automatically. Either 'domain'
1763- or 'directUrl' must be provided, but not both.
1809+ domain: The domain name to analyze.
1810+
1811+ max_products: Maximum number of products to extract.
1812+
1813+ timeout_ms: Optional timeout in milliseconds for the request. Maximum allowed value is
1814+ 300000ms (5 minutes).
1815+
1816+ extra_headers: Send extra headers
1817+
1818+ extra_query: Add additional query parameters to the request
1819+
1820+ extra_body: Add additional JSON properties to the request
1821+
1822+ timeout: Override the client-level default timeout for this request, in seconds
1823+ """
1824+ ...
1825+
1826+ @overload
1827+ async def ai_products (
1828+ self ,
1829+ * ,
1830+ direct_url : str ,
1831+ max_products : int | Omit = omit ,
1832+ timeout_ms : int | Omit = omit ,
1833+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1834+ # The extra values given here take precedence over values defined on the client or passed to this method.
1835+ extra_headers : Headers | None = None ,
1836+ extra_query : Query | None = None ,
1837+ extra_body : Body | None = None ,
1838+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
1839+ ) -> BrandAIProductsResponse :
1840+ """Beta feature: Extract product information from a brand's website.
17641841
1765- domain: The domain name to analyze. Either 'domain' or 'directUrl' must be provided, but
1766- not both.
1842+ Brand.dev will
1843+ analyze the website and return a list of products with details such as name,
1844+ description, image, pricing, features, and more.
1845+
1846+ Args:
1847+ direct_url: A specific URL to use directly as the starting point for extraction without
1848+ domain resolution.
17671849
17681850 max_products: Maximum number of products to extract.
17691851
1770- timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
1771- than this value, it will be aborted with a 408 status code. Maximum allowed
1772- value is 300000ms (5 minutes).
1852+ timeout_ms: Optional timeout in milliseconds for the request. Maximum allowed value is
1853+ 300000ms (5 minutes).
17731854
17741855 extra_headers: Send extra headers
17751856
@@ -1779,14 +1860,31 @@ async def ai_products(
17791860
17801861 timeout: Override the client-level default timeout for this request, in seconds
17811862 """
1863+ ...
1864+
1865+ @required_args (["domain" ], ["direct_url" ])
1866+ async def ai_products (
1867+ self ,
1868+ * ,
1869+ domain : str | Omit = omit ,
1870+ max_products : int | Omit = omit ,
1871+ timeout_ms : int | Omit = omit ,
1872+ direct_url : str | Omit = omit ,
1873+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1874+ # The extra values given here take precedence over values defined on the client or passed to this method.
1875+ extra_headers : Headers | None = None ,
1876+ extra_query : Query | None = None ,
1877+ extra_body : Body | None = None ,
1878+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
1879+ ) -> BrandAIProductsResponse :
17821880 return await self ._post (
17831881 "/brand/ai/products" ,
17841882 body = await async_maybe_transform (
17851883 {
1786- "direct_url" : direct_url ,
17871884 "domain" : domain ,
17881885 "max_products" : max_products ,
17891886 "timeout_ms" : timeout_ms ,
1887+ "direct_url" : direct_url ,
17901888 },
17911889 brand_ai_products_params .BrandAIProductsParams ,
17921890 ),
0 commit comments