Skip to content

Commit fe835f4

Browse files
feat(api): OpenAPI spec update via Stainless API (#120)
1 parent a3c1c62 commit fe835f4

19 files changed

Lines changed: 35 additions & 1354 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 36
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ea589851f2dbba35fea6c010ac4c577cad56aa44e1d5bd4e5b472c802b2f13c4.yml
1+
configured_endpoints: 24
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2085d09cb7954db9bd300c0d93f1f08e25b69906011c0d65e899951880372ef1.yml

api.md

Lines changed: 12 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -43,36 +43,16 @@ Types:
4343
from runloop_api_client.types import CodeMountParameters
4444
```
4545

46-
# Deployments
47-
48-
Types:
49-
50-
```python
51-
from runloop_api_client.types import (
52-
DeploymentRetrieveResponse,
53-
DeploymentGetResponse,
54-
DeploymentLogsResponse,
55-
DeploymentRedeployResponse,
56-
DeploymentTailResponse,
57-
)
58-
```
59-
60-
Methods:
61-
62-
- <code title="get /v1/deployments/{deployment_id}">client.deployments.<a href="./src/runloop_api_client/resources/deployments.py">retrieve</a>(deployment_id) -> <a href="./src/runloop_api_client/types/deployment_retrieve_response.py">DeploymentRetrieveResponse</a></code>
63-
- <code title="get /v1/deployments">client.deployments.<a href="./src/runloop_api_client/resources/deployments.py">get</a>(\*\*<a href="src/runloop_api_client/types/deployment_get_params.py">params</a>) -> <a href="./src/runloop_api_client/types/deployment_get_response.py">DeploymentGetResponse</a></code>
64-
- <code title="get /v1/deployments/{deployment_id}/logs">client.deployments.<a href="./src/runloop_api_client/resources/deployments.py">logs</a>(deployment_id) -> <a href="./src/runloop_api_client/types/deployment_logs_response.py">DeploymentLogsResponse</a></code>
65-
- <code title="post /v1/deployments/{deployment_id}/redeploy">client.deployments.<a href="./src/runloop_api_client/resources/deployments.py">redeploy</a>(deployment_id) -> <a href="./src/runloop_api_client/types/deployment_redeploy_response.py">DeploymentRedeployResponse</a></code>
66-
- <code title="get /v1/deployments/{deployment_id}/logs/tail">client.deployments.<a href="./src/runloop_api_client/resources/deployments.py">tail</a>(deployment_id) -> <a href="./src/runloop_api_client/types/deployment_tail_response.py">DeploymentTailResponse</a></code>
67-
6846
# Devboxes
6947

7048
Types:
7149

7250
```python
7351
from runloop_api_client.types import (
52+
DevboxAsyncExecutionDetailView,
53+
DevboxExecutionDetailView,
54+
DevboxListView,
7455
DevboxView,
75-
DevboxListResponse,
7656
DevboxCreateSSHKeyResponse,
7757
DevboxReadFileContentsResponse,
7858
DevboxUploadFileResponse,
@@ -83,7 +63,7 @@ Methods:
8363

8464
- <code title="post /v1/devboxes">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">create</a>(\*\*<a href="src/runloop_api_client/types/devbox_create_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devbox_view.py">DevboxView</a></code>
8565
- <code title="get /v1/devboxes/{id}">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">retrieve</a>(id) -> <a href="./src/runloop_api_client/types/devbox_view.py">DevboxView</a></code>
86-
- <code title="get /v1/devboxes">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">list</a>(\*\*<a href="src/runloop_api_client/types/devbox_list_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devbox_list_response.py">DevboxListResponse</a></code>
66+
- <code title="get /v1/devboxes">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">list</a>(\*\*<a href="src/runloop_api_client/types/devbox_list_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devbox_list_view.py">DevboxListView</a></code>
8767
- <code title="post /v1/devboxes/{id}/create_ssh_key">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">create_ssh_key</a>(id) -> <a href="./src/runloop_api_client/types/devbox_create_ssh_key_response.py">DevboxCreateSSHKeyResponse</a></code>
8868
- <code title="post /v1/devboxes/{id}/executions/execute_async">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">execute_async</a>(id, \*\*<a href="src/runloop_api_client/types/devbox_execute_async_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devboxes/devbox_async_execution_detail_view.py">DevboxAsyncExecutionDetailView</a></code>
8969
- <code title="post /v1/devboxes/{id}/execute_sync">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">execute_sync</a>(id, \*\*<a href="src/runloop_api_client/types/devbox_execute_sync_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devboxes/devbox_execution_detail_view.py">DevboxExecutionDetailView</a></code>
@@ -94,10 +74,15 @@ Methods:
9474

9575
## Logs
9676

77+
Types:
78+
79+
```python
80+
from runloop_api_client.types.devboxes import DevboxLogsListView
81+
```
82+
9783
Methods:
9884

9985
- <code title="get /v1/devboxes/{id}/logs">client.devboxes.logs.<a href="./src/runloop_api_client/resources/devboxes/logs.py">list</a>(id) -> <a href="./src/runloop_api_client/types/devboxes/devbox_logs_list_view.py">DevboxLogsListView</a></code>
100-
- <code title="get /v1/devboxes/{id}/logs/tail">client.devboxes.logs.<a href="./src/runloop_api_client/resources/devboxes/logs.py">tail</a>(id) -> None</code>
10186

10287
## Executions
10388

@@ -113,46 +98,36 @@ from runloop_api_client.types.devboxes import (
11398

11499
Methods:
115100

116-
- <code title="post /v1/devboxes/{id}/executions/{exeId}">client.devboxes.executions.<a href="./src/runloop_api_client/resources/devboxes/executions.py">retrieve</a>(exe_id, \*, id, \*\*<a href="src/runloop_api_client/types/devboxes/execution_retrieve_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devboxes/devbox_async_execution_detail_view.py">DevboxAsyncExecutionDetailView</a></code>
117101
- <code title="post /v1/devboxes/{id}/executions/execute_async">client.devboxes.executions.<a href="./src/runloop_api_client/resources/devboxes/executions.py">execute_async</a>(id, \*\*<a href="src/runloop_api_client/types/devboxes/execution_execute_async_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devboxes/devbox_async_execution_detail_view.py">DevboxAsyncExecutionDetailView</a></code>
118102
- <code title="post /v1/devboxes/{id}/execute_sync">client.devboxes.executions.<a href="./src/runloop_api_client/resources/devboxes/executions.py">execute_sync</a>(id, \*\*<a href="src/runloop_api_client/types/devboxes/execution_execute_sync_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devboxes/devbox_execution_detail_view.py">DevboxExecutionDetailView</a></code>
119-
- <code title="post /v1/devboxes/{id}/executions/{exeId}/kill">client.devboxes.executions.<a href="./src/runloop_api_client/resources/devboxes/executions.py">kill</a>(exe_id, \*, id) -> <a href="./src/runloop_api_client/types/devboxes/devbox_async_execution_detail_view.py">DevboxAsyncExecutionDetailView</a></code>
120-
- <code title="get /v1/devboxes/{id}/executions/{execution_id}/logs">client.devboxes.executions.<a href="./src/runloop_api_client/resources/devboxes/executions.py">logs</a>(execution_id, \*, id) -> <a href="./src/runloop_api_client/types/devboxes/devbox_logs_list_view.py">DevboxLogsListView</a></code>
121-
- <code title="get /v1/devboxes/{id}/executions/{execution_id}/logs/tail">client.devboxes.executions.<a href="./src/runloop_api_client/resources/devboxes/executions.py">tail</a>(execution_id, \*, id) -> None</code>
122103

123104
# Functions
124105

125106
Types:
126107

127108
```python
128-
from runloop_api_client.types import FunctionListView, FunctionListOpenAPIResponse
109+
from runloop_api_client.types import FunctionListView
129110
```
130111

131112
Methods:
132113

133114
- <code title="get /v1/functions">client.functions.<a href="./src/runloop_api_client/resources/functions/functions.py">list</a>() -> <a href="./src/runloop_api_client/types/function_list_view.py">FunctionListView</a></code>
134115
- <code title="post /v1/functions/{project_name}/{function_name}/invoke_async">client.functions.<a href="./src/runloop_api_client/resources/functions/functions.py">invoke_async</a>(function_name, \*, project_name, \*\*<a href="src/runloop_api_client/types/function_invoke_async_params.py">params</a>) -> <a href="./src/runloop_api_client/types/shared/function_invocation_execution_detail_view.py">FunctionInvocationExecutionDetailView</a></code>
135116
- <code title="post /v1/functions/{project_name}/{function_name}/invoke_sync">client.functions.<a href="./src/runloop_api_client/resources/functions/functions.py">invoke_sync</a>(function_name, \*, project_name, \*\*<a href="src/runloop_api_client/types/function_invoke_sync_params.py">params</a>) -> <a href="./src/runloop_api_client/types/shared/function_invocation_execution_detail_view.py">FunctionInvocationExecutionDetailView</a></code>
136-
- <code title="get /v1/functions/openapi">client.functions.<a href="./src/runloop_api_client/resources/functions/functions.py">list_openapi</a>() -> <a href="./src/runloop_api_client/types/function_list_openapi_response.py">object</a></code>
137117

138118
## Invocations
139119

140120
Types:
141121

142122
```python
143-
from runloop_api_client.types.functions import (
144-
FunctionInvocationListView,
145-
KillOperationResponse,
146-
InvocationLogsResponse,
147-
)
123+
from runloop_api_client.types.functions import FunctionInvocationListView, KillOperationResponse
148124
```
149125

150126
Methods:
151127

152128
- <code title="get /v1/functions/invocations/{invocationId}">client.functions.invocations.<a href="./src/runloop_api_client/resources/functions/invocations.py">retrieve</a>(invocation_id) -> <a href="./src/runloop_api_client/types/shared/function_invocation_execution_detail_view.py">FunctionInvocationExecutionDetailView</a></code>
153129
- <code title="get /v1/functions/invocations">client.functions.invocations.<a href="./src/runloop_api_client/resources/functions/invocations.py">list</a>(\*\*<a href="src/runloop_api_client/types/functions/invocation_list_params.py">params</a>) -> <a href="./src/runloop_api_client/types/functions/function_invocation_list_view.py">FunctionInvocationListView</a></code>
154130
- <code title="post /v1/functions/invocations/{invocationId}/kill">client.functions.invocations.<a href="./src/runloop_api_client/resources/functions/invocations.py">kill</a>(invocation_id) -> <a href="./src/runloop_api_client/types/functions/kill_operation_response.py">object</a></code>
155-
- <code title="get /v1/functions/invocations/{invocation_id}/logs">client.functions.invocations.<a href="./src/runloop_api_client/resources/functions/invocations.py">logs</a>(invocation_id) -> <a href="./src/runloop_api_client/types/functions/invocation_logs_response.py">InvocationLogsResponse</a></code>
156131

157132
# Projects
158133

src/runloop_api_client/_client.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747

4848
class Runloop(SyncAPIClient):
4949
blueprints: resources.BlueprintsResource
50-
deployments: resources.DeploymentsResource
5150
devboxes: resources.DevboxesResource
5251
functions: resources.FunctionsResource
5352
projects: resources.ProjectsResource
@@ -108,10 +107,7 @@ def __init__(
108107
_strict_response_validation=_strict_response_validation,
109108
)
110109

111-
self._default_stream_cls = Stream
112-
113110
self.blueprints = resources.BlueprintsResource(self)
114-
self.deployments = resources.DeploymentsResource(self)
115111
self.devboxes = resources.DevboxesResource(self)
116112
self.functions = resources.FunctionsResource(self)
117113
self.projects = resources.ProjectsResource(self)
@@ -225,7 +221,6 @@ def _make_status_error(
225221

226222
class AsyncRunloop(AsyncAPIClient):
227223
blueprints: resources.AsyncBlueprintsResource
228-
deployments: resources.AsyncDeploymentsResource
229224
devboxes: resources.AsyncDevboxesResource
230225
functions: resources.AsyncFunctionsResource
231226
projects: resources.AsyncProjectsResource
@@ -286,10 +281,7 @@ def __init__(
286281
_strict_response_validation=_strict_response_validation,
287282
)
288283

289-
self._default_stream_cls = AsyncStream
290-
291284
self.blueprints = resources.AsyncBlueprintsResource(self)
292-
self.deployments = resources.AsyncDeploymentsResource(self)
293285
self.devboxes = resources.AsyncDevboxesResource(self)
294286
self.functions = resources.AsyncFunctionsResource(self)
295287
self.projects = resources.AsyncProjectsResource(self)
@@ -404,7 +396,6 @@ def _make_status_error(
404396
class RunloopWithRawResponse:
405397
def __init__(self, client: Runloop) -> None:
406398
self.blueprints = resources.BlueprintsResourceWithRawResponse(client.blueprints)
407-
self.deployments = resources.DeploymentsResourceWithRawResponse(client.deployments)
408399
self.devboxes = resources.DevboxesResourceWithRawResponse(client.devboxes)
409400
self.functions = resources.FunctionsResourceWithRawResponse(client.functions)
410401
self.projects = resources.ProjectsResourceWithRawResponse(client.projects)
@@ -413,7 +404,6 @@ def __init__(self, client: Runloop) -> None:
413404
class AsyncRunloopWithRawResponse:
414405
def __init__(self, client: AsyncRunloop) -> None:
415406
self.blueprints = resources.AsyncBlueprintsResourceWithRawResponse(client.blueprints)
416-
self.deployments = resources.AsyncDeploymentsResourceWithRawResponse(client.deployments)
417407
self.devboxes = resources.AsyncDevboxesResourceWithRawResponse(client.devboxes)
418408
self.functions = resources.AsyncFunctionsResourceWithRawResponse(client.functions)
419409
self.projects = resources.AsyncProjectsResourceWithRawResponse(client.projects)
@@ -422,7 +412,6 @@ def __init__(self, client: AsyncRunloop) -> None:
422412
class RunloopWithStreamedResponse:
423413
def __init__(self, client: Runloop) -> None:
424414
self.blueprints = resources.BlueprintsResourceWithStreamingResponse(client.blueprints)
425-
self.deployments = resources.DeploymentsResourceWithStreamingResponse(client.deployments)
426415
self.devboxes = resources.DevboxesResourceWithStreamingResponse(client.devboxes)
427416
self.functions = resources.FunctionsResourceWithStreamingResponse(client.functions)
428417
self.projects = resources.ProjectsResourceWithStreamingResponse(client.projects)
@@ -431,7 +420,6 @@ def __init__(self, client: Runloop) -> None:
431420
class AsyncRunloopWithStreamedResponse:
432421
def __init__(self, client: AsyncRunloop) -> None:
433422
self.blueprints = resources.AsyncBlueprintsResourceWithStreamingResponse(client.blueprints)
434-
self.deployments = resources.AsyncDeploymentsResourceWithStreamingResponse(client.deployments)
435423
self.devboxes = resources.AsyncDevboxesResourceWithStreamingResponse(client.devboxes)
436424
self.functions = resources.AsyncFunctionsResourceWithStreamingResponse(client.functions)
437425
self.projects = resources.AsyncProjectsResourceWithStreamingResponse(client.projects)

src/runloop_api_client/_streaming.py

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -55,29 +55,7 @@ def __stream__(self) -> Iterator[_T]:
5555
iterator = self._iter_events()
5656

5757
for sse in iterator:
58-
if sse.event == "completion":
59-
yield process_data(data=sse.json(), cast_to=cast_to, response=response)
60-
61-
if sse.event == "message_start" or sse.event == "content_block_stop":
62-
yield process_data(data=sse.json(), cast_to=cast_to, response=response)
63-
64-
if sse.event == "ping":
65-
continue
66-
67-
if sse.event == "error":
68-
body = sse.data
69-
70-
try:
71-
body = sse.json()
72-
err_msg = f"{body}"
73-
except Exception:
74-
err_msg = sse.data or f"Error code: {response.status_code}"
75-
76-
raise self._client._make_status_error(
77-
err_msg,
78-
body=body,
79-
response=self.response,
80-
)
58+
yield process_data(data=sse.json(), cast_to=cast_to, response=response)
8159

8260
# Ensure the entire stream is consumed
8361
for _sse in iterator:
@@ -141,29 +119,7 @@ async def __stream__(self) -> AsyncIterator[_T]:
141119
iterator = self._iter_events()
142120

143121
async for sse in iterator:
144-
if sse.event == "completion":
145-
yield process_data(data=sse.json(), cast_to=cast_to, response=response)
146-
147-
if sse.event == "message_start" or sse.event == "content_block_stop":
148-
yield process_data(data=sse.json(), cast_to=cast_to, response=response)
149-
150-
if sse.event == "ping":
151-
continue
152-
153-
if sse.event == "error":
154-
body = sse.data
155-
156-
try:
157-
body = sse.json()
158-
err_msg = f"{body}"
159-
except Exception:
160-
err_msg = sse.data or f"Error code: {response.status_code}"
161-
162-
raise self._client._make_status_error(
163-
err_msg,
164-
body=body,
165-
response=self.response,
166-
)
122+
yield process_data(data=sse.json(), cast_to=cast_to, response=response)
167123

168124
# Ensure the entire stream is consumed
169125
async for _sse in iterator:

src/runloop_api_client/resources/__init__.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,6 @@
3232
BlueprintsResourceWithStreamingResponse,
3333
AsyncBlueprintsResourceWithStreamingResponse,
3434
)
35-
from .deployments import (
36-
DeploymentsResource,
37-
AsyncDeploymentsResource,
38-
DeploymentsResourceWithRawResponse,
39-
AsyncDeploymentsResourceWithRawResponse,
40-
DeploymentsResourceWithStreamingResponse,
41-
AsyncDeploymentsResourceWithStreamingResponse,
42-
)
4335

4436
__all__ = [
4537
"BlueprintsResource",
@@ -48,12 +40,6 @@
4840
"AsyncBlueprintsResourceWithRawResponse",
4941
"BlueprintsResourceWithStreamingResponse",
5042
"AsyncBlueprintsResourceWithStreamingResponse",
51-
"DeploymentsResource",
52-
"AsyncDeploymentsResource",
53-
"DeploymentsResourceWithRawResponse",
54-
"AsyncDeploymentsResourceWithRawResponse",
55-
"DeploymentsResourceWithStreamingResponse",
56-
"AsyncDeploymentsResourceWithStreamingResponse",
5743
"DevboxesResource",
5844
"AsyncDevboxesResource",
5945
"DevboxesResourceWithRawResponse",

src/runloop_api_client/resources/devboxes/devboxes.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
)
4949
from ..._base_client import make_request_options
5050
from ...types.devbox_view import DevboxView
51-
from ...types.devbox_list_response import DevboxListResponse
51+
from ...types.devbox_list_view import DevboxListView
5252
from ...types.devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse
5353
from ...types.devboxes.devbox_execution_detail_view import DevboxExecutionDetailView
5454
from ...types.devboxes.devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView
@@ -198,7 +198,7 @@ def list(
198198
extra_query: Query | None = None,
199199
extra_body: Body | None = None,
200200
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
201-
) -> DevboxListResponse:
201+
) -> DevboxListView:
202202
"""List all devboxes or filter by status.
203203
204204
If no status is provided, all devboxes
@@ -235,7 +235,7 @@ def list(
235235
devbox_list_params.DevboxListParams,
236236
),
237237
),
238-
cast_to=DevboxListResponse,
238+
cast_to=DevboxListView,
239239
)
240240

241241
def create_ssh_key(
@@ -656,7 +656,7 @@ async def list(
656656
extra_query: Query | None = None,
657657
extra_body: Body | None = None,
658658
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
659-
) -> DevboxListResponse:
659+
) -> DevboxListView:
660660
"""List all devboxes or filter by status.
661661
662662
If no status is provided, all devboxes
@@ -693,7 +693,7 @@ async def list(
693693
devbox_list_params.DevboxListParams,
694694
),
695695
),
696-
cast_to=DevboxListResponse,
696+
cast_to=DevboxListView,
697697
)
698698

699699
async def create_ssh_key(

0 commit comments

Comments
 (0)