Skip to content

Commit cd23fbc

Browse files
feat(api): api update
1 parent 9664b9c commit cd23fbc

10 files changed

Lines changed: 147 additions & 3 deletions

‎.stats.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 22
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-bfa54d26b675d92a0b3db3e3c2147dc98250fb1e4cb82bb6bd6f9af544763506.yml
3-
openapi_spec_hash: 7d834a5553262d0a2538bc066f39d549
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-44904c513baa439f294b23964ea368ad52863e13328980f9cac5a8e78cbb58cb.yml
3+
openapi_spec_hash: 9bb50ca838166fb474d28009a7edbd49
44
config_hash: 70354330f92ce169beabc98696ebb9a3

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

Lines changed: 84 additions & 0 deletions
Large diffs are not rendered by default.

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,14 @@ class BrandRetrieveByEmailParams(TypedDict, total=False):
141141
]
142142
"""Optional parameter to force the language of the retrieved brand data."""
143143

144+
max_age_ms: Annotated[int, PropertyInfo(alias="maxAgeMs")]
145+
"""
146+
Maximum age in milliseconds for cached brand data before the API performs a hard
147+
refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms)
148+
are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1
149+
year.
150+
"""
151+
144152
max_speed: Annotated[bool, PropertyInfo(alias="maxSpeed")]
145153
"""Optional parameter to optimize the API call for maximum speed.
146154

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,14 @@ class BrandRetrieveByIsinParams(TypedDict, total=False):
141141
]
142142
"""Optional parameter to force the language of the retrieved brand data."""
143143

144+
max_age_ms: Annotated[int, PropertyInfo(alias="maxAgeMs")]
145+
"""
146+
Maximum age in milliseconds for cached brand data before the API performs a hard
147+
refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms)
148+
are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1
149+
year.
150+
"""
151+
144152
max_speed: Annotated[bool, PropertyInfo(alias="maxSpeed")]
145153
"""Optional parameter to optimize the API call for maximum speed.
146154

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,14 @@ class BrandRetrieveByNameParams(TypedDict, total=False):
386386
]
387387
"""Optional parameter to force the language of the retrieved brand data."""
388388

389+
max_age_ms: Annotated[int, PropertyInfo(alias="maxAgeMs")]
390+
"""
391+
Maximum age in milliseconds for cached brand data before the API performs a hard
392+
refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms)
393+
are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1
394+
year.
395+
"""
396+
389397
max_speed: Annotated[bool, PropertyInfo(alias="maxSpeed")]
390398
"""Optional parameter to optimize the API call for maximum speed.
391399

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,14 @@ class BrandRetrieveByTickerParams(TypedDict, total=False):
140140
]
141141
"""Optional parameter to force the language of the retrieved brand data."""
142142

143+
max_age_ms: Annotated[int, PropertyInfo(alias="maxAgeMs")]
144+
"""
145+
Maximum age in milliseconds for cached brand data before the API performs a hard
146+
refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms)
147+
are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1
148+
year.
149+
"""
150+
143151
max_speed: Annotated[bool, PropertyInfo(alias="maxSpeed")]
144152
"""Optional parameter to optimize the API call for maximum speed.
145153

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,14 @@ class BrandRetrieveParams(TypedDict, total=False):
140140
]
141141
"""Optional parameter to force the language of the retrieved brand data."""
142142

143+
max_age_ms: Annotated[int, PropertyInfo(alias="maxAgeMs")]
144+
"""
145+
Maximum age in milliseconds for cached brand data before the API performs a hard
146+
refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms)
147+
are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1
148+
year.
149+
"""
150+
143151
max_speed: Annotated[bool, PropertyInfo(alias="maxSpeed")]
144152
"""Optional parameter to optimize the API call for maximum speed.
145153

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ class BrandRetrieveSimplifiedParams(TypedDict, total=False):
1313
domain: Required[str]
1414
"""Domain name to retrieve simplified brand data for"""
1515

16+
max_age_ms: Annotated[int, PropertyInfo(alias="maxAgeMs")]
17+
"""
18+
Maximum age in milliseconds for cached brand data before the API performs a hard
19+
refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms)
20+
are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1
21+
year.
22+
"""
23+
1624
timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")]
1725
"""Optional timeout in milliseconds for the request.
1826

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class Enrichment(TypedDict, total=False):
4242
"""
4343

4444
max_time_per_ms: Annotated[int, PropertyInfo(alias="maxTimePerMs")]
45-
"""Per-image enrichment timeout in milliseconds. Default: 6000. Maximum: 60000."""
45+
"""Per-image enrichment timeout in milliseconds. Default: 30000. Maximum: 60000."""
4646

4747
resolution: bool
4848
"""Measure image width and height when possible."""

‎tests/api_resources/test_brand.py‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def test_method_retrieve_with_all_params(self, client: ContextDev) -> None:
3939
brand = client.brand.retrieve(
4040
domain="domain",
4141
force_language="afrikaans",
42+
max_age_ms=86400000,
4243
max_speed=True,
4344
timeout_ms=1000,
4445
)
@@ -134,6 +135,7 @@ def test_method_retrieve_by_email_with_all_params(self, client: ContextDev) -> N
134135
brand = client.brand.retrieve_by_email(
135136
email="dev@stainless.com",
136137
force_language="afrikaans",
138+
max_age_ms=86400000,
137139
max_speed=True,
138140
timeout_ms=1000,
139141
)
@@ -179,6 +181,7 @@ def test_method_retrieve_by_isin_with_all_params(self, client: ContextDev) -> No
179181
brand = client.brand.retrieve_by_isin(
180182
isin="SE60513A9993",
181183
force_language="afrikaans",
184+
max_age_ms=86400000,
182185
max_speed=True,
183186
timeout_ms=1000,
184187
)
@@ -225,6 +228,7 @@ def test_method_retrieve_by_name_with_all_params(self, client: ContextDev) -> No
225228
name="xxx",
226229
country_gl="ad",
227230
force_language="afrikaans",
231+
max_age_ms=86400000,
228232
max_speed=True,
229233
timeout_ms=1000,
230234
)
@@ -270,6 +274,7 @@ def test_method_retrieve_by_ticker_with_all_params(self, client: ContextDev) ->
270274
brand = client.brand.retrieve_by_ticker(
271275
ticker="ticker",
272276
force_language="afrikaans",
277+
max_age_ms=86400000,
273278
max_speed=True,
274279
ticker_exchange="AMEX",
275280
timeout_ms=1000,
@@ -315,6 +320,7 @@ def test_method_retrieve_simplified(self, client: ContextDev) -> None:
315320
def test_method_retrieve_simplified_with_all_params(self, client: ContextDev) -> None:
316321
brand = client.brand.retrieve_simplified(
317322
domain="domain",
323+
max_age_ms=86400000,
318324
timeout_ms=1000,
319325
)
320326
assert_matches_type(BrandRetrieveSimplifiedResponse, brand, path=["response"])
@@ -365,6 +371,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncContextD
365371
brand = await async_client.brand.retrieve(
366372
domain="domain",
367373
force_language="afrikaans",
374+
max_age_ms=86400000,
368375
max_speed=True,
369376
timeout_ms=1000,
370377
)
@@ -460,6 +467,7 @@ async def test_method_retrieve_by_email_with_all_params(self, async_client: Asyn
460467
brand = await async_client.brand.retrieve_by_email(
461468
email="dev@stainless.com",
462469
force_language="afrikaans",
470+
max_age_ms=86400000,
463471
max_speed=True,
464472
timeout_ms=1000,
465473
)
@@ -505,6 +513,7 @@ async def test_method_retrieve_by_isin_with_all_params(self, async_client: Async
505513
brand = await async_client.brand.retrieve_by_isin(
506514
isin="SE60513A9993",
507515
force_language="afrikaans",
516+
max_age_ms=86400000,
508517
max_speed=True,
509518
timeout_ms=1000,
510519
)
@@ -551,6 +560,7 @@ async def test_method_retrieve_by_name_with_all_params(self, async_client: Async
551560
name="xxx",
552561
country_gl="ad",
553562
force_language="afrikaans",
563+
max_age_ms=86400000,
554564
max_speed=True,
555565
timeout_ms=1000,
556566
)
@@ -596,6 +606,7 @@ async def test_method_retrieve_by_ticker_with_all_params(self, async_client: Asy
596606
brand = await async_client.brand.retrieve_by_ticker(
597607
ticker="ticker",
598608
force_language="afrikaans",
609+
max_age_ms=86400000,
599610
max_speed=True,
600611
ticker_exchange="AMEX",
601612
timeout_ms=1000,
@@ -641,6 +652,7 @@ async def test_method_retrieve_simplified(self, async_client: AsyncContextDev) -
641652
async def test_method_retrieve_simplified_with_all_params(self, async_client: AsyncContextDev) -> None:
642653
brand = await async_client.brand.retrieve_simplified(
643654
domain="domain",
655+
max_age_ms=86400000,
644656
timeout_ms=1000,
645657
)
646658
assert_matches_type(BrandRetrieveSimplifiedResponse, brand, path=["response"])

0 commit comments

Comments
 (0)