Skip to content

Commit f63569e

Browse files
feat(api): api update
1 parent 79826c4 commit f63569e

6 files changed

Lines changed: 123 additions & 14 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: 29
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-5280c0f42603633a06d2404b120b98d0d9aa43256d13680bbdead7579a90452a.yml
3-
openapi_spec_hash: 34869d638c12bf076949bb7e050dd634
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-7dbd739a81e6aaf7fc7ef1858606e7d572d309af55082a66431d9292e655e66f.yml
3+
openapi_spec_hash: a6374d5d718a7bd9d3d54fb657e2bd9d
44
config_hash: ff35e224e809656528c44163aa41bebd

‎README.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ client = ContextDev(
4343

4444
brand = client.brand.retrieve(
4545
domain="REPLACE_ME",
46+
type="by_domain",
4647
)
4748
print(brand.brand)
4849
```
@@ -69,6 +70,7 @@ client = AsyncContextDev(
6970
async def main() -> None:
7071
brand = await client.brand.retrieve(
7172
domain="REPLACE_ME",
73+
type="by_domain",
7274
)
7375
print(brand.brand)
7476

@@ -105,6 +107,7 @@ async def main() -> None:
105107
) as client:
106108
brand = await client.brand.retrieve(
107109
domain="REPLACE_ME",
110+
type="by_domain",
108111
)
109112
print(brand.brand)
110113

@@ -161,6 +164,7 @@ client = ContextDev()
161164
try:
162165
client.brand.retrieve(
163166
domain="REPLACE_ME",
167+
type="by_domain",
164168
)
165169
except context.dev.APIConnectionError as e:
166170
print("The server could not be reached")
@@ -206,6 +210,7 @@ client = ContextDev(
206210
# Or, configure per-request:
207211
client.with_options(max_retries=5).brand.retrieve(
208212
domain="REPLACE_ME",
213+
type="by_domain",
209214
)
210215
```
211216

@@ -231,6 +236,7 @@ client = ContextDev(
231236
# Override per-request:
232237
client.with_options(timeout=5.0).brand.retrieve(
233238
domain="REPLACE_ME",
239+
type="by_domain",
234240
)
235241
```
236242

@@ -274,6 +280,7 @@ from context.dev import ContextDev
274280
client = ContextDev()
275281
response = client.brand.with_raw_response.retrieve(
276282
domain="REPLACE_ME",
283+
type="by_domain",
277284
)
278285
print(response.headers.get('X-My-Header'))
279286

@@ -294,6 +301,7 @@ To stream the response body, use `.with_streaming_response` instead, which requi
294301
```python
295302
with client.brand.with_streaming_response.retrieve(
296303
domain="REPLACE_ME",
304+
type="by_domain",
297305
) as response:
298306
print(response.headers.get("X-My-Header"))
299307

‎src/context/dev/resources/brand.py‎

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ def retrieve(
4949
self,
5050
*,
5151
domain: str,
52+
type: Literal["by_domain"],
5253
force_language: Literal[
5354
"afrikaans",
5455
"albanian",
@@ -191,6 +192,8 @@ def retrieve(
191192
Args:
192193
domain: Domain name to retrieve brand data for (e.g., 'stripe.com').
193194
195+
type: Discriminator for domain-based brand retrieval.
196+
194197
max_age_ms: Maximum age in milliseconds for cached brand data before the API performs a hard
195198
refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms)
196199
are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1
@@ -219,6 +222,7 @@ def retrieve(
219222
self,
220223
*,
221224
name: str,
225+
type: Literal["by_name"],
222226
country_gl: str | Omit = omit,
223227
force_language: Literal[
224228
"afrikaans",
@@ -362,6 +366,8 @@ def retrieve(
362366
Args:
363367
name: Company name to retrieve brand data for (e.g., 'Apple Inc').
364368
369+
type: Discriminator for name-based brand retrieval.
370+
365371
country_gl: Optional country code hint (GL parameter) to specify the country when looking up
366372
by company name.
367373
@@ -393,6 +399,7 @@ def retrieve(
393399
self,
394400
*,
395401
email: str,
402+
type: Literal["by_email"],
396403
force_language: Literal[
397404
"afrikaans",
398405
"albanian",
@@ -535,6 +542,8 @@ def retrieve(
535542
Args:
536543
email: Email address to retrieve brand data for (e.g., 'jane@stripe.com').
537544
545+
type: Discriminator for email-based brand retrieval.
546+
538547
max_age_ms: Maximum age in milliseconds for cached brand data before the API performs a hard
539548
refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms)
540549
are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1
@@ -563,6 +572,7 @@ def retrieve(
563572
self,
564573
*,
565574
ticker: str,
575+
type: Literal["by_ticker"],
566576
force_language: Literal[
567577
"afrikaans",
568578
"albanian",
@@ -706,6 +716,8 @@ def retrieve(
706716
Args:
707717
ticker: Stock ticker symbol to retrieve brand data for (e.g., 'AAPL').
708718
719+
type: Discriminator for ticker-based brand retrieval.
720+
709721
max_age_ms: Maximum age in milliseconds for cached brand data before the API performs a hard
710722
refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms)
711723
are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1
@@ -736,6 +748,7 @@ def retrieve(
736748
self,
737749
*,
738750
transaction_info: str,
751+
type: Literal["by_transaction"],
739752
city: str | Omit = omit,
740753
country_gl: str | Omit = omit,
741754
force_language: Literal[
@@ -882,6 +895,8 @@ def retrieve(
882895
Args:
883896
transaction_info: Transaction information to identify the brand.
884897
898+
type: Discriminator for transaction-based brand retrieval.
899+
885900
city: Optional city name to prioritize when searching for the brand.
886901
887902
country_gl: Optional country code hint (GL parameter) to specify the country when
@@ -913,11 +928,18 @@ def retrieve(
913928
"""
914929
...
915930

916-
@required_args(["domain"], ["name"], ["email"], ["ticker"], ["transaction_info"])
931+
@required_args(
932+
["domain", "type"], ["name", "type"], ["email", "type"], ["ticker", "type"], ["transaction_info", "type"]
933+
)
917934
def retrieve(
918935
self,
919936
*,
920937
domain: str | Omit = omit,
938+
type: Literal["by_domain"]
939+
| Literal["by_name"]
940+
| Literal["by_email"]
941+
| Literal["by_ticker"]
942+
| Literal["by_transaction"],
921943
force_language: Literal[
922944
"afrikaans",
923945
"albanian",
@@ -1066,6 +1088,7 @@ def retrieve(
10661088
body=maybe_transform(
10671089
{
10681090
"domain": domain,
1091+
"type": type,
10691092
"force_language": force_language,
10701093
"max_age_ms": max_age_ms,
10711094
"max_speed": max_speed,
@@ -1172,6 +1195,7 @@ async def retrieve(
11721195
self,
11731196
*,
11741197
domain: str,
1198+
type: Literal["by_domain"],
11751199
force_language: Literal[
11761200
"afrikaans",
11771201
"albanian",
@@ -1314,6 +1338,8 @@ async def retrieve(
13141338
Args:
13151339
domain: Domain name to retrieve brand data for (e.g., 'stripe.com').
13161340
1341+
type: Discriminator for domain-based brand retrieval.
1342+
13171343
max_age_ms: Maximum age in milliseconds for cached brand data before the API performs a hard
13181344
refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms)
13191345
are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1
@@ -1342,6 +1368,7 @@ async def retrieve(
13421368
self,
13431369
*,
13441370
name: str,
1371+
type: Literal["by_name"],
13451372
country_gl: str | Omit = omit,
13461373
force_language: Literal[
13471374
"afrikaans",
@@ -1485,6 +1512,8 @@ async def retrieve(
14851512
Args:
14861513
name: Company name to retrieve brand data for (e.g., 'Apple Inc').
14871514
1515+
type: Discriminator for name-based brand retrieval.
1516+
14881517
country_gl: Optional country code hint (GL parameter) to specify the country when looking up
14891518
by company name.
14901519
@@ -1516,6 +1545,7 @@ async def retrieve(
15161545
self,
15171546
*,
15181547
email: str,
1548+
type: Literal["by_email"],
15191549
force_language: Literal[
15201550
"afrikaans",
15211551
"albanian",
@@ -1658,6 +1688,8 @@ async def retrieve(
16581688
Args:
16591689
email: Email address to retrieve brand data for (e.g., 'jane@stripe.com').
16601690
1691+
type: Discriminator for email-based brand retrieval.
1692+
16611693
max_age_ms: Maximum age in milliseconds for cached brand data before the API performs a hard
16621694
refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms)
16631695
are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1
@@ -1686,6 +1718,7 @@ async def retrieve(
16861718
self,
16871719
*,
16881720
ticker: str,
1721+
type: Literal["by_ticker"],
16891722
force_language: Literal[
16901723
"afrikaans",
16911724
"albanian",
@@ -1829,6 +1862,8 @@ async def retrieve(
18291862
Args:
18301863
ticker: Stock ticker symbol to retrieve brand data for (e.g., 'AAPL').
18311864
1865+
type: Discriminator for ticker-based brand retrieval.
1866+
18321867
max_age_ms: Maximum age in milliseconds for cached brand data before the API performs a hard
18331868
refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms)
18341869
are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1
@@ -1859,6 +1894,7 @@ async def retrieve(
18591894
self,
18601895
*,
18611896
transaction_info: str,
1897+
type: Literal["by_transaction"],
18621898
city: str | Omit = omit,
18631899
country_gl: str | Omit = omit,
18641900
force_language: Literal[
@@ -2005,6 +2041,8 @@ async def retrieve(
20052041
Args:
20062042
transaction_info: Transaction information to identify the brand.
20072043
2044+
type: Discriminator for transaction-based brand retrieval.
2045+
20082046
city: Optional city name to prioritize when searching for the brand.
20092047
20102048
country_gl: Optional country code hint (GL parameter) to specify the country when
@@ -2036,11 +2074,18 @@ async def retrieve(
20362074
"""
20372075
...
20382076

2039-
@required_args(["domain"], ["name"], ["email"], ["ticker"], ["transaction_info"])
2077+
@required_args(
2078+
["domain", "type"], ["name", "type"], ["email", "type"], ["ticker", "type"], ["transaction_info", "type"]
2079+
)
20402080
async def retrieve(
20412081
self,
20422082
*,
20432083
domain: str | Omit = omit,
2084+
type: Literal["by_domain"]
2085+
| Literal["by_name"]
2086+
| Literal["by_email"]
2087+
| Literal["by_ticker"]
2088+
| Literal["by_transaction"],
20442089
force_language: Literal[
20452090
"afrikaans",
20462091
"albanian",
@@ -2189,6 +2234,7 @@ async def retrieve(
21892234
body=await async_maybe_transform(
21902235
{
21912236
"domain": domain,
2237+
"type": type,
21922238
"force_language": force_language,
21932239
"max_age_ms": max_age_ms,
21942240
"max_speed": max_speed,

‎src/context/dev/types/brand_retrieve_params.py‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ class BrandRetrieveByDomainRequest(TypedDict, total=False):
2121
domain: Required[str]
2222
"""Domain name to retrieve brand data for (e.g., 'stripe.com')."""
2323

24+
type: Required[Literal["by_domain"]]
25+
"""Discriminator for domain-based brand retrieval."""
26+
2427
force_language: Literal[
2528
"afrikaans",
2629
"albanian",
@@ -171,6 +174,9 @@ class BrandRetrieveByNameRequest(TypedDict, total=False):
171174
name: Required[str]
172175
"""Company name to retrieve brand data for (e.g., 'Apple Inc')."""
173176

177+
type: Required[Literal["by_name"]]
178+
"""Discriminator for name-based brand retrieval."""
179+
174180
country_gl: str
175181
"""
176182
Optional country code hint (GL parameter) to specify the country when looking up
@@ -327,6 +333,9 @@ class BrandRetrieveByEmailRequest(TypedDict, total=False):
327333
email: Required[str]
328334
"""Email address to retrieve brand data for (e.g., 'jane@stripe.com')."""
329335

336+
type: Required[Literal["by_email"]]
337+
"""Discriminator for email-based brand retrieval."""
338+
330339
force_language: Literal[
331340
"afrikaans",
332341
"albanian",
@@ -477,6 +486,9 @@ class BrandRetrieveByTickerRequest(TypedDict, total=False):
477486
ticker: Required[str]
478487
"""Stock ticker symbol to retrieve brand data for (e.g., 'AAPL')."""
479488

489+
type: Required[Literal["by_ticker"]]
490+
"""Discriminator for ticker-based brand retrieval."""
491+
480492
force_language: Literal[
481493
"afrikaans",
482494
"albanian",
@@ -630,6 +642,9 @@ class BrandRetrieveFromTransactionRequest(TypedDict, total=False):
630642
transaction_info: Required[str]
631643
"""Transaction information to identify the brand."""
632644

645+
type: Required[Literal["by_transaction"]]
646+
"""Discriminator for transaction-based brand retrieval."""
647+
633648
city: str
634649
"""Optional city name to prioritize when searching for the brand."""
635650

0 commit comments

Comments
 (0)