Skip to content

Commit cd6cf45

Browse files
feat(api): api update
1 parent 8447023 commit cd6cf45

5 files changed

Lines changed: 50 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 @@
11
configured_endpoints: 23
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-53441ebf037f11ab2656b64a88e11d78d4b92f39b803ba62fe3ccf77cb6f84eb.yml
3-
openapi_spec_hash: 88c222227b33b3cba5898fd55782cce9
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-079e4949baaeab93254aa8a651f4e9976e95387b1633002e925114ce36f29013.yml
3+
openapi_spec_hash: 331f27b62376aaf9c311af03a21d31b8
44
config_hash: ada0970327c433e075b4ceef583e0755

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ def extract_fonts(
6666
*,
6767
direct_url: str | Omit = omit,
6868
domain: str | Omit = omit,
69+
max_age_ms: int | Omit = omit,
6970
timeout_ms: int | Omit = omit,
7071
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
7172
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -87,6 +88,11 @@ def extract_fonts(
8788
domain will be automatically normalized and validated. You must provide either
8889
'domain' or 'directUrl', but not both.
8990
91+
max_age_ms: Maximum age in milliseconds for cached data before the API performs a hard
92+
refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms)
93+
are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1
94+
year.
95+
9096
timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
9197
than this value, it will be aborted with a 408 status code. Maximum allowed
9298
value is 300000ms (5 minutes).
@@ -110,6 +116,7 @@ def extract_fonts(
110116
{
111117
"direct_url": direct_url,
112118
"domain": domain,
119+
"max_age_ms": max_age_ms,
113120
"timeout_ms": timeout_ms,
114121
},
115122
web_extract_fonts_params.WebExtractFontsParams,
@@ -123,6 +130,7 @@ def extract_styleguide(
123130
*,
124131
direct_url: str | Omit = omit,
125132
domain: str | Omit = omit,
133+
max_age_ms: int | Omit = omit,
126134
timeout_ms: int | Omit = omit,
127135
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
128136
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -145,6 +153,11 @@ def extract_styleguide(
145153
domain will be automatically normalized and validated. You must provide either
146154
'domain' or 'directUrl', but not both.
147155
156+
max_age_ms: Maximum age in milliseconds for cached data before the API performs a hard
157+
refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms)
158+
are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1
159+
year.
160+
148161
timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
149162
than this value, it will be aborted with a 408 status code. Maximum allowed
150163
value is 300000ms (5 minutes).
@@ -168,6 +181,7 @@ def extract_styleguide(
168181
{
169182
"direct_url": direct_url,
170183
"domain": domain,
184+
"max_age_ms": max_age_ms,
171185
"timeout_ms": timeout_ms,
172186
},
173187
web_extract_styleguide_params.WebExtractStyleguideParams,
@@ -749,6 +763,7 @@ async def extract_fonts(
749763
*,
750764
direct_url: str | Omit = omit,
751765
domain: str | Omit = omit,
766+
max_age_ms: int | Omit = omit,
752767
timeout_ms: int | Omit = omit,
753768
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
754769
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -770,6 +785,11 @@ async def extract_fonts(
770785
domain will be automatically normalized and validated. You must provide either
771786
'domain' or 'directUrl', but not both.
772787
788+
max_age_ms: Maximum age in milliseconds for cached data before the API performs a hard
789+
refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms)
790+
are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1
791+
year.
792+
773793
timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
774794
than this value, it will be aborted with a 408 status code. Maximum allowed
775795
value is 300000ms (5 minutes).
@@ -793,6 +813,7 @@ async def extract_fonts(
793813
{
794814
"direct_url": direct_url,
795815
"domain": domain,
816+
"max_age_ms": max_age_ms,
796817
"timeout_ms": timeout_ms,
797818
},
798819
web_extract_fonts_params.WebExtractFontsParams,
@@ -806,6 +827,7 @@ async def extract_styleguide(
806827
*,
807828
direct_url: str | Omit = omit,
808829
domain: str | Omit = omit,
830+
max_age_ms: int | Omit = omit,
809831
timeout_ms: int | Omit = omit,
810832
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
811833
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -828,6 +850,11 @@ async def extract_styleguide(
828850
domain will be automatically normalized and validated. You must provide either
829851
'domain' or 'directUrl', but not both.
830852
853+
max_age_ms: Maximum age in milliseconds for cached data before the API performs a hard
854+
refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms)
855+
are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1
856+
year.
857+
831858
timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
832859
than this value, it will be aborted with a 408 status code. Maximum allowed
833860
value is 300000ms (5 minutes).
@@ -851,6 +878,7 @@ async def extract_styleguide(
851878
{
852879
"direct_url": direct_url,
853880
"domain": domain,
881+
"max_age_ms": max_age_ms,
854882
"timeout_ms": timeout_ms,
855883
},
856884
web_extract_styleguide_params.WebExtractStyleguideParams,

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ class WebExtractFontsParams(TypedDict, total=False):
2424
either 'domain' or 'directUrl', but not both.
2525
"""
2626

27+
max_age_ms: Annotated[int, PropertyInfo(alias="maxAgeMs")]
28+
"""
29+
Maximum age in milliseconds for cached data before the API performs a hard
30+
refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms)
31+
are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1
32+
year.
33+
"""
34+
2735
timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")]
2836
"""Optional timeout in milliseconds for the request.
2937

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ class WebExtractStyleguideParams(TypedDict, total=False):
2525
either 'domain' or 'directUrl', but not both.
2626
"""
2727

28+
max_age_ms: Annotated[int, PropertyInfo(alias="maxAgeMs")]
29+
"""
30+
Maximum age in milliseconds for cached data before the API performs a hard
31+
refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms)
32+
are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1
33+
year.
34+
"""
35+
2836
timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")]
2937
"""Optional timeout in milliseconds for the request.
3038

‎tests/api_resources/test_web.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def test_method_extract_fonts_with_all_params(self, client: ContextDev) -> None:
3939
web = client.web.extract_fonts(
4040
direct_url="https://example.com",
4141
domain="domain",
42+
max_age_ms=86400000,
4243
timeout_ms=1000,
4344
)
4445
assert_matches_type(WebExtractFontsResponse, web, path=["response"])
@@ -77,6 +78,7 @@ def test_method_extract_styleguide_with_all_params(self, client: ContextDev) ->
7778
web = client.web.extract_styleguide(
7879
direct_url="https://example.com",
7980
domain="domain",
81+
max_age_ms=86400000,
8082
timeout_ms=1000,
8183
)
8284
assert_matches_type(WebExtractStyleguideResponse, web, path=["response"])
@@ -493,6 +495,7 @@ async def test_method_extract_fonts_with_all_params(self, async_client: AsyncCon
493495
web = await async_client.web.extract_fonts(
494496
direct_url="https://example.com",
495497
domain="domain",
498+
max_age_ms=86400000,
496499
timeout_ms=1000,
497500
)
498501
assert_matches_type(WebExtractFontsResponse, web, path=["response"])
@@ -531,6 +534,7 @@ async def test_method_extract_styleguide_with_all_params(self, async_client: Asy
531534
web = await async_client.web.extract_styleguide(
532535
direct_url="https://example.com",
533536
domain="domain",
537+
max_age_ms=86400000,
534538
timeout_ms=1000,
535539
)
536540
assert_matches_type(WebExtractStyleguideResponse, web, path=["response"])

0 commit comments

Comments
 (0)