Skip to content

Commit 5dcdf4e

Browse files
feat(api): api update
1 parent 55d0b8f commit 5dcdf4e

4 files changed

Lines changed: 202 additions & 5 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 10
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-90a3350206f5abf24f9b8e29cbb467308ebdea82b4d7aaebd0845875810f5910.yml
3-
openapi_spec_hash: bb5e54c40d38f82eab1d829b831b1671
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-a634e2867f22f7485bf8ef51d18a25c010274dcbd60a420c8b35e68d017c8c95.yml
3+
openapi_spec_hash: 8990e4b274d4563c77525b15a2723f63
44
config_hash: a1303564edd6276a63d584a02b2238b2

src/brand/dev/resources/brand.py

Lines changed: 132 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ def retrieve(
133133
timeout: float | httpx.Timeout | None | NotGiven = not_given,
134134
) -> BrandRetrieveResponse:
135135
"""
136-
Retrieve brand information from a domain name
136+
Retrieve logos, backdrops, colors, industry, description, and more from any
137+
domain
137138
138139
Args:
139140
domain: Domain name to retrieve brand data for (e.g., 'example.com', 'google.com').
@@ -238,6 +239,62 @@ def identify_from_transaction(
238239
self,
239240
*,
240241
transaction_info: str,
242+
force_language: Literal[
243+
"albanian",
244+
"arabic",
245+
"azeri",
246+
"bengali",
247+
"bulgarian",
248+
"cebuano",
249+
"croatian",
250+
"czech",
251+
"danish",
252+
"dutch",
253+
"english",
254+
"estonian",
255+
"farsi",
256+
"finnish",
257+
"french",
258+
"german",
259+
"hausa",
260+
"hawaiian",
261+
"hindi",
262+
"hungarian",
263+
"icelandic",
264+
"indonesian",
265+
"italian",
266+
"kazakh",
267+
"kyrgyz",
268+
"latin",
269+
"latvian",
270+
"lithuanian",
271+
"macedonian",
272+
"mongolian",
273+
"nepali",
274+
"norwegian",
275+
"pashto",
276+
"pidgin",
277+
"polish",
278+
"portuguese",
279+
"romanian",
280+
"russian",
281+
"serbian",
282+
"slovak",
283+
"slovene",
284+
"somali",
285+
"spanish",
286+
"swahili",
287+
"swedish",
288+
"tagalog",
289+
"turkish",
290+
"ukrainian",
291+
"urdu",
292+
"uzbek",
293+
"vietnamese",
294+
"welsh",
295+
]
296+
| Omit = omit,
297+
max_speed: bool | Omit = omit,
241298
timeout_ms: int | Omit = omit,
242299
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
243300
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -253,6 +310,12 @@ def identify_from_transaction(
253310
Args:
254311
transaction_info: Transaction information to identify the brand
255312
313+
force_language: Optional parameter to force the language of the retrieved brand data.
314+
315+
max_speed: Optional parameter to optimize the API call for maximum speed. When set to true,
316+
the API will skip time-consuming operations for faster response at the cost of
317+
less comprehensive data.
318+
256319
timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
257320
than this value, it will be aborted with a 408 status code. Maximum allowed
258321
value is 300000ms (5 minutes).
@@ -275,6 +338,8 @@ def identify_from_transaction(
275338
query=maybe_transform(
276339
{
277340
"transaction_info": transaction_info,
341+
"force_language": force_language,
342+
"max_speed": max_speed,
278343
"timeout_ms": timeout_ms,
279344
},
280345
brand_identify_from_transaction_params.BrandIdentifyFromTransactionParams,
@@ -953,7 +1018,8 @@ async def retrieve(
9531018
timeout: float | httpx.Timeout | None | NotGiven = not_given,
9541019
) -> BrandRetrieveResponse:
9551020
"""
956-
Retrieve brand information from a domain name
1021+
Retrieve logos, backdrops, colors, industry, description, and more from any
1022+
domain
9571023
9581024
Args:
9591025
domain: Domain name to retrieve brand data for (e.g., 'example.com', 'google.com').
@@ -1058,6 +1124,62 @@ async def identify_from_transaction(
10581124
self,
10591125
*,
10601126
transaction_info: str,
1127+
force_language: Literal[
1128+
"albanian",
1129+
"arabic",
1130+
"azeri",
1131+
"bengali",
1132+
"bulgarian",
1133+
"cebuano",
1134+
"croatian",
1135+
"czech",
1136+
"danish",
1137+
"dutch",
1138+
"english",
1139+
"estonian",
1140+
"farsi",
1141+
"finnish",
1142+
"french",
1143+
"german",
1144+
"hausa",
1145+
"hawaiian",
1146+
"hindi",
1147+
"hungarian",
1148+
"icelandic",
1149+
"indonesian",
1150+
"italian",
1151+
"kazakh",
1152+
"kyrgyz",
1153+
"latin",
1154+
"latvian",
1155+
"lithuanian",
1156+
"macedonian",
1157+
"mongolian",
1158+
"nepali",
1159+
"norwegian",
1160+
"pashto",
1161+
"pidgin",
1162+
"polish",
1163+
"portuguese",
1164+
"romanian",
1165+
"russian",
1166+
"serbian",
1167+
"slovak",
1168+
"slovene",
1169+
"somali",
1170+
"spanish",
1171+
"swahili",
1172+
"swedish",
1173+
"tagalog",
1174+
"turkish",
1175+
"ukrainian",
1176+
"urdu",
1177+
"uzbek",
1178+
"vietnamese",
1179+
"welsh",
1180+
]
1181+
| Omit = omit,
1182+
max_speed: bool | Omit = omit,
10611183
timeout_ms: int | Omit = omit,
10621184
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
10631185
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -1073,6 +1195,12 @@ async def identify_from_transaction(
10731195
Args:
10741196
transaction_info: Transaction information to identify the brand
10751197
1198+
force_language: Optional parameter to force the language of the retrieved brand data.
1199+
1200+
max_speed: Optional parameter to optimize the API call for maximum speed. When set to true,
1201+
the API will skip time-consuming operations for faster response at the cost of
1202+
less comprehensive data.
1203+
10761204
timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
10771205
than this value, it will be aborted with a 408 status code. Maximum allowed
10781206
value is 300000ms (5 minutes).
@@ -1095,6 +1223,8 @@ async def identify_from_transaction(
10951223
query=await async_maybe_transform(
10961224
{
10971225
"transaction_info": transaction_info,
1226+
"force_language": force_language,
1227+
"max_speed": max_speed,
10981228
"timeout_ms": timeout_ms,
10991229
},
11001230
brand_identify_from_transaction_params.BrandIdentifyFromTransactionParams,

src/brand/dev/types/brand_identify_from_transaction_params.py

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing_extensions import Required, Annotated, TypedDict
5+
from typing_extensions import Literal, Required, Annotated, TypedDict
66

77
from .._utils import PropertyInfo
88

@@ -13,6 +13,69 @@ class BrandIdentifyFromTransactionParams(TypedDict, total=False):
1313
transaction_info: Required[str]
1414
"""Transaction information to identify the brand"""
1515

16+
force_language: Literal[
17+
"albanian",
18+
"arabic",
19+
"azeri",
20+
"bengali",
21+
"bulgarian",
22+
"cebuano",
23+
"croatian",
24+
"czech",
25+
"danish",
26+
"dutch",
27+
"english",
28+
"estonian",
29+
"farsi",
30+
"finnish",
31+
"french",
32+
"german",
33+
"hausa",
34+
"hawaiian",
35+
"hindi",
36+
"hungarian",
37+
"icelandic",
38+
"indonesian",
39+
"italian",
40+
"kazakh",
41+
"kyrgyz",
42+
"latin",
43+
"latvian",
44+
"lithuanian",
45+
"macedonian",
46+
"mongolian",
47+
"nepali",
48+
"norwegian",
49+
"pashto",
50+
"pidgin",
51+
"polish",
52+
"portuguese",
53+
"romanian",
54+
"russian",
55+
"serbian",
56+
"slovak",
57+
"slovene",
58+
"somali",
59+
"spanish",
60+
"swahili",
61+
"swedish",
62+
"tagalog",
63+
"turkish",
64+
"ukrainian",
65+
"urdu",
66+
"uzbek",
67+
"vietnamese",
68+
"welsh",
69+
]
70+
"""Optional parameter to force the language of the retrieved brand data."""
71+
72+
max_speed: Annotated[bool, PropertyInfo(alias="maxSpeed")]
73+
"""Optional parameter to optimize the API call for maximum speed.
74+
75+
When set to true, the API will skip time-consuming operations for faster
76+
response at the cost of less comprehensive data.
77+
"""
78+
1679
timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")]
1780
"""Optional timeout in milliseconds for the request.
1881

tests/api_resources/test_brand.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ def test_method_identify_from_transaction(self, client: BrandDev) -> None:
165165
def test_method_identify_from_transaction_with_all_params(self, client: BrandDev) -> None:
166166
brand = client.brand.identify_from_transaction(
167167
transaction_info="transaction_info",
168+
force_language="albanian",
169+
max_speed=True,
168170
timeout_ms=1,
169171
)
170172
assert_matches_type(BrandIdentifyFromTransactionResponse, brand, path=["response"])
@@ -647,6 +649,8 @@ async def test_method_identify_from_transaction(self, async_client: AsyncBrandDe
647649
async def test_method_identify_from_transaction_with_all_params(self, async_client: AsyncBrandDev) -> None:
648650
brand = await async_client.brand.identify_from_transaction(
649651
transaction_info="transaction_info",
652+
force_language="albanian",
653+
max_speed=True,
650654
timeout_ms=1,
651655
)
652656
assert_matches_type(BrandIdentifyFromTransactionResponse, brand, path=["response"])

0 commit comments

Comments
 (0)