Skip to content

Commit ac71ca0

Browse files
authored
Merge pull request #42 from runloopai/release-please--branches--main--changes--next
release: 0.1.0-alpha.7
2 parents 886877f + 0e8f4d3 commit ac71ca0

33 files changed

+1540
-51
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.1.0-alpha.6"
2+
".": "0.1.0-alpha.7"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 14
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6ba331adfa030e48fb227c7205196d406eea68442ad01104d9b8c9ac9f089fa0.yml
1+
configured_endpoints: 19
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c11fd761b5d15675ee672120e5600fd6dddd801d87c1fa6335c507184bdf60b5.yml

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
# Changelog
22

3+
## 0.1.0-alpha.7 (2024-07-30)
4+
5+
Full Changelog: [v0.1.0-alpha.6...v0.1.0-alpha.7](https://github.com/runloopai/api-client-python/compare/v0.1.0-alpha.6...v0.1.0-alpha.7)
6+
7+
### Features
8+
9+
* **api:** OpenAPI spec update via Stainless API ([#41](https://github.com/runloopai/api-client-python/issues/41)) ([d4da50f](https://github.com/runloopai/api-client-python/commit/d4da50fc963abf097b5d214df1cc3ee641281ab3))
10+
* **api:** OpenAPI spec update via Stainless API ([#43](https://github.com/runloopai/api-client-python/issues/43)) ([2eed5ae](https://github.com/runloopai/api-client-python/commit/2eed5aed9091a2040efe730cb63baa8b284f1c4d))
11+
* **api:** OpenAPI spec update via Stainless API ([#44](https://github.com/runloopai/api-client-python/issues/44)) ([d936662](https://github.com/runloopai/api-client-python/commit/d936662a5aea53a50f8ccf7e7d29c3634a8567d7))
12+
* **api:** OpenAPI spec update via Stainless API ([#46](https://github.com/runloopai/api-client-python/issues/46)) ([cd62f94](https://github.com/runloopai/api-client-python/commit/cd62f949150028cdd481966722d26f1ea3333cd2))
13+
* **api:** OpenAPI spec update via Stainless API ([#47](https://github.com/runloopai/api-client-python/issues/47)) ([218b9b0](https://github.com/runloopai/api-client-python/commit/218b9b0a1af247c96d7ca5299cf5c855bc4e3dfd))
14+
* **api:** OpenAPI spec update via Stainless API ([#48](https://github.com/runloopai/api-client-python/issues/48)) ([b866f26](https://github.com/runloopai/api-client-python/commit/b866f2684b69ba1f5b3ed4f360c8de03aefa63e4))
15+
* **api:** OpenAPI spec update via Stainless API ([#49](https://github.com/runloopai/api-client-python/issues/49)) ([3a39028](https://github.com/runloopai/api-client-python/commit/3a390287c870129265fc9f2cee6c6042430ea61f))
16+
* **api:** OpenAPI spec update via Stainless API ([#50](https://github.com/runloopai/api-client-python/issues/50)) ([c6d26f4](https://github.com/runloopai/api-client-python/commit/c6d26f407dffb8b65342476e129e11a2caa481db))
17+
18+
19+
### Chores
20+
21+
* **internal:** add type construction helper ([#45](https://github.com/runloopai/api-client-python/issues/45)) ([8b05828](https://github.com/runloopai/api-client-python/commit/8b058280802b5ce7987065d17806632de4a80d32))
22+
323
## 0.1.0-alpha.6 (2024-07-25)
424

525
Full Changelog: [v0.1.0-alpha.5...v0.1.0-alpha.6](https://github.com/runloopai/api-client-python/compare/v0.1.0-alpha.5...v0.1.0-alpha.6)

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ from runloop_api_client import Runloop
2929

3030
client = Runloop(
3131
# This is the default and can be omitted
32-
bearer_token=os.environ.get("RUNLOOP_BEARER_TOKEN"),
32+
bearer_token=os.environ.get("RUNLOOP_API_KEY"),
3333
)
3434

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

3939
While you can provide a `bearer_token` keyword argument,
4040
we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)
41-
to add `RUNLOOP_BEARER_TOKEN="My Bearer Token"` to your `.env` file
41+
to add `RUNLOOP_API_KEY="My Bearer Token"` to your `.env` file
4242
so that your Bearer Token is not stored in source control.
4343

4444
## Async usage
@@ -52,13 +52,13 @@ from runloop_api_client import AsyncRunloop
5252

5353
client = AsyncRunloop(
5454
# This is the default and can be omitted
55-
bearer_token=os.environ.get("RUNLOOP_BEARER_TOKEN"),
55+
bearer_token=os.environ.get("RUNLOOP_API_KEY"),
5656
)
5757

5858

5959
async def main() -> None:
60-
devbox_view = await client.devboxes.create()
61-
print(devbox_view.id)
60+
blueprint_view = await client.blueprints.create()
61+
print(blueprint_view.id)
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.id)
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: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,45 @@
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_view.py">BlueprintView</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_list_params.py">params</a>) -> <a href="./src/runloop_api_client/types/blueprint_list_view.py">BlueprintListView</a></code>
35+
- <code title="get /v1/blueprints/{id}/logs">client.blueprints.<a href="./src/runloop_api_client/resources/blueprints.py">logs</a>(id) -> <a href="./src/runloop_api_client/types/blueprint_build_logs_list_view.py">BlueprintBuildLogsListView</a></code>
36+
- <code title="post /v1/blueprints/preview">client.blueprints.<a href="./src/runloop_api_client/resources/blueprints.py">preview</a>(\*\*<a href="src/runloop_api_client/types/blueprint_preview_params.py">params</a>) -> <a href="./src/runloop_api_client/types/blueprint_preview_view.py">BlueprintPreviewView</a></code>
37+
38+
# Code
39+
40+
Types:
41+
42+
```python
43+
from runloop_api_client.types import CodeMountParameters
44+
```
45+
746
# Devboxes
847

948
Types:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "runloop_api_client"
3-
version = "0.1.0-alpha.6"
3+
version = "0.1.0-alpha.7"
44
description = "The official Python library for the runloop API"
55
dynamic = ["readme"]
66
license = "MIT"

src/runloop_api_client/_client.py

Lines changed: 14 additions & 6 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
@@ -80,13 +81,13 @@ def __init__(
8081
) -> None:
8182
"""Construct a new synchronous runloop client instance.
8283
83-
This automatically infers the `bearer_token` argument from the `RUNLOOP_BEARER_TOKEN` environment variable if it is not provided.
84+
This automatically infers the `bearer_token` argument from the `RUNLOOP_API_KEY` environment variable if it is not provided.
8485
"""
8586
if bearer_token is None:
86-
bearer_token = os.environ.get("RUNLOOP_BEARER_TOKEN")
87+
bearer_token = os.environ.get("RUNLOOP_API_KEY")
8788
if bearer_token is None:
8889
raise RunloopError(
89-
"The bearer_token client option must be set either by passing bearer_token to the client or by setting the RUNLOOP_BEARER_TOKEN environment variable"
90+
"The bearer_token client option must be set either by passing bearer_token to the client or by setting the RUNLOOP_API_KEY environment variable"
9091
)
9192
self.bearer_token = bearer_token
9293

@@ -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
@@ -252,13 +255,13 @@ def __init__(
252255
) -> None:
253256
"""Construct a new async runloop client instance.
254257
255-
This automatically infers the `bearer_token` argument from the `RUNLOOP_BEARER_TOKEN` environment variable if it is not provided.
258+
This automatically infers the `bearer_token` argument from the `RUNLOOP_API_KEY` environment variable if it is not provided.
256259
"""
257260
if bearer_token is None:
258-
bearer_token = os.environ.get("RUNLOOP_BEARER_TOKEN")
261+
bearer_token = os.environ.get("RUNLOOP_API_KEY")
259262
if bearer_token is None:
260263
raise RunloopError(
261-
"The bearer_token client option must be set either by passing bearer_token to the client or by setting the RUNLOOP_BEARER_TOKEN environment variable"
264+
"The bearer_token client option must be set either by passing bearer_token to the client or by setting the RUNLOOP_API_KEY environment variable"
262265
)
263266
self.bearer_token = bearer_token
264267

@@ -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/_models.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,15 @@ def build(
406406
return cast(_BaseModelT, construct_type(type_=base_model_cls, value=kwargs))
407407

408408

409+
def construct_type_unchecked(*, value: object, type_: type[_T]) -> _T:
410+
"""Loose coercion to the expected type with construction of nested values.
411+
412+
Note: the returned value from this function is not guaranteed to match the
413+
given type.
414+
"""
415+
return cast(_T, construct_type(value=value, type_=type_))
416+
417+
409418
def construct_type(*, value: object, type_: object) -> object:
410419
"""Loose coercion to the expected type with construction of nested values.
411420

src/runloop_api_client/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
__title__ = "runloop_api_client"
4-
__version__ = "0.1.0-alpha.6" # x-release-please-version
4+
__version__ = "0.1.0-alpha.7" # x-release-please-version

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)