Skip to content

Commit 17cbb91

Browse files
feat(api): manual updates
1 parent 0ad090d commit 17cbb91

7 files changed

Lines changed: 254 additions & 2 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 13
1+
configured_endpoints: 14
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-1391c1e69bcdce517f71265a2f22f4e8d35c3f12a224899e64f85e25897b743a.yml
33
openapi_spec_hash: f8a2917cc425300d272ae943f88d7bb7
4-
config_hash: 6aaf0fe6f8877c9c5d9af95597123cb4
4+
config_hash: 7f48d078645cb8331328bcd6f6ab3281

api.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ from brand.dev.types import (
99
BrandFontsResponse,
1010
BrandIdentifyFromTransactionResponse,
1111
BrandPrefetchResponse,
12+
BrandPrefetchByEmailResponse,
1213
BrandRetrieveByEmailResponse,
1314
BrandRetrieveByIsinResponse,
1415
BrandRetrieveByNameResponse,
@@ -27,6 +28,7 @@ Methods:
2728
- <code title="get /brand/fonts">client.brand.<a href="./src/brand/dev/resources/brand.py">fonts</a>(\*\*<a href="src/brand/dev/types/brand_fonts_params.py">params</a>) -> <a href="./src/brand/dev/types/brand_fonts_response.py">BrandFontsResponse</a></code>
2829
- <code title="get /brand/transaction_identifier">client.brand.<a href="./src/brand/dev/resources/brand.py">identify_from_transaction</a>(\*\*<a href="src/brand/dev/types/brand_identify_from_transaction_params.py">params</a>) -> <a href="./src/brand/dev/types/brand_identify_from_transaction_response.py">BrandIdentifyFromTransactionResponse</a></code>
2930
- <code title="post /brand/prefetch">client.brand.<a href="./src/brand/dev/resources/brand.py">prefetch</a>(\*\*<a href="src/brand/dev/types/brand_prefetch_params.py">params</a>) -> <a href="./src/brand/dev/types/brand_prefetch_response.py">BrandPrefetchResponse</a></code>
31+
- <code title="post /brand/prefetch-by-email">client.brand.<a href="./src/brand/dev/resources/brand.py">prefetch_by_email</a>(\*\*<a href="src/brand/dev/types/brand_prefetch_by_email_params.py">params</a>) -> <a href="./src/brand/dev/types/brand_prefetch_by_email_response.py">BrandPrefetchByEmailResponse</a></code>
3032
- <code title="get /brand/retrieve-by-email">client.brand.<a href="./src/brand/dev/resources/brand.py">retrieve_by_email</a>(\*\*<a href="src/brand/dev/types/brand_retrieve_by_email_params.py">params</a>) -> <a href="./src/brand/dev/types/brand_retrieve_by_email_response.py">BrandRetrieveByEmailResponse</a></code>
3133
- <code title="get /brand/retrieve-by-isin">client.brand.<a href="./src/brand/dev/resources/brand.py">retrieve_by_isin</a>(\*\*<a href="src/brand/dev/types/brand_retrieve_by_isin_params.py">params</a>) -> <a href="./src/brand/dev/types/brand_retrieve_by_isin_response.py">BrandRetrieveByIsinResponse</a></code>
3234
- <code title="get /brand/retrieve-by-name">client.brand.<a href="./src/brand/dev/resources/brand.py">retrieve_by_name</a>(\*\*<a href="src/brand/dev/types/brand_retrieve_by_name_params.py">params</a>) -> <a href="./src/brand/dev/types/brand_retrieve_by_name_response.py">BrandRetrieveByNameResponse</a></code>

src/brand/dev/resources/brand.py

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
brand_retrieve_naics_params,
1818
brand_retrieve_by_isin_params,
1919
brand_retrieve_by_name_params,
20+
brand_prefetch_by_email_params,
2021
brand_retrieve_by_email_params,
2122
brand_retrieve_by_ticker_params,
2223
brand_retrieve_simplified_params,
@@ -42,6 +43,7 @@
4243
from ..types.brand_retrieve_naics_response import BrandRetrieveNaicsResponse
4344
from ..types.brand_retrieve_by_isin_response import BrandRetrieveByIsinResponse
4445
from ..types.brand_retrieve_by_name_response import BrandRetrieveByNameResponse
46+
from ..types.brand_prefetch_by_email_response import BrandPrefetchByEmailResponse
4547
from ..types.brand_retrieve_by_email_response import BrandRetrieveByEmailResponse
4648
from ..types.brand_retrieve_by_ticker_response import BrandRetrieveByTickerResponse
4749
from ..types.brand_retrieve_simplified_response import BrandRetrieveSimplifiedResponse
@@ -711,6 +713,58 @@ def prefetch(
711713
cast_to=BrandPrefetchResponse,
712714
)
713715

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+
714768
def retrieve_by_email(
715769
self,
716770
*,
@@ -2147,6 +2201,58 @@ async def prefetch(
21472201
cast_to=BrandPrefetchResponse,
21482202
)
21492203

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+
21502256
async def retrieve_by_email(
21512257
self,
21522258
*,
@@ -2941,6 +3047,9 @@ def __init__(self, brand: BrandResource) -> None:
29413047
self.prefetch = to_raw_response_wrapper(
29423048
brand.prefetch,
29433049
)
3050+
self.prefetch_by_email = to_raw_response_wrapper(
3051+
brand.prefetch_by_email,
3052+
)
29443053
self.retrieve_by_email = to_raw_response_wrapper(
29453054
brand.retrieve_by_email,
29463055
)
@@ -2986,6 +3095,9 @@ def __init__(self, brand: AsyncBrandResource) -> None:
29863095
self.prefetch = async_to_raw_response_wrapper(
29873096
brand.prefetch,
29883097
)
3098+
self.prefetch_by_email = async_to_raw_response_wrapper(
3099+
brand.prefetch_by_email,
3100+
)
29893101
self.retrieve_by_email = async_to_raw_response_wrapper(
29903102
brand.retrieve_by_email,
29913103
)
@@ -3031,6 +3143,9 @@ def __init__(self, brand: BrandResource) -> None:
30313143
self.prefetch = to_streamed_response_wrapper(
30323144
brand.prefetch,
30333145
)
3146+
self.prefetch_by_email = to_streamed_response_wrapper(
3147+
brand.prefetch_by_email,
3148+
)
30343149
self.retrieve_by_email = to_streamed_response_wrapper(
30353150
brand.retrieve_by_email,
30363151
)
@@ -3076,6 +3191,9 @@ def __init__(self, brand: AsyncBrandResource) -> None:
30763191
self.prefetch = async_to_streamed_response_wrapper(
30773192
brand.prefetch,
30783193
)
3194+
self.prefetch_by_email = async_to_streamed_response_wrapper(
3195+
brand.prefetch_by_email,
3196+
)
30793197
self.retrieve_by_email = async_to_streamed_response_wrapper(
30803198
brand.retrieve_by_email,
30813199
)

src/brand/dev/types/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@
1818
from .brand_retrieve_by_isin_params import BrandRetrieveByIsinParams as BrandRetrieveByIsinParams
1919
from .brand_retrieve_by_name_params import BrandRetrieveByNameParams as BrandRetrieveByNameParams
2020
from .brand_retrieve_naics_response import BrandRetrieveNaicsResponse as BrandRetrieveNaicsResponse
21+
from .brand_prefetch_by_email_params import BrandPrefetchByEmailParams as BrandPrefetchByEmailParams
2122
from .brand_retrieve_by_email_params import BrandRetrieveByEmailParams as BrandRetrieveByEmailParams
2223
from .brand_retrieve_by_isin_response import BrandRetrieveByIsinResponse as BrandRetrieveByIsinResponse
2324
from .brand_retrieve_by_name_response import BrandRetrieveByNameResponse as BrandRetrieveByNameResponse
2425
from .brand_retrieve_by_ticker_params import BrandRetrieveByTickerParams as BrandRetrieveByTickerParams
26+
from .brand_prefetch_by_email_response import BrandPrefetchByEmailResponse as BrandPrefetchByEmailResponse
2527
from .brand_retrieve_by_email_response import BrandRetrieveByEmailResponse as BrandRetrieveByEmailResponse
2628
from .brand_retrieve_simplified_params import BrandRetrieveSimplifiedParams as BrandRetrieveSimplifiedParams
2729
from .brand_retrieve_by_ticker_response import BrandRetrieveByTickerResponse as BrandRetrieveByTickerResponse
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import Required, Annotated, TypedDict
6+
7+
from .._utils import PropertyInfo
8+
9+
__all__ = ["BrandPrefetchByEmailParams"]
10+
11+
12+
class BrandPrefetchByEmailParams(TypedDict, total=False):
13+
email: Required[str]
14+
"""Email address to prefetch brand data for.
15+
16+
The domain will be extracted from the email. Free email providers (gmail.com,
17+
yahoo.com, etc.) and disposable email addresses are not allowed.
18+
"""
19+
20+
timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")]
21+
"""Optional timeout in milliseconds for the request.
22+
23+
If the request takes longer than this value, it will be aborted with a 408
24+
status code. Maximum allowed value is 300000ms (5 minutes).
25+
"""
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import Optional
4+
5+
from .._models import BaseModel
6+
7+
__all__ = ["BrandPrefetchByEmailResponse"]
8+
9+
10+
class BrandPrefetchByEmailResponse(BaseModel):
11+
domain: Optional[str] = None
12+
"""The domain that was queued for prefetching"""
13+
14+
message: Optional[str] = None
15+
"""Success message"""
16+
17+
status: Optional[str] = None
18+
"""Status of the response, e.g., 'ok'"""

tests/api_resources/test_brand.py

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
BrandRetrieveNaicsResponse,
2020
BrandRetrieveByIsinResponse,
2121
BrandRetrieveByNameResponse,
22+
BrandPrefetchByEmailResponse,
2223
BrandRetrieveByEmailResponse,
2324
BrandRetrieveByTickerResponse,
2425
BrandRetrieveSimplifiedResponse,
@@ -296,6 +297,49 @@ def test_streaming_response_prefetch(self, client: BrandDev) -> None:
296297

297298
assert cast(Any, response.is_closed) is True
298299

300+
@pytest.mark.skip(reason="Prism tests are disabled")
301+
@parametrize
302+
def test_method_prefetch_by_email(self, client: BrandDev) -> None:
303+
brand = client.brand.prefetch_by_email(
304+
email="dev@stainless.com",
305+
)
306+
assert_matches_type(BrandPrefetchByEmailResponse, brand, path=["response"])
307+
308+
@pytest.mark.skip(reason="Prism tests are disabled")
309+
@parametrize
310+
def test_method_prefetch_by_email_with_all_params(self, client: BrandDev) -> None:
311+
brand = client.brand.prefetch_by_email(
312+
email="dev@stainless.com",
313+
timeout_ms=1,
314+
)
315+
assert_matches_type(BrandPrefetchByEmailResponse, brand, path=["response"])
316+
317+
@pytest.mark.skip(reason="Prism tests are disabled")
318+
@parametrize
319+
def test_raw_response_prefetch_by_email(self, client: BrandDev) -> None:
320+
response = client.brand.with_raw_response.prefetch_by_email(
321+
email="dev@stainless.com",
322+
)
323+
324+
assert response.is_closed is True
325+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
326+
brand = response.parse()
327+
assert_matches_type(BrandPrefetchByEmailResponse, brand, path=["response"])
328+
329+
@pytest.mark.skip(reason="Prism tests are disabled")
330+
@parametrize
331+
def test_streaming_response_prefetch_by_email(self, client: BrandDev) -> None:
332+
with client.brand.with_streaming_response.prefetch_by_email(
333+
email="dev@stainless.com",
334+
) as response:
335+
assert not response.is_closed
336+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
337+
338+
brand = response.parse()
339+
assert_matches_type(BrandPrefetchByEmailResponse, brand, path=["response"])
340+
341+
assert cast(Any, response.is_closed) is True
342+
299343
@pytest.mark.skip(reason="Prism tests are disabled")
300344
@parametrize
301345
def test_method_retrieve_by_email(self, client: BrandDev) -> None:
@@ -925,6 +969,49 @@ async def test_streaming_response_prefetch(self, async_client: AsyncBrandDev) ->
925969

926970
assert cast(Any, response.is_closed) is True
927971

972+
@pytest.mark.skip(reason="Prism tests are disabled")
973+
@parametrize
974+
async def test_method_prefetch_by_email(self, async_client: AsyncBrandDev) -> None:
975+
brand = await async_client.brand.prefetch_by_email(
976+
email="dev@stainless.com",
977+
)
978+
assert_matches_type(BrandPrefetchByEmailResponse, brand, path=["response"])
979+
980+
@pytest.mark.skip(reason="Prism tests are disabled")
981+
@parametrize
982+
async def test_method_prefetch_by_email_with_all_params(self, async_client: AsyncBrandDev) -> None:
983+
brand = await async_client.brand.prefetch_by_email(
984+
email="dev@stainless.com",
985+
timeout_ms=1,
986+
)
987+
assert_matches_type(BrandPrefetchByEmailResponse, brand, path=["response"])
988+
989+
@pytest.mark.skip(reason="Prism tests are disabled")
990+
@parametrize
991+
async def test_raw_response_prefetch_by_email(self, async_client: AsyncBrandDev) -> None:
992+
response = await async_client.brand.with_raw_response.prefetch_by_email(
993+
email="dev@stainless.com",
994+
)
995+
996+
assert response.is_closed is True
997+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
998+
brand = await response.parse()
999+
assert_matches_type(BrandPrefetchByEmailResponse, brand, path=["response"])
1000+
1001+
@pytest.mark.skip(reason="Prism tests are disabled")
1002+
@parametrize
1003+
async def test_streaming_response_prefetch_by_email(self, async_client: AsyncBrandDev) -> None:
1004+
async with async_client.brand.with_streaming_response.prefetch_by_email(
1005+
email="dev@stainless.com",
1006+
) as response:
1007+
assert not response.is_closed
1008+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
1009+
1010+
brand = await response.parse()
1011+
assert_matches_type(BrandPrefetchByEmailResponse, brand, path=["response"])
1012+
1013+
assert cast(Any, response.is_closed) is True
1014+
9281015
@pytest.mark.skip(reason="Prism tests are disabled")
9291016
@parametrize
9301017
async def test_method_retrieve_by_email(self, async_client: AsyncBrandDev) -> None:

0 commit comments

Comments
 (0)