Skip to content

Commit f82c51c

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): OpenAPI spec update via Stainless API (#69)
1 parent 91913d6 commit f82c51c

2 files changed

Lines changed: 19 additions & 19 deletions

File tree

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_API_KEY"),
3333
)
3434

35-
blueprint_view = client.blueprints.create()
36-
print(blueprint_view.id)
35+
devbox_view = client.devboxes.create()
36+
print(devbox_view.id)
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-
blueprint_view = await client.blueprints.create()
61-
print(blueprint_view.id)
60+
devbox_view = await client.devboxes.create()
61+
print(devbox_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.blueprints.create()
94+
client.devboxes.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).blueprints.create()
137+
client.with_options(max_retries=5).devboxes.create()
138138
```
139139

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

159159
# Override per-request:
160-
client.with_options(timeout=5.0).blueprints.create()
160+
client.with_options(timeout=5.0).devboxes.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.blueprints.with_raw_response.create()
199+
response = client.devboxes.with_raw_response.create()
200200
print(response.headers.get('X-My-Header'))
201201

202-
blueprint = response.parse() # get the object that `blueprints.create()` would have returned
203-
print(blueprint.id)
202+
devbox = response.parse() # get the object that `devboxes.create()` would have returned
203+
print(devbox.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.blueprints.with_streaming_response.create() as response:
217+
with client.devboxes.with_streaming_response.create() as response:
218218
print(response.headers.get("X-My-Header"))
219219

220220
for line in response.iter_lines():

tests/test_client.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -732,11 +732,11 @@ def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str
732732
@mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
733733
@pytest.mark.respx(base_url=base_url)
734734
def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None:
735-
respx_mock.post("/v1/blueprints").mock(side_effect=httpx.TimeoutException("Test timeout error"))
735+
respx_mock.post("/v1/devboxes").mock(side_effect=httpx.TimeoutException("Test timeout error"))
736736

737737
with pytest.raises(APITimeoutError):
738738
self.client.post(
739-
"/v1/blueprints",
739+
"/v1/devboxes",
740740
body=cast(object, dict()),
741741
cast_to=httpx.Response,
742742
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
@@ -747,11 +747,11 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No
747747
@mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
748748
@pytest.mark.respx(base_url=base_url)
749749
def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None:
750-
respx_mock.post("/v1/blueprints").mock(return_value=httpx.Response(500))
750+
respx_mock.post("/v1/devboxes").mock(return_value=httpx.Response(500))
751751

752752
with pytest.raises(APIStatusError):
753753
self.client.post(
754-
"/v1/blueprints",
754+
"/v1/devboxes",
755755
body=cast(object, dict()),
756756
cast_to=httpx.Response,
757757
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
@@ -1447,11 +1447,11 @@ async def test_parse_retry_after_header(self, remaining_retries: int, retry_afte
14471447
@mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
14481448
@pytest.mark.respx(base_url=base_url)
14491449
async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None:
1450-
respx_mock.post("/v1/blueprints").mock(side_effect=httpx.TimeoutException("Test timeout error"))
1450+
respx_mock.post("/v1/devboxes").mock(side_effect=httpx.TimeoutException("Test timeout error"))
14511451

14521452
with pytest.raises(APITimeoutError):
14531453
await self.client.post(
1454-
"/v1/blueprints",
1454+
"/v1/devboxes",
14551455
body=cast(object, dict()),
14561456
cast_to=httpx.Response,
14571457
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
@@ -1462,11 +1462,11 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter)
14621462
@mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
14631463
@pytest.mark.respx(base_url=base_url)
14641464
async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None:
1465-
respx_mock.post("/v1/blueprints").mock(return_value=httpx.Response(500))
1465+
respx_mock.post("/v1/devboxes").mock(return_value=httpx.Response(500))
14661466

14671467
with pytest.raises(APIStatusError):
14681468
await self.client.post(
1469-
"/v1/blueprints",
1469+
"/v1/devboxes",
14701470
body=cast(object, dict()),
14711471
cast_to=httpx.Response,
14721472
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},

0 commit comments

Comments
 (0)