Skip to content

Commit b4fae02

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

16 files changed

Lines changed: 178 additions & 179 deletions

File tree

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 20
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/nen-labs%2Fsteel-c30148e5d3a9b19312ab7c9860fac5dc5c4d773b1032fa8ce345e6386c04c945.yml
33
openapi_spec_hash: ca45bef50c34ba9f4affa7549b2b915a
4-
config_hash: 11ef724c8b75ae9d9b95fbb80ac7267b
4+
config_hash: eceac094e0c141de74f2ed1fa1a9857c

api.md

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,27 @@ Methods:
1212
- <code title="post /v1/scrape">client.<a href="./src/steel/_client.py">scrape</a>(\*\*<a href="src/steel/types/client_scrape_params.py">params</a>) -> <a href="./src/steel/types/scrape_response.py">ScrapeResponse</a></code>
1313
- <code title="post /v1/screenshot">client.<a href="./src/steel/_client.py">screenshot</a>(\*\*<a href="src/steel/types/client_screenshot_params.py">params</a>) -> <a href="./src/steel/types/screenshot_response.py">ScreenshotResponse</a></code>
1414

15-
# Sessions
15+
# Credentials
1616

1717
Types:
1818

1919
```python
20-
from steel.types import SessionEventsResponse, SessionLiveDetailsResponse, SessionReleaseResponse
20+
from steel.types import (
21+
CredentialCreateResponse,
22+
CredentialUpdateResponse,
23+
CredentialListResponse,
24+
CredentialDeleteResponse,
25+
)
2126
```
2227

2328
Methods:
2429

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>
30+
- <code title="post /v1/credentials">client.credentials.<a href="./src/steel/resources/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>
31+
- <code title="put /v1/credentials">client.credentials.<a href="./src/steel/resources/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>
32+
- <code title="get /v1/credentials">client.credentials.<a href="./src/steel/resources/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>
33+
- <code title="delete /v1/credentials">client.credentials.<a href="./src/steel/resources/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>
3234

33-
# Credentials
35+
# Sessions
3436

3537
Types:
3638

@@ -39,33 +41,35 @@ from steel.types import (
3941
Session,
4042
SessionContext,
4143
Sessionslist,
42-
CredentialCreateResponse,
43-
CredentialUpdateResponse,
44-
CredentialListResponse,
45-
CredentialDeleteResponse,
44+
SessionEventsResponse,
45+
SessionLiveDetailsResponse,
46+
SessionReleaseResponse,
4647
)
4748
```
4849

4950
Methods:
5051

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>
52+
- <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>
53+
- <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>
54+
- <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>
55+
- <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>
56+
- <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>
57+
- <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>
58+
- <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>
5559

5660
## Files
5761

5862
Types:
5963

6064
```python
61-
from steel.types.credentials import File, Fileslist, FileDeleteResponse, FileDeleteAllResponse
65+
from steel.types.sessions import File, Fileslist, FileDeleteResponse, FileDeleteAllResponse
6266
```
6367

6468
Methods:
6569

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>
70+
- <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>
71+
- <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>
72+
- <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>
73+
- <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>
74+
- <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>
75+
- <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>

src/steel/_client.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
async_to_raw_response_wrapper,
3737
async_to_streamed_response_wrapper,
3838
)
39-
from .resources import sessions
39+
from .resources import credentials
4040
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
4141
from ._exceptions import SteelError, APIStatusError
4242
from ._base_client import (
@@ -45,17 +45,17 @@
4545
AsyncAPIClient,
4646
make_request_options,
4747
)
48+
from .resources.sessions import sessions
4849
from .types.pdf_response import PdfResponse
49-
from .resources.credentials import credentials
5050
from .types.scrape_response import ScrapeResponse
5151
from .types.screenshot_response import ScreenshotResponse
5252

5353
__all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "Steel", "AsyncSteel", "Client", "AsyncClient"]
5454

5555

5656
class Steel(SyncAPIClient):
57-
sessions: sessions.SessionsResource
5857
credentials: credentials.CredentialsResource
58+
sessions: sessions.SessionsResource
5959
with_raw_response: SteelWithRawResponse
6060
with_streaming_response: SteelWithStreamedResponse
6161

@@ -113,8 +113,8 @@ def __init__(
113113
_strict_response_validation=_strict_response_validation,
114114
)
115115

116-
self.sessions = sessions.SessionsResource(self)
117116
self.credentials = credentials.CredentialsResource(self)
117+
self.sessions = sessions.SessionsResource(self)
118118
self.with_raw_response = SteelWithRawResponse(self)
119119
self.with_streaming_response = SteelWithStreamedResponse(self)
120120

@@ -381,8 +381,8 @@ def _make_status_error(
381381

382382

383383
class AsyncSteel(AsyncAPIClient):
384-
sessions: sessions.AsyncSessionsResource
385384
credentials: credentials.AsyncCredentialsResource
385+
sessions: sessions.AsyncSessionsResource
386386
with_raw_response: AsyncSteelWithRawResponse
387387
with_streaming_response: AsyncSteelWithStreamedResponse
388388

@@ -440,8 +440,8 @@ def __init__(
440440
_strict_response_validation=_strict_response_validation,
441441
)
442442

443-
self.sessions = sessions.AsyncSessionsResource(self)
444443
self.credentials = credentials.AsyncCredentialsResource(self)
444+
self.sessions = sessions.AsyncSessionsResource(self)
445445
self.with_raw_response = AsyncSteelWithRawResponse(self)
446446
self.with_streaming_response = AsyncSteelWithStreamedResponse(self)
447447

@@ -709,8 +709,8 @@ def _make_status_error(
709709

710710
class SteelWithRawResponse:
711711
def __init__(self, client: Steel) -> None:
712-
self.sessions = sessions.SessionsResourceWithRawResponse(client.sessions)
713712
self.credentials = credentials.CredentialsResourceWithRawResponse(client.credentials)
713+
self.sessions = sessions.SessionsResourceWithRawResponse(client.sessions)
714714

715715
self.pdf = to_raw_response_wrapper(
716716
client.pdf,
@@ -725,8 +725,8 @@ def __init__(self, client: Steel) -> None:
725725

726726
class AsyncSteelWithRawResponse:
727727
def __init__(self, client: AsyncSteel) -> None:
728-
self.sessions = sessions.AsyncSessionsResourceWithRawResponse(client.sessions)
729728
self.credentials = credentials.AsyncCredentialsResourceWithRawResponse(client.credentials)
729+
self.sessions = sessions.AsyncSessionsResourceWithRawResponse(client.sessions)
730730

731731
self.pdf = async_to_raw_response_wrapper(
732732
client.pdf,
@@ -741,8 +741,8 @@ def __init__(self, client: AsyncSteel) -> None:
741741

742742
class SteelWithStreamedResponse:
743743
def __init__(self, client: Steel) -> None:
744-
self.sessions = sessions.SessionsResourceWithStreamingResponse(client.sessions)
745744
self.credentials = credentials.CredentialsResourceWithStreamingResponse(client.credentials)
745+
self.sessions = sessions.SessionsResourceWithStreamingResponse(client.sessions)
746746

747747
self.pdf = to_streamed_response_wrapper(
748748
client.pdf,
@@ -757,8 +757,8 @@ def __init__(self, client: Steel) -> None:
757757

758758
class AsyncSteelWithStreamedResponse:
759759
def __init__(self, client: AsyncSteel) -> None:
760-
self.sessions = sessions.AsyncSessionsResourceWithStreamingResponse(client.sessions)
761760
self.credentials = credentials.AsyncCredentialsResourceWithStreamingResponse(client.credentials)
761+
self.sessions = sessions.AsyncSessionsResourceWithStreamingResponse(client.sessions)
762762

763763
self.pdf = async_to_streamed_response_wrapper(
764764
client.pdf,

src/steel/resources/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@
1818
)
1919

2020
__all__ = [
21-
"SessionsResource",
22-
"AsyncSessionsResource",
23-
"SessionsResourceWithRawResponse",
24-
"AsyncSessionsResourceWithRawResponse",
25-
"SessionsResourceWithStreamingResponse",
26-
"AsyncSessionsResourceWithStreamingResponse",
2721
"CredentialsResource",
2822
"AsyncCredentialsResource",
2923
"CredentialsResourceWithRawResponse",
3024
"AsyncCredentialsResourceWithRawResponse",
3125
"CredentialsResourceWithStreamingResponse",
3226
"AsyncCredentialsResourceWithStreamingResponse",
27+
"SessionsResource",
28+
"AsyncSessionsResource",
29+
"SessionsResourceWithRawResponse",
30+
"AsyncSessionsResourceWithRawResponse",
31+
"SessionsResourceWithStreamingResponse",
32+
"AsyncSessionsResourceWithStreamingResponse",
3333
]

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

Lines changed: 11 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -6,44 +6,27 @@
66

77
import httpx
88

9-
from .files import (
10-
FilesResource,
11-
AsyncFilesResource,
12-
FilesResourceWithRawResponse,
13-
AsyncFilesResourceWithRawResponse,
14-
FilesResourceWithStreamingResponse,
15-
AsyncFilesResourceWithStreamingResponse,
16-
)
17-
from ...types import (
18-
credential_list_params,
19-
credential_create_params,
20-
credential_delete_params,
21-
credential_update_params,
22-
)
23-
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
24-
from ..._utils import maybe_transform, async_maybe_transform
25-
from ..._compat import cached_property
26-
from ..._resource import SyncAPIResource, AsyncAPIResource
27-
from ..._response import (
9+
from ..types import credential_list_params, credential_create_params, credential_delete_params, credential_update_params
10+
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
11+
from .._utils import maybe_transform, async_maybe_transform
12+
from .._compat import cached_property
13+
from .._resource import SyncAPIResource, AsyncAPIResource
14+
from .._response import (
2815
to_raw_response_wrapper,
2916
to_streamed_response_wrapper,
3017
async_to_raw_response_wrapper,
3118
async_to_streamed_response_wrapper,
3219
)
33-
from ..._base_client import make_request_options
34-
from ...types.credential_list_response import CredentialListResponse
35-
from ...types.credential_create_response import CredentialCreateResponse
36-
from ...types.credential_delete_response import CredentialDeleteResponse
37-
from ...types.credential_update_response import CredentialUpdateResponse
20+
from .._base_client import make_request_options
21+
from ..types.credential_list_response import CredentialListResponse
22+
from ..types.credential_create_response import CredentialCreateResponse
23+
from ..types.credential_delete_response import CredentialDeleteResponse
24+
from ..types.credential_update_response import CredentialUpdateResponse
3825

3926
__all__ = ["CredentialsResource", "AsyncCredentialsResource"]
4027

4128

4229
class CredentialsResource(SyncAPIResource):
43-
@cached_property
44-
def files(self) -> FilesResource:
45-
return FilesResource(self._client)
46-
4730
@cached_property
4831
def with_raw_response(self) -> CredentialsResourceWithRawResponse:
4932
"""
@@ -256,10 +239,6 @@ def delete(
256239

257240

258241
class AsyncCredentialsResource(AsyncAPIResource):
259-
@cached_property
260-
def files(self) -> AsyncFilesResource:
261-
return AsyncFilesResource(self._client)
262-
263242
@cached_property
264243
def with_raw_response(self) -> AsyncCredentialsResourceWithRawResponse:
265244
"""
@@ -488,10 +467,6 @@ def __init__(self, credentials: CredentialsResource) -> None:
488467
credentials.delete,
489468
)
490469

491-
@cached_property
492-
def files(self) -> FilesResourceWithRawResponse:
493-
return FilesResourceWithRawResponse(self._credentials.files)
494-
495470

496471
class AsyncCredentialsResourceWithRawResponse:
497472
def __init__(self, credentials: AsyncCredentialsResource) -> None:
@@ -510,10 +485,6 @@ def __init__(self, credentials: AsyncCredentialsResource) -> None:
510485
credentials.delete,
511486
)
512487

513-
@cached_property
514-
def files(self) -> AsyncFilesResourceWithRawResponse:
515-
return AsyncFilesResourceWithRawResponse(self._credentials.files)
516-
517488

518489
class CredentialsResourceWithStreamingResponse:
519490
def __init__(self, credentials: CredentialsResource) -> None:
@@ -532,10 +503,6 @@ def __init__(self, credentials: CredentialsResource) -> None:
532503
credentials.delete,
533504
)
534505

535-
@cached_property
536-
def files(self) -> FilesResourceWithStreamingResponse:
537-
return FilesResourceWithStreamingResponse(self._credentials.files)
538-
539506

540507
class AsyncCredentialsResourceWithStreamingResponse:
541508
def __init__(self, credentials: AsyncCredentialsResource) -> None:
@@ -553,7 +520,3 @@ def __init__(self, credentials: AsyncCredentialsResource) -> None:
553520
self.delete = async_to_streamed_response_wrapper(
554521
credentials.delete,
555522
)
556-
557-
@cached_property
558-
def files(self) -> AsyncFilesResourceWithStreamingResponse:
559-
return AsyncFilesResourceWithStreamingResponse(self._credentials.files)

0 commit comments

Comments
 (0)