|
17 | 17 | brand_retrieve_naics_params, |
18 | 18 | brand_retrieve_by_isin_params, |
19 | 19 | brand_retrieve_by_name_params, |
| 20 | + brand_prefetch_by_email_params, |
20 | 21 | brand_retrieve_by_email_params, |
21 | 22 | brand_retrieve_by_ticker_params, |
22 | 23 | brand_retrieve_simplified_params, |
|
42 | 43 | from ..types.brand_retrieve_naics_response import BrandRetrieveNaicsResponse |
43 | 44 | from ..types.brand_retrieve_by_isin_response import BrandRetrieveByIsinResponse |
44 | 45 | from ..types.brand_retrieve_by_name_response import BrandRetrieveByNameResponse |
| 46 | +from ..types.brand_prefetch_by_email_response import BrandPrefetchByEmailResponse |
45 | 47 | from ..types.brand_retrieve_by_email_response import BrandRetrieveByEmailResponse |
46 | 48 | from ..types.brand_retrieve_by_ticker_response import BrandRetrieveByTickerResponse |
47 | 49 | from ..types.brand_retrieve_simplified_response import BrandRetrieveSimplifiedResponse |
@@ -711,6 +713,58 @@ def prefetch( |
711 | 713 | cast_to=BrandPrefetchResponse, |
712 | 714 | ) |
713 | 715 |
|
| 716 | + def prefetch_by_email( |
| 717 | + self, |
| 718 | + *, |
| 719 | + email: str, |
| 720 | + timeout_ms: int | Omit = omit, |
| 721 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 722 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 723 | + extra_headers: Headers | None = None, |
| 724 | + extra_query: Query | None = None, |
| 725 | + extra_body: Body | None = None, |
| 726 | + timeout: float | httpx.Timeout | None | NotGiven = not_given, |
| 727 | + ) -> BrandPrefetchByEmailResponse: |
| 728 | + """ |
| 729 | + Signal that you may fetch brand data for a particular domain soon to improve |
| 730 | + latency. This endpoint accepts an email address, extracts the domain from it, |
| 731 | + validates that it's not a disposable or free email provider, and queues the |
| 732 | + domain for prefetching. This endpoint does not charge credits and is available |
| 733 | + for paid customers to optimize future requests. [You must be on a paid plan to |
| 734 | + use this endpoint] |
| 735 | +
|
| 736 | + Args: |
| 737 | + email: Email address to prefetch brand data for. The domain will be extracted from the |
| 738 | + email. Free email providers (gmail.com, yahoo.com, etc.) and disposable email |
| 739 | + addresses are not allowed. |
| 740 | +
|
| 741 | + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer |
| 742 | + than this value, it will be aborted with a 408 status code. Maximum allowed |
| 743 | + value is 300000ms (5 minutes). |
| 744 | +
|
| 745 | + extra_headers: Send extra headers |
| 746 | +
|
| 747 | + extra_query: Add additional query parameters to the request |
| 748 | +
|
| 749 | + extra_body: Add additional JSON properties to the request |
| 750 | +
|
| 751 | + timeout: Override the client-level default timeout for this request, in seconds |
| 752 | + """ |
| 753 | + return self._post( |
| 754 | + "/brand/prefetch-by-email", |
| 755 | + body=maybe_transform( |
| 756 | + { |
| 757 | + "email": email, |
| 758 | + "timeout_ms": timeout_ms, |
| 759 | + }, |
| 760 | + brand_prefetch_by_email_params.BrandPrefetchByEmailParams, |
| 761 | + ), |
| 762 | + options=make_request_options( |
| 763 | + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 764 | + ), |
| 765 | + cast_to=BrandPrefetchByEmailResponse, |
| 766 | + ) |
| 767 | + |
714 | 768 | def retrieve_by_email( |
715 | 769 | self, |
716 | 770 | *, |
@@ -2147,6 +2201,58 @@ async def prefetch( |
2147 | 2201 | cast_to=BrandPrefetchResponse, |
2148 | 2202 | ) |
2149 | 2203 |
|
| 2204 | + async def prefetch_by_email( |
| 2205 | + self, |
| 2206 | + *, |
| 2207 | + email: str, |
| 2208 | + timeout_ms: int | Omit = omit, |
| 2209 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 2210 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 2211 | + extra_headers: Headers | None = None, |
| 2212 | + extra_query: Query | None = None, |
| 2213 | + extra_body: Body | None = None, |
| 2214 | + timeout: float | httpx.Timeout | None | NotGiven = not_given, |
| 2215 | + ) -> BrandPrefetchByEmailResponse: |
| 2216 | + """ |
| 2217 | + Signal that you may fetch brand data for a particular domain soon to improve |
| 2218 | + latency. This endpoint accepts an email address, extracts the domain from it, |
| 2219 | + validates that it's not a disposable or free email provider, and queues the |
| 2220 | + domain for prefetching. This endpoint does not charge credits and is available |
| 2221 | + for paid customers to optimize future requests. [You must be on a paid plan to |
| 2222 | + use this endpoint] |
| 2223 | +
|
| 2224 | + Args: |
| 2225 | + email: Email address to prefetch brand data for. The domain will be extracted from the |
| 2226 | + email. Free email providers (gmail.com, yahoo.com, etc.) and disposable email |
| 2227 | + addresses are not allowed. |
| 2228 | +
|
| 2229 | + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer |
| 2230 | + than this value, it will be aborted with a 408 status code. Maximum allowed |
| 2231 | + value is 300000ms (5 minutes). |
| 2232 | +
|
| 2233 | + extra_headers: Send extra headers |
| 2234 | +
|
| 2235 | + extra_query: Add additional query parameters to the request |
| 2236 | +
|
| 2237 | + extra_body: Add additional JSON properties to the request |
| 2238 | +
|
| 2239 | + timeout: Override the client-level default timeout for this request, in seconds |
| 2240 | + """ |
| 2241 | + return await self._post( |
| 2242 | + "/brand/prefetch-by-email", |
| 2243 | + body=await async_maybe_transform( |
| 2244 | + { |
| 2245 | + "email": email, |
| 2246 | + "timeout_ms": timeout_ms, |
| 2247 | + }, |
| 2248 | + brand_prefetch_by_email_params.BrandPrefetchByEmailParams, |
| 2249 | + ), |
| 2250 | + options=make_request_options( |
| 2251 | + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 2252 | + ), |
| 2253 | + cast_to=BrandPrefetchByEmailResponse, |
| 2254 | + ) |
| 2255 | + |
2150 | 2256 | async def retrieve_by_email( |
2151 | 2257 | self, |
2152 | 2258 | *, |
@@ -2941,6 +3047,9 @@ def __init__(self, brand: BrandResource) -> None: |
2941 | 3047 | self.prefetch = to_raw_response_wrapper( |
2942 | 3048 | brand.prefetch, |
2943 | 3049 | ) |
| 3050 | + self.prefetch_by_email = to_raw_response_wrapper( |
| 3051 | + brand.prefetch_by_email, |
| 3052 | + ) |
2944 | 3053 | self.retrieve_by_email = to_raw_response_wrapper( |
2945 | 3054 | brand.retrieve_by_email, |
2946 | 3055 | ) |
@@ -2986,6 +3095,9 @@ def __init__(self, brand: AsyncBrandResource) -> None: |
2986 | 3095 | self.prefetch = async_to_raw_response_wrapper( |
2987 | 3096 | brand.prefetch, |
2988 | 3097 | ) |
| 3098 | + self.prefetch_by_email = async_to_raw_response_wrapper( |
| 3099 | + brand.prefetch_by_email, |
| 3100 | + ) |
2989 | 3101 | self.retrieve_by_email = async_to_raw_response_wrapper( |
2990 | 3102 | brand.retrieve_by_email, |
2991 | 3103 | ) |
@@ -3031,6 +3143,9 @@ def __init__(self, brand: BrandResource) -> None: |
3031 | 3143 | self.prefetch = to_streamed_response_wrapper( |
3032 | 3144 | brand.prefetch, |
3033 | 3145 | ) |
| 3146 | + self.prefetch_by_email = to_streamed_response_wrapper( |
| 3147 | + brand.prefetch_by_email, |
| 3148 | + ) |
3034 | 3149 | self.retrieve_by_email = to_streamed_response_wrapper( |
3035 | 3150 | brand.retrieve_by_email, |
3036 | 3151 | ) |
@@ -3076,6 +3191,9 @@ def __init__(self, brand: AsyncBrandResource) -> None: |
3076 | 3191 | self.prefetch = async_to_streamed_response_wrapper( |
3077 | 3192 | brand.prefetch, |
3078 | 3193 | ) |
| 3194 | + self.prefetch_by_email = async_to_streamed_response_wrapper( |
| 3195 | + brand.prefetch_by_email, |
| 3196 | + ) |
3079 | 3197 | self.retrieve_by_email = async_to_streamed_response_wrapper( |
3080 | 3198 | brand.retrieve_by_email, |
3081 | 3199 | ) |
|
0 commit comments