Skip to content

Commit c1b2314

Browse files
feat(api): api update
1 parent 88fd0c8 commit c1b2314

30 files changed

Lines changed: 1256 additions & 265 deletions

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 17
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/nen-labs%2Fsteel-df307c8d4d17c23d37054bf05f4d0a154be8011730c73ef8b3cfc987bcbdc05e.yml
3-
openapi_spec_hash: f3227dde2385091c20c58a17621286c7
4-
config_hash: f23d5011c9a89d67725b48e96ffb7c99
1+
configured_endpoints: 20
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/nen-labs%2Fsteel-c30148e5d3a9b19312ab7c9860fac5dc5c4d773b1032fa8ce345e6386c04c945.yml
3+
openapi_spec_hash: ca45bef50c34ba9f4affa7549b2b915a
4+
config_hash: 11ef724c8b75ae9d9b95fbb80ac7267b

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,13 @@ from steel import Steel
154154
client = Steel()
155155

156156
session = client.sessions.create(
157-
dimensions={
158-
"height": 0,
159-
"width": 0,
157+
credentials={
158+
"auto_submit": True,
159+
"blur_fields": True,
160+
"exact_origin": True,
160161
},
161162
)
162-
print(session.dimensions)
163+
print(session.credentials)
163164
```
164165

165166
## Handling errors

api.md

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,42 +16,56 @@ Methods:
1616

1717
Types:
1818

19+
```python
20+
from steel.types import SessionEventsResponse, SessionLiveDetailsResponse, SessionReleaseResponse
21+
```
22+
23+
Methods:
24+
25+
- <code title="post /v1/sessions">client.sessions.<a href="./src/steel/resources/sessions.py">create</a>(\*\*<a href="src/steel/types/session_create_params.py">params</a>) -> <a href="./src/steel/types/session.py">Session</a></code>
26+
- <code title="get /v1/sessions/{id}">client.sessions.<a href="./src/steel/resources/sessions.py">retrieve</a>(id) -> <a href="./src/steel/types/session.py">Session</a></code>
27+
- <code title="get /v1/sessions">client.sessions.<a href="./src/steel/resources/sessions.py">list</a>(\*\*<a href="src/steel/types/session_list_params.py">params</a>) -> SyncSessionsCursor[Session]</code>
28+
- <code title="get /v1/sessions/{id}/context">client.sessions.<a href="./src/steel/resources/sessions.py">context</a>(id) -> <a href="./src/steel/types/session_context.py">SessionContext</a></code>
29+
- <code title="get /v1/sessions/{id}/events">client.sessions.<a href="./src/steel/resources/sessions.py">events</a>(id) -> <a href="./src/steel/types/session_events_response.py">SessionEventsResponse</a></code>
30+
- <code title="get /v1/sessions/{id}/live-details">client.sessions.<a href="./src/steel/resources/sessions.py">live_details</a>(id) -> <a href="./src/steel/types/session_live_details_response.py">SessionLiveDetailsResponse</a></code>
31+
- <code title="post /v1/sessions/{id}/release">client.sessions.<a href="./src/steel/resources/sessions.py">release</a>(id) -> <a href="./src/steel/types/session_release_response.py">SessionReleaseResponse</a></code>
32+
33+
# Credentials
34+
35+
Types:
36+
1937
```python
2038
from steel.types import (
2139
Session,
2240
SessionContext,
2341
Sessionslist,
24-
SessionEventsResponse,
25-
SessionLiveDetailsResponse,
26-
SessionReleaseResponse,
27-
SessionReleaseAllResponse,
42+
CredentialCreateResponse,
43+
CredentialUpdateResponse,
44+
CredentialListResponse,
45+
CredentialDeleteResponse,
2846
)
2947
```
3048

3149
Methods:
3250

33-
- <code title="post /v1/sessions">client.sessions.<a href="./src/steel/resources/sessions/sessions.py">create</a>(\*\*<a href="src/steel/types/session_create_params.py">params</a>) -> <a href="./src/steel/types/session.py">Session</a></code>
34-
- <code title="get /v1/sessions/{id}">client.sessions.<a href="./src/steel/resources/sessions/sessions.py">retrieve</a>(id) -> <a href="./src/steel/types/session.py">Session</a></code>
35-
- <code title="get /v1/sessions">client.sessions.<a href="./src/steel/resources/sessions/sessions.py">list</a>(\*\*<a href="src/steel/types/session_list_params.py">params</a>) -> SyncSessionsCursor[Session]</code>
36-
- <code title="get /v1/sessions/{id}/context">client.sessions.<a href="./src/steel/resources/sessions/sessions.py">context</a>(id) -> <a href="./src/steel/types/session_context.py">SessionContext</a></code>
37-
- <code title="get /v1/sessions/{id}/events">client.sessions.<a href="./src/steel/resources/sessions/sessions.py">events</a>(id) -> <a href="./src/steel/types/session_events_response.py">SessionEventsResponse</a></code>
38-
- <code title="get /v1/sessions/{id}/live-details">client.sessions.<a href="./src/steel/resources/sessions/sessions.py">live_details</a>(id) -> <a href="./src/steel/types/session_live_details_response.py">SessionLiveDetailsResponse</a></code>
39-
- <code title="post /v1/sessions/{id}/release">client.sessions.<a href="./src/steel/resources/sessions/sessions.py">release</a>(id) -> <a href="./src/steel/types/session_release_response.py">SessionReleaseResponse</a></code>
40-
- <code title="post /v1/sessions/release">client.sessions.<a href="./src/steel/resources/sessions/sessions.py">release_all</a>() -> <a href="./src/steel/types/session_release_all_response.py">SessionReleaseAllResponse</a></code>
51+
- <code title="post /v1/credentials">client.credentials.<a href="./src/steel/resources/credentials/credentials.py">create</a>(\*\*<a href="src/steel/types/credential_create_params.py">params</a>) -> <a href="./src/steel/types/credential_create_response.py">CredentialCreateResponse</a></code>
52+
- <code title="put /v1/credentials">client.credentials.<a href="./src/steel/resources/credentials/credentials.py">update</a>(\*\*<a href="src/steel/types/credential_update_params.py">params</a>) -> <a href="./src/steel/types/credential_update_response.py">CredentialUpdateResponse</a></code>
53+
- <code title="get /v1/credentials">client.credentials.<a href="./src/steel/resources/credentials/credentials.py">list</a>(\*\*<a href="src/steel/types/credential_list_params.py">params</a>) -> <a href="./src/steel/types/credential_list_response.py">CredentialListResponse</a></code>
54+
- <code title="delete /v1/credentials">client.credentials.<a href="./src/steel/resources/credentials/credentials.py">delete</a>(\*\*<a href="src/steel/types/credential_delete_params.py">params</a>) -> <a href="./src/steel/types/credential_delete_response.py">CredentialDeleteResponse</a></code>
4155

4256
## Files
4357

4458
Types:
4559

4660
```python
47-
from steel.types.sessions import File, Fileslist, FileDeleteResponse, FileDeleteAllResponse
61+
from steel.types.credentials import File, Fileslist, FileDeleteResponse, FileDeleteAllResponse
4862
```
4963

5064
Methods:
5165

52-
- <code title="get /v1/sessions/{sessionId}/files/{fileId}">client.sessions.files.<a href="./src/steel/resources/sessions/files.py">retrieve</a>(file_id, \*, session_id) -> <a href="./src/steel/types/sessions/file.py">File</a></code>
53-
- <code title="get /v1/sessions/{sessionId}/files">client.sessions.files.<a href="./src/steel/resources/sessions/files.py">list</a>(session_id) -> <a href="./src/steel/types/sessions/fileslist.py">Fileslist</a></code>
54-
- <code title="delete /v1/sessions/{sessionId}/files/{fileId}">client.sessions.files.<a href="./src/steel/resources/sessions/files.py">delete</a>(file_id, \*, session_id) -> <a href="./src/steel/types/sessions/file_delete_response.py">FileDeleteResponse</a></code>
55-
- <code title="delete /v1/sessions/{sessionId}/files">client.sessions.files.<a href="./src/steel/resources/sessions/files.py">delete_all</a>(session_id) -> <a href="./src/steel/types/sessions/file_delete_all_response.py">FileDeleteAllResponse</a></code>
56-
- <code title="get /v1/sessions/{sessionId}/files/{fileId}/download">client.sessions.files.<a href="./src/steel/resources/sessions/files.py">download</a>(file_id, \*, session_id) -> BinaryAPIResponse</code>
57-
- <code title="post /v1/sessions/{sessionId}/files">client.sessions.files.<a href="./src/steel/resources/sessions/files.py">upload</a>(session_id, \*\*<a href="src/steel/types/sessions/file_upload_params.py">params</a>) -> <a href="./src/steel/types/sessions/file.py">File</a></code>
66+
- <code title="get /v1/sessions/{sessionId}/files/{fileId}">client.credentials.files.<a href="./src/steel/resources/credentials/files.py">retrieve</a>(file_id, \*, session_id) -> <a href="./src/steel/types/credentials/file.py">File</a></code>
67+
- <code title="get /v1/sessions/{sessionId}/files">client.credentials.files.<a href="./src/steel/resources/credentials/files.py">list</a>(session_id) -> <a href="./src/steel/types/credentials/fileslist.py">Fileslist</a></code>
68+
- <code title="delete /v1/sessions/{sessionId}/files/{fileId}">client.credentials.files.<a href="./src/steel/resources/credentials/files.py">delete</a>(file_id, \*, session_id) -> <a href="./src/steel/types/credentials/file_delete_response.py">FileDeleteResponse</a></code>
69+
- <code title="delete /v1/sessions/{sessionId}/files">client.credentials.files.<a href="./src/steel/resources/credentials/files.py">delete_all</a>(session_id) -> <a href="./src/steel/types/credentials/file_delete_all_response.py">FileDeleteAllResponse</a></code>
70+
- <code title="get /v1/sessions/{sessionId}/files/{fileId}/download">client.credentials.files.<a href="./src/steel/resources/credentials/files.py">download</a>(file_id, \*, session_id) -> BinaryAPIResponse</code>
71+
- <code title="post /v1/sessions/{sessionId}/files">client.credentials.files.<a href="./src/steel/resources/credentials/files.py">upload</a>(session_id, \*\*<a href="src/steel/types/credentials/file_upload_params.py">params</a>) -> <a href="./src/steel/types/credentials/file.py">File</a></code>

src/steel/_client.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
async_to_raw_response_wrapper,
3737
async_to_streamed_response_wrapper,
3838
)
39+
from .resources import sessions
3940
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
4041
from ._exceptions import SteelError, APIStatusError
4142
from ._base_client import (
@@ -44,8 +45,8 @@
4445
AsyncAPIClient,
4546
make_request_options,
4647
)
47-
from .resources.sessions import sessions
4848
from .types.pdf_response import PdfResponse
49+
from .resources.credentials import credentials
4950
from .types.scrape_response import ScrapeResponse
5051
from .types.screenshot_response import ScreenshotResponse
5152

@@ -54,6 +55,7 @@
5455

5556
class Steel(SyncAPIClient):
5657
sessions: sessions.SessionsResource
58+
credentials: credentials.CredentialsResource
5759
with_raw_response: SteelWithRawResponse
5860
with_streaming_response: SteelWithStreamedResponse
5961

@@ -112,6 +114,7 @@ def __init__(
112114
)
113115

114116
self.sessions = sessions.SessionsResource(self)
117+
self.credentials = credentials.CredentialsResource(self)
115118
self.with_raw_response = SteelWithRawResponse(self)
116119
self.with_streaming_response = SteelWithStreamedResponse(self)
117120

@@ -379,6 +382,7 @@ def _make_status_error(
379382

380383
class AsyncSteel(AsyncAPIClient):
381384
sessions: sessions.AsyncSessionsResource
385+
credentials: credentials.AsyncCredentialsResource
382386
with_raw_response: AsyncSteelWithRawResponse
383387
with_streaming_response: AsyncSteelWithStreamedResponse
384388

@@ -437,6 +441,7 @@ def __init__(
437441
)
438442

439443
self.sessions = sessions.AsyncSessionsResource(self)
444+
self.credentials = credentials.AsyncCredentialsResource(self)
440445
self.with_raw_response = AsyncSteelWithRawResponse(self)
441446
self.with_streaming_response = AsyncSteelWithStreamedResponse(self)
442447

@@ -705,6 +710,7 @@ def _make_status_error(
705710
class SteelWithRawResponse:
706711
def __init__(self, client: Steel) -> None:
707712
self.sessions = sessions.SessionsResourceWithRawResponse(client.sessions)
713+
self.credentials = credentials.CredentialsResourceWithRawResponse(client.credentials)
708714

709715
self.pdf = to_raw_response_wrapper(
710716
client.pdf,
@@ -720,6 +726,7 @@ def __init__(self, client: Steel) -> None:
720726
class AsyncSteelWithRawResponse:
721727
def __init__(self, client: AsyncSteel) -> None:
722728
self.sessions = sessions.AsyncSessionsResourceWithRawResponse(client.sessions)
729+
self.credentials = credentials.AsyncCredentialsResourceWithRawResponse(client.credentials)
723730

724731
self.pdf = async_to_raw_response_wrapper(
725732
client.pdf,
@@ -735,6 +742,7 @@ def __init__(self, client: AsyncSteel) -> None:
735742
class SteelWithStreamedResponse:
736743
def __init__(self, client: Steel) -> None:
737744
self.sessions = sessions.SessionsResourceWithStreamingResponse(client.sessions)
745+
self.credentials = credentials.CredentialsResourceWithStreamingResponse(client.credentials)
738746

739747
self.pdf = to_streamed_response_wrapper(
740748
client.pdf,
@@ -750,6 +758,7 @@ def __init__(self, client: Steel) -> None:
750758
class AsyncSteelWithStreamedResponse:
751759
def __init__(self, client: AsyncSteel) -> None:
752760
self.sessions = sessions.AsyncSessionsResourceWithStreamingResponse(client.sessions)
761+
self.credentials = credentials.AsyncCredentialsResourceWithStreamingResponse(client.credentials)
753762

754763
self.pdf = async_to_streamed_response_wrapper(
755764
client.pdf,

src/steel/resources/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88
SessionsResourceWithStreamingResponse,
99
AsyncSessionsResourceWithStreamingResponse,
1010
)
11+
from .credentials import (
12+
CredentialsResource,
13+
AsyncCredentialsResource,
14+
CredentialsResourceWithRawResponse,
15+
AsyncCredentialsResourceWithRawResponse,
16+
CredentialsResourceWithStreamingResponse,
17+
AsyncCredentialsResourceWithStreamingResponse,
18+
)
1119

1220
__all__ = [
1321
"SessionsResource",
@@ -16,4 +24,10 @@
1624
"AsyncSessionsResourceWithRawResponse",
1725
"SessionsResourceWithStreamingResponse",
1826
"AsyncSessionsResourceWithStreamingResponse",
27+
"CredentialsResource",
28+
"AsyncCredentialsResource",
29+
"CredentialsResourceWithRawResponse",
30+
"AsyncCredentialsResourceWithRawResponse",
31+
"CredentialsResourceWithStreamingResponse",
32+
"AsyncCredentialsResourceWithStreamingResponse",
1933
]

src/steel/resources/sessions/__init__.py renamed to src/steel/resources/credentials/__init__.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
FilesResourceWithStreamingResponse,
99
AsyncFilesResourceWithStreamingResponse,
1010
)
11-
from .sessions import (
12-
SessionsResource,
13-
AsyncSessionsResource,
14-
SessionsResourceWithRawResponse,
15-
AsyncSessionsResourceWithRawResponse,
16-
SessionsResourceWithStreamingResponse,
17-
AsyncSessionsResourceWithStreamingResponse,
11+
from .credentials import (
12+
CredentialsResource,
13+
AsyncCredentialsResource,
14+
CredentialsResourceWithRawResponse,
15+
AsyncCredentialsResourceWithRawResponse,
16+
CredentialsResourceWithStreamingResponse,
17+
AsyncCredentialsResourceWithStreamingResponse,
1818
)
1919

2020
__all__ = [
@@ -24,10 +24,10 @@
2424
"AsyncFilesResourceWithRawResponse",
2525
"FilesResourceWithStreamingResponse",
2626
"AsyncFilesResourceWithStreamingResponse",
27-
"SessionsResource",
28-
"AsyncSessionsResource",
29-
"SessionsResourceWithRawResponse",
30-
"AsyncSessionsResourceWithRawResponse",
31-
"SessionsResourceWithStreamingResponse",
32-
"AsyncSessionsResourceWithStreamingResponse",
27+
"CredentialsResource",
28+
"AsyncCredentialsResource",
29+
"CredentialsResourceWithRawResponse",
30+
"AsyncCredentialsResourceWithRawResponse",
31+
"CredentialsResourceWithStreamingResponse",
32+
"AsyncCredentialsResourceWithStreamingResponse",
3333
]

0 commit comments

Comments
 (0)