Skip to content

Commit 17e78ce

Browse files
feat(api): api update
1 parent fdaf7d9 commit 17e78ce

6 files changed

Lines changed: 43 additions & 4 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: 27
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/nen-labs%2Fsteel-e9cf72266a1cf15753f39d89fd8355a0e3feaca57352c5b3a465742f039cd752.yml
3-
openapi_spec_hash: 6efbbb6d9cec96102654dc52883091aa
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/nen-labs%2Fsteel-15ffd3fc04f32b8bc8de63802a7c1bedfab2f9aee5b8d5d13a4206938354deee.yml
3+
openapi_spec_hash: a047f63bfa516d352a0a249bbe19bac6
44
config_hash: e88d2c04584e96ef1e76c72156c3c186

src/steel/_client.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ def pdf(
194194
*,
195195
url: str,
196196
delay: float | NotGiven = NOT_GIVEN,
197+
region: Literal["lax", "ord", "iad", "bom", "scl", "fra", "hkg"] | NotGiven = NOT_GIVEN,
197198
use_proxy: bool | NotGiven = NOT_GIVEN,
198199
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
199200
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -210,6 +211,8 @@ def pdf(
210211
211212
delay: Delay before generating the PDF (in milliseconds)
212213
214+
region: The desired region for the action to be performed in
215+
213216
use_proxy: Use a Steel-provided residential proxy for generating the PDF
214217
215218
extra_headers: Send extra headers
@@ -226,6 +229,7 @@ def pdf(
226229
{
227230
"url": url,
228231
"delay": delay,
232+
"region": region,
229233
"use_proxy": use_proxy,
230234
},
231235
client_pdf_params.ClientPdfParams,
@@ -243,6 +247,7 @@ def scrape(
243247
delay: float | NotGiven = NOT_GIVEN,
244248
format: List[Literal["html", "readability", "cleaned_html", "markdown"]] | NotGiven = NOT_GIVEN,
245249
pdf: bool | NotGiven = NOT_GIVEN,
250+
region: Literal["lax", "ord", "iad", "bom", "scl", "fra", "hkg"] | NotGiven = NOT_GIVEN,
246251
screenshot: bool | NotGiven = NOT_GIVEN,
247252
use_proxy: bool | NotGiven = NOT_GIVEN,
248253
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -264,6 +269,8 @@ def scrape(
264269
265270
pdf: Include a PDF in the response
266271
272+
region: The desired region for the action to be performed in
273+
267274
screenshot: Include a screenshot in the response
268275
269276
use_proxy: Use a Steel-provided residential proxy for the scrape
@@ -284,6 +291,7 @@ def scrape(
284291
"delay": delay,
285292
"format": format,
286293
"pdf": pdf,
294+
"region": region,
287295
"screenshot": screenshot,
288296
"use_proxy": use_proxy,
289297
},
@@ -301,6 +309,7 @@ def screenshot(
301309
url: str,
302310
delay: float | NotGiven = NOT_GIVEN,
303311
full_page: bool | NotGiven = NOT_GIVEN,
312+
region: Literal["lax", "ord", "iad", "bom", "scl", "fra", "hkg"] | NotGiven = NOT_GIVEN,
304313
use_proxy: bool | NotGiven = NOT_GIVEN,
305314
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
306315
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -319,6 +328,8 @@ def screenshot(
319328
320329
full_page: Capture the full page screenshot. Default is `false`.
321330
331+
region: The desired region for the action to be performed in
332+
322333
use_proxy: Use a Steel-provided residential proxy for capturing the screenshot
323334
324335
extra_headers: Send extra headers
@@ -336,6 +347,7 @@ def screenshot(
336347
"url": url,
337348
"delay": delay,
338349
"full_page": full_page,
350+
"region": region,
339351
"use_proxy": use_proxy,
340352
},
341353
client_screenshot_params.ClientScreenshotParams,
@@ -521,6 +533,7 @@ async def pdf(
521533
*,
522534
url: str,
523535
delay: float | NotGiven = NOT_GIVEN,
536+
region: Literal["lax", "ord", "iad", "bom", "scl", "fra", "hkg"] | NotGiven = NOT_GIVEN,
524537
use_proxy: bool | NotGiven = NOT_GIVEN,
525538
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
526539
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -537,6 +550,8 @@ async def pdf(
537550
538551
delay: Delay before generating the PDF (in milliseconds)
539552
553+
region: The desired region for the action to be performed in
554+
540555
use_proxy: Use a Steel-provided residential proxy for generating the PDF
541556
542557
extra_headers: Send extra headers
@@ -553,6 +568,7 @@ async def pdf(
553568
{
554569
"url": url,
555570
"delay": delay,
571+
"region": region,
556572
"use_proxy": use_proxy,
557573
},
558574
client_pdf_params.ClientPdfParams,
@@ -570,6 +586,7 @@ async def scrape(
570586
delay: float | NotGiven = NOT_GIVEN,
571587
format: List[Literal["html", "readability", "cleaned_html", "markdown"]] | NotGiven = NOT_GIVEN,
572588
pdf: bool | NotGiven = NOT_GIVEN,
589+
region: Literal["lax", "ord", "iad", "bom", "scl", "fra", "hkg"] | NotGiven = NOT_GIVEN,
573590
screenshot: bool | NotGiven = NOT_GIVEN,
574591
use_proxy: bool | NotGiven = NOT_GIVEN,
575592
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -591,6 +608,8 @@ async def scrape(
591608
592609
pdf: Include a PDF in the response
593610
611+
region: The desired region for the action to be performed in
612+
594613
screenshot: Include a screenshot in the response
595614
596615
use_proxy: Use a Steel-provided residential proxy for the scrape
@@ -611,6 +630,7 @@ async def scrape(
611630
"delay": delay,
612631
"format": format,
613632
"pdf": pdf,
633+
"region": region,
614634
"screenshot": screenshot,
615635
"use_proxy": use_proxy,
616636
},
@@ -628,6 +648,7 @@ async def screenshot(
628648
url: str,
629649
delay: float | NotGiven = NOT_GIVEN,
630650
full_page: bool | NotGiven = NOT_GIVEN,
651+
region: Literal["lax", "ord", "iad", "bom", "scl", "fra", "hkg"] | NotGiven = NOT_GIVEN,
631652
use_proxy: bool | NotGiven = NOT_GIVEN,
632653
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
633654
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -646,6 +667,8 @@ async def screenshot(
646667
647668
full_page: Capture the full page screenshot. Default is `false`.
648669
670+
region: The desired region for the action to be performed in
671+
649672
use_proxy: Use a Steel-provided residential proxy for capturing the screenshot
650673
651674
extra_headers: Send extra headers
@@ -663,6 +686,7 @@ async def screenshot(
663686
"url": url,
664687
"delay": delay,
665688
"full_page": full_page,
689+
"region": region,
666690
"use_proxy": use_proxy,
667691
},
668692
client_screenshot_params.ClientScreenshotParams,

src/steel/types/client_pdf_params.py

Lines changed: 4 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

@@ -16,5 +16,8 @@ class ClientPdfParams(TypedDict, total=False):
1616
delay: float
1717
"""Delay before generating the PDF (in milliseconds)"""
1818

19+
region: Literal["lax", "ord", "iad", "bom", "scl", "fra", "hkg"]
20+
"""The desired region for the action to be performed in"""
21+
1922
use_proxy: Annotated[bool, PropertyInfo(alias="useProxy")]
2023
"""Use a Steel-provided residential proxy for generating the PDF"""

src/steel/types/client_scrape_params.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ class ClientScrapeParams(TypedDict, total=False):
2323
pdf: bool
2424
"""Include a PDF in the response"""
2525

26+
region: Literal["lax", "ord", "iad", "bom", "scl", "fra", "hkg"]
27+
"""The desired region for the action to be performed in"""
28+
2629
screenshot: bool
2730
"""Include a screenshot in the response"""
2831

src/steel/types/client_screenshot_params.py

Lines changed: 4 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

@@ -19,5 +19,8 @@ class ClientScreenshotParams(TypedDict, total=False):
1919
full_page: Annotated[bool, PropertyInfo(alias="fullPage")]
2020
"""Capture the full page screenshot. Default is `false`."""
2121

22+
region: Literal["lax", "ord", "iad", "bom", "scl", "fra", "hkg"]
23+
"""The desired region for the action to be performed in"""
24+
2225
use_proxy: Annotated[bool, PropertyInfo(alias="useProxy")]
2326
"""Use a Steel-provided residential proxy for capturing the screenshot"""

tests/api_resources/test_client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def test_method_pdf_with_all_params(self, client: Steel) -> None:
3333
client_ = client.pdf(
3434
url="https://example.com",
3535
delay=0,
36+
region="lax",
3637
use_proxy=True,
3738
)
3839
assert_matches_type(PdfResponse, client_, path=["response"])
@@ -75,6 +76,7 @@ def test_method_scrape_with_all_params(self, client: Steel) -> None:
7576
delay=0,
7677
format=["html"],
7778
pdf=True,
79+
region="lax",
7880
screenshot=True,
7981
use_proxy=True,
8082
)
@@ -117,6 +119,7 @@ def test_method_screenshot_with_all_params(self, client: Steel) -> None:
117119
url="https://example.com",
118120
delay=0,
119121
full_page=True,
122+
region="lax",
120123
use_proxy=True,
121124
)
122125
assert_matches_type(ScreenshotResponse, client_, path=["response"])
@@ -163,6 +166,7 @@ async def test_method_pdf_with_all_params(self, async_client: AsyncSteel) -> Non
163166
client = await async_client.pdf(
164167
url="https://example.com",
165168
delay=0,
169+
region="lax",
166170
use_proxy=True,
167171
)
168172
assert_matches_type(PdfResponse, client, path=["response"])
@@ -205,6 +209,7 @@ async def test_method_scrape_with_all_params(self, async_client: AsyncSteel) ->
205209
delay=0,
206210
format=["html"],
207211
pdf=True,
212+
region="lax",
208213
screenshot=True,
209214
use_proxy=True,
210215
)
@@ -247,6 +252,7 @@ async def test_method_screenshot_with_all_params(self, async_client: AsyncSteel)
247252
url="https://example.com",
248253
delay=0,
249254
full_page=True,
255+
region="lax",
250256
use_proxy=True,
251257
)
252258
assert_matches_type(ScreenshotResponse, client, path=["response"])

0 commit comments

Comments
 (0)