Skip to content

Commit 3a39028

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): OpenAPI spec update via Stainless API (#49)
1 parent b866f26 commit 3a39028

18 files changed

Lines changed: 880 additions & 20 deletions

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 14
1+
configured_endpoints: 17
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-86d074c66f5140455eedb277c3ad3de81ec91f5cbd6ade28ef00ea2546dcc95e.yml

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ client = Runloop(
3232
bearer_token=os.environ.get("RUNLOOP_BEARER_TOKEN"),
3333
)
3434

35-
devbox_view = client.devboxes.create()
36-
print(devbox_view.id)
35+
blueprint_preview_view = client.blueprints.create()
36+
print(blueprint_preview_view.dockerfile)
3737
```
3838

3939
While you can provide a `bearer_token` keyword argument,
@@ -57,8 +57,8 @@ client = AsyncRunloop(
5757

5858

5959
async def main() -> None:
60-
devbox_view = await client.devboxes.create()
61-
print(devbox_view.id)
60+
blueprint_preview_view = await client.blueprints.create()
61+
print(blueprint_preview_view.dockerfile)
6262

6363

6464
asyncio.run(main())
@@ -91,7 +91,7 @@ from runloop_api_client import Runloop
9191
client = Runloop()
9292

9393
try:
94-
client.devboxes.create()
94+
client.blueprints.create()
9595
except runloop_api_client.APIConnectionError as e:
9696
print("The server could not be reached")
9797
print(e.__cause__) # an underlying Exception, likely raised within httpx.
@@ -134,7 +134,7 @@ client = Runloop(
134134
)
135135

136136
# Or, configure per-request:
137-
client.with_options(max_retries=5).devboxes.create()
137+
client.with_options(max_retries=5).blueprints.create()
138138
```
139139

140140
### Timeouts
@@ -157,7 +157,7 @@ client = Runloop(
157157
)
158158

159159
# Override per-request:
160-
client.with_options(timeout=5.0).devboxes.create()
160+
client.with_options(timeout=5.0).blueprints.create()
161161
```
162162

163163
On timeout, an `APITimeoutError` is thrown.
@@ -196,11 +196,11 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
196196
from runloop_api_client import Runloop
197197

198198
client = Runloop()
199-
response = client.devboxes.with_raw_response.create()
199+
response = client.blueprints.with_raw_response.create()
200200
print(response.headers.get('X-My-Header'))
201201

202-
devbox = response.parse() # get the object that `devboxes.create()` would have returned
203-
print(devbox.id)
202+
blueprint = response.parse() # get the object that `blueprints.create()` would have returned
203+
print(blueprint.dockerfile)
204204
```
205205

206206
These methods return an [`APIResponse`](https://github.com/runloopai/api-client-python/tree/main/src/runloop_api_client/_response.py) object.
@@ -214,7 +214,7 @@ The above interface eagerly reads the full response body when you make the reque
214214
To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.
215215

216216
```python
217-
with client.devboxes.with_streaming_response.create() as response:
217+
with client.blueprints.with_streaming_response.create() as response:
218218
print(response.headers.get("X-My-Header"))
219219

220220
for line in response.iter_lines():

api.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,43 @@
44
from runloop_api_client.types import ProjectLogsView
55
```
66

7+
# Account
8+
9+
Types:
10+
11+
```python
12+
from runloop_api_client.types import ResourceSize
13+
```
14+
15+
# Blueprints
16+
17+
Types:
18+
19+
```python
20+
from runloop_api_client.types import (
21+
BlueprintBuildLog,
22+
BlueprintBuildLogsListView,
23+
BlueprintBuildParameters,
24+
BlueprintListView,
25+
BlueprintPreviewView,
26+
BlueprintView,
27+
)
28+
```
29+
30+
Methods:
31+
32+
- <code title="post /v1/blueprints">client.blueprints.<a href="./src/runloop_api_client/resources/blueprints.py">create</a>(\*\*<a href="src/runloop_api_client/types/blueprint_create_params.py">params</a>) -> <a href="./src/runloop_api_client/types/blueprint_preview_view.py">BlueprintPreviewView</a></code>
33+
- <code title="get /v1/blueprints/{id}">client.blueprints.<a href="./src/runloop_api_client/resources/blueprints.py">retrieve</a>(id) -> <a href="./src/runloop_api_client/types/blueprint_view.py">BlueprintView</a></code>
34+
- <code title="get /v1/blueprints">client.blueprints.<a href="./src/runloop_api_client/resources/blueprints.py">list</a>() -> <a href="./src/runloop_api_client/types/blueprint_build_logs_list_view.py">BlueprintBuildLogsListView</a></code>
35+
36+
# Code
37+
38+
Types:
39+
40+
```python
41+
from runloop_api_client.types import CodeMountParameters
42+
```
43+
744
# Devboxes
845

946
Types:

src/runloop_api_client/_client.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646

4747

4848
class Runloop(SyncAPIClient):
49+
blueprints: resources.BlueprintsResource
4950
devboxes: resources.DevboxesResource
5051
functions: resources.FunctionsResource
5152
projects: resources.ProjectsResource
@@ -106,6 +107,7 @@ def __init__(
106107
_strict_response_validation=_strict_response_validation,
107108
)
108109

110+
self.blueprints = resources.BlueprintsResource(self)
109111
self.devboxes = resources.DevboxesResource(self)
110112
self.functions = resources.FunctionsResource(self)
111113
self.projects = resources.ProjectsResource(self)
@@ -218,6 +220,7 @@ def _make_status_error(
218220

219221

220222
class AsyncRunloop(AsyncAPIClient):
223+
blueprints: resources.AsyncBlueprintsResource
221224
devboxes: resources.AsyncDevboxesResource
222225
functions: resources.AsyncFunctionsResource
223226
projects: resources.AsyncProjectsResource
@@ -278,6 +281,7 @@ def __init__(
278281
_strict_response_validation=_strict_response_validation,
279282
)
280283

284+
self.blueprints = resources.AsyncBlueprintsResource(self)
281285
self.devboxes = resources.AsyncDevboxesResource(self)
282286
self.functions = resources.AsyncFunctionsResource(self)
283287
self.projects = resources.AsyncProjectsResource(self)
@@ -391,27 +395,31 @@ def _make_status_error(
391395

392396
class RunloopWithRawResponse:
393397
def __init__(self, client: Runloop) -> None:
398+
self.blueprints = resources.BlueprintsResourceWithRawResponse(client.blueprints)
394399
self.devboxes = resources.DevboxesResourceWithRawResponse(client.devboxes)
395400
self.functions = resources.FunctionsResourceWithRawResponse(client.functions)
396401
self.projects = resources.ProjectsResourceWithRawResponse(client.projects)
397402

398403

399404
class AsyncRunloopWithRawResponse:
400405
def __init__(self, client: AsyncRunloop) -> None:
406+
self.blueprints = resources.AsyncBlueprintsResourceWithRawResponse(client.blueprints)
401407
self.devboxes = resources.AsyncDevboxesResourceWithRawResponse(client.devboxes)
402408
self.functions = resources.AsyncFunctionsResourceWithRawResponse(client.functions)
403409
self.projects = resources.AsyncProjectsResourceWithRawResponse(client.projects)
404410

405411

406412
class RunloopWithStreamedResponse:
407413
def __init__(self, client: Runloop) -> None:
414+
self.blueprints = resources.BlueprintsResourceWithStreamingResponse(client.blueprints)
408415
self.devboxes = resources.DevboxesResourceWithStreamingResponse(client.devboxes)
409416
self.functions = resources.FunctionsResourceWithStreamingResponse(client.functions)
410417
self.projects = resources.ProjectsResourceWithStreamingResponse(client.projects)
411418

412419

413420
class AsyncRunloopWithStreamedResponse:
414421
def __init__(self, client: AsyncRunloop) -> None:
422+
self.blueprints = resources.AsyncBlueprintsResourceWithStreamingResponse(client.blueprints)
415423
self.devboxes = resources.AsyncDevboxesResourceWithStreamingResponse(client.devboxes)
416424
self.functions = resources.AsyncFunctionsResourceWithStreamingResponse(client.functions)
417425
self.projects = resources.AsyncProjectsResourceWithStreamingResponse(client.projects)

src/runloop_api_client/resources/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,22 @@
2424
FunctionsResourceWithStreamingResponse,
2525
AsyncFunctionsResourceWithStreamingResponse,
2626
)
27+
from .blueprints import (
28+
BlueprintsResource,
29+
AsyncBlueprintsResource,
30+
BlueprintsResourceWithRawResponse,
31+
AsyncBlueprintsResourceWithRawResponse,
32+
BlueprintsResourceWithStreamingResponse,
33+
AsyncBlueprintsResourceWithStreamingResponse,
34+
)
2735

2836
__all__ = [
37+
"BlueprintsResource",
38+
"AsyncBlueprintsResource",
39+
"BlueprintsResourceWithRawResponse",
40+
"AsyncBlueprintsResourceWithRawResponse",
41+
"BlueprintsResourceWithStreamingResponse",
42+
"AsyncBlueprintsResourceWithStreamingResponse",
2943
"DevboxesResource",
3044
"AsyncDevboxesResource",
3145
"DevboxesResourceWithRawResponse",

0 commit comments

Comments
 (0)