Skip to content

Commit e62a897

Browse files
feat(api): api update
1 parent 8ac9d34 commit e62a897

6 files changed

Lines changed: 50 additions & 24 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: 39
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/nen-labs/steel-a8cf8e70c6c352d4f7845225a991e29a67d1f2ec9b7bcd6e540fa27791733aa5.yml
3-
openapi_spec_hash: c8ea136263d712103781c0afd3b8ad3a
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/nen-labs/steel-ece6adbbe9a1ff86c2b685f07b970163a96a98776c969a2f3fb10381ffe4f89d.yml
3+
openapi_spec_hash: 493c249a347997a9f6e599d0bae330c8
44
config_hash: dce4dea59023b0a00890fa654fbfffb4

src/steel/resources/sessions/sessions.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ def computer(
344344
session_id: str,
345345
*,
346346
action: Literal["click_mouse"],
347-
button: Literal["left", "right", "middle", "back", "forward"],
347+
button: Literal["left", "right", "middle", "back", "forward"] | Omit = omit,
348348
click_type: Literal["down", "up", "click"] | Omit = omit,
349349
coordinates: Iterable[float] | Omit = omit,
350350
hold_keys: SequenceNotStr[str] | Omit = omit,
@@ -361,7 +361,7 @@ def computer(
361361
Execute computer actions like mouse movements, clicks, keyboard input, and more
362362
363363
Args:
364-
button: Mouse button to click
364+
button: Mouse button to click. Defaults to 'left'
365365
366366
click_type: Type of click (down, up, or click). Defaults to 'click'
367367
@@ -622,9 +622,8 @@ def computer(
622622

623623
@required_args(
624624
["action", "coordinates"],
625-
["action", "button"],
626-
["action", "path"],
627625
["action"],
626+
["action", "path"],
628627
["action", "keys"],
629628
["action", "text"],
630629
["action", "duration"],
@@ -1157,7 +1156,7 @@ async def computer(
11571156
session_id: str,
11581157
*,
11591158
action: Literal["click_mouse"],
1160-
button: Literal["left", "right", "middle", "back", "forward"],
1159+
button: Literal["left", "right", "middle", "back", "forward"] | Omit = omit,
11611160
click_type: Literal["down", "up", "click"] | Omit = omit,
11621161
coordinates: Iterable[float] | Omit = omit,
11631162
hold_keys: SequenceNotStr[str] | Omit = omit,
@@ -1174,7 +1173,7 @@ async def computer(
11741173
Execute computer actions like mouse movements, clicks, keyboard input, and more
11751174
11761175
Args:
1177-
button: Mouse button to click
1176+
button: Mouse button to click. Defaults to 'left'
11781177
11791178
click_type: Type of click (down, up, or click). Defaults to 'click'
11801179
@@ -1435,9 +1434,8 @@ async def computer(
14351434

14361435
@required_args(
14371436
["action", "coordinates"],
1438-
["action", "button"],
1439-
["action", "path"],
14401437
["action"],
1438+
["action", "path"],
14411439
["action", "keys"],
14421440
["action", "text"],
14431441
["action", "duration"],

src/steel/types/session.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,27 @@ class Session(BaseModel):
154154
"""The ID of the profile associated with the session"""
155155

156156
region: Optional[
157-
Literal["us-east", "us-west", "us-central", "eu-west", "eu-central", "ap-northeast", "ap-southeast", "sa-east"]
157+
Literal[
158+
"lax",
159+
"ord",
160+
"iad",
161+
"scl",
162+
"fra",
163+
"nrt",
164+
"us-east",
165+
"us-west",
166+
"us-central",
167+
"eu-west",
168+
"eu-central",
169+
"ap-northeast",
170+
"ap-southeast",
171+
"sa-east",
172+
]
158173
] = None
159-
"""The region where the session was created"""
174+
"""The region where the session was created.
175+
176+
Fly sessions return airport codes; multi-provider sessions return meta-regions.
177+
"""
160178

161179
solve_captcha: Optional[bool] = FieldInfo(alias="solveCaptcha", default=None)
162180
"""Indicates if captcha solving is enabled"""

src/steel/types/session_computer_params.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ class Variant0(TypedDict, total=False):
3737
class Variant1(TypedDict, total=False):
3838
action: Required[Literal["click_mouse"]]
3939

40-
button: Required[Literal["left", "right", "middle", "back", "forward"]]
41-
"""Mouse button to click"""
40+
button: Literal["left", "right", "middle", "back", "forward"]
41+
"""Mouse button to click. Defaults to 'left'"""
4242

4343
click_type: Literal["down", "up", "click"]
4444
"""Type of click (down, up, or click). Defaults to 'click'"""

src/steel/types/sessionslist.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,27 @@ class Session(BaseModel):
162162
"""The ID of the profile associated with the session"""
163163

164164
region: Optional[
165-
Literal["us-east", "us-west", "us-central", "eu-west", "eu-central", "ap-northeast", "ap-southeast", "sa-east"]
165+
Literal[
166+
"lax",
167+
"ord",
168+
"iad",
169+
"scl",
170+
"fra",
171+
"nrt",
172+
"us-east",
173+
"us-west",
174+
"us-central",
175+
"eu-west",
176+
"eu-central",
177+
"ap-northeast",
178+
"ap-southeast",
179+
"sa-east",
180+
]
166181
] = None
167-
"""The region where the session was created"""
182+
"""The region where the session was created.
183+
184+
Fly sessions return airport codes; multi-provider sessions return meta-regions.
185+
"""
168186

169187
solve_captcha: Optional[bool] = FieldInfo(alias="solveCaptcha", default=None)
170188
"""Indicates if captcha solving is enabled"""

tests/api_resources/test_sessions.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,6 @@ def test_method_computer_overload_2(self, client: Steel) -> None:
287287
session = client.sessions.computer(
288288
session_id="sessionId",
289289
action="click_mouse",
290-
button="left",
291290
)
292291
assert_matches_type(SessionComputerResponse, session, path=["response"])
293292

@@ -310,7 +309,6 @@ def test_raw_response_computer_overload_2(self, client: Steel) -> None:
310309
response = client.sessions.with_raw_response.computer(
311310
session_id="sessionId",
312311
action="click_mouse",
313-
button="left",
314312
)
315313

316314
assert response.is_closed is True
@@ -323,7 +321,6 @@ def test_streaming_response_computer_overload_2(self, client: Steel) -> None:
323321
with client.sessions.with_streaming_response.computer(
324322
session_id="sessionId",
325323
action="click_mouse",
326-
button="left",
327324
) as response:
328325
assert not response.is_closed
329326
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -339,7 +336,6 @@ def test_path_params_computer_overload_2(self, client: Steel) -> None:
339336
client.sessions.with_raw_response.computer(
340337
session_id="",
341338
action="click_mouse",
342-
button="left",
343339
)
344340

345341
@parametrize
@@ -1160,7 +1156,6 @@ async def test_method_computer_overload_2(self, async_client: AsyncSteel) -> Non
11601156
session = await async_client.sessions.computer(
11611157
session_id="sessionId",
11621158
action="click_mouse",
1163-
button="left",
11641159
)
11651160
assert_matches_type(SessionComputerResponse, session, path=["response"])
11661161

@@ -1183,7 +1178,6 @@ async def test_raw_response_computer_overload_2(self, async_client: AsyncSteel)
11831178
response = await async_client.sessions.with_raw_response.computer(
11841179
session_id="sessionId",
11851180
action="click_mouse",
1186-
button="left",
11871181
)
11881182

11891183
assert response.is_closed is True
@@ -1196,7 +1190,6 @@ async def test_streaming_response_computer_overload_2(self, async_client: AsyncS
11961190
async with async_client.sessions.with_streaming_response.computer(
11971191
session_id="sessionId",
11981192
action="click_mouse",
1199-
button="left",
12001193
) as response:
12011194
assert not response.is_closed
12021195
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -1212,7 +1205,6 @@ async def test_path_params_computer_overload_2(self, async_client: AsyncSteel) -
12121205
await async_client.sessions.with_raw_response.computer(
12131206
session_id="",
12141207
action="click_mouse",
1215-
button="left",
12161208
)
12171209

12181210
@parametrize

0 commit comments

Comments
 (0)