Skip to content

Commit 987c4e3

Browse files
authored
Merge pull request #97 from runloopai/release-please--branches--main--changes--next
release: 0.1.0-alpha.13
2 parents e064962 + a9922b8 commit 987c4e3

8 files changed

Lines changed: 52 additions & 26 deletions

File tree

.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.12"
2+
".": "0.1.0-alpha.13"
33
}

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 23
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b8fcc87544efea42048d01a4c7ba4c8abf1725337cfbb6bff607d5fea5cd1e1a.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-cbb5634053080aa5b590af54b434cfd5275d5a27e932fb91366f7f7f2b492ed8.yml

CHANGELOG.md

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

3+
## 0.1.0-alpha.13 (2024-08-16)
4+
5+
Full Changelog: [v0.1.0-alpha.12...v0.1.0-alpha.13](https://github.com/runloopai/api-client-python/compare/v0.1.0-alpha.12...v0.1.0-alpha.13)
6+
7+
### Features
8+
9+
* **api:** OpenAPI spec update via Stainless API ([#100](https://github.com/runloopai/api-client-python/issues/100)) ([772cfa1](https://github.com/runloopai/api-client-python/commit/772cfa19fb0c666540b39613ca1fc4a22bdffe82))
10+
* **api:** OpenAPI spec update via Stainless API ([#101](https://github.com/runloopai/api-client-python/issues/101)) ([a0841a4](https://github.com/runloopai/api-client-python/commit/a0841a410113bc784cca786a2774aea67c9f3a58))
11+
* **api:** OpenAPI spec update via Stainless API ([#102](https://github.com/runloopai/api-client-python/issues/102)) ([158d661](https://github.com/runloopai/api-client-python/commit/158d661d90493597b1500b6ef4cfcfe6b7fa6d30))
12+
* **api:** OpenAPI spec update via Stainless API ([#96](https://github.com/runloopai/api-client-python/issues/96)) ([fb6dd1d](https://github.com/runloopai/api-client-python/commit/fb6dd1d4c536f0c518c6399ec543ea92162782ff))
13+
* **api:** OpenAPI spec update via Stainless API ([#98](https://github.com/runloopai/api-client-python/issues/98)) ([0d77cac](https://github.com/runloopai/api-client-python/commit/0d77cacb4b4c582826b9772a287cced25b1210bf))
14+
* **api:** OpenAPI spec update via Stainless API ([#99](https://github.com/runloopai/api-client-python/issues/99)) ([081978b](https://github.com/runloopai/api-client-python/commit/081978b3867fe873b52ea475cbe6e69e50448e51))
15+
316
## 0.1.0-alpha.12 (2024-08-15)
417

518
Full Changelog: [v0.1.0-alpha.11...v0.1.0-alpha.12](https://github.com/runloopai/api-client-python/compare/v0.1.0-alpha.11...v0.1.0-alpha.12)

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.12"
3+
version = "0.1.0-alpha.13"
44
description = "The official Python library for the runloop API"
55
dynamic = ["readme"]
66
license = "MIT"

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.12" # x-release-please-version
4+
__version__ = "0.1.0-alpha.13" # x-release-please-version

src/runloop_api_client/resources/devboxes/devboxes.py

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Dict, List
5+
from typing import Dict, List, Mapping, cast
66

77
import httpx
88

@@ -25,7 +25,9 @@
2525
)
2626
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes
2727
from ..._utils import (
28+
extract_files,
2829
maybe_transform,
30+
deepcopy_minimal,
2931
async_maybe_transform,
3032
)
3133
from ..._compat import cached_property
@@ -370,7 +372,7 @@ def upload_file(
370372
self,
371373
id: str,
372374
*,
373-
file_input_stream: FileTypes | NotGiven = NOT_GIVEN,
375+
file: FileTypes | NotGiven = NOT_GIVEN,
374376
path: str | NotGiven = NOT_GIVEN,
375377
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
376378
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -393,15 +395,21 @@ def upload_file(
393395
"""
394396
if not id:
395397
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
398+
body = deepcopy_minimal(
399+
{
400+
"file": file,
401+
"path": path,
402+
}
403+
)
404+
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
405+
# It should be noted that the actual Content-Type header that will be
406+
# sent to the server will contain a `boundary` parameter, e.g.
407+
# multipart/form-data; boundary=---abc--
408+
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
396409
return self._post(
397410
f"/v1/devboxes/{id}/upload_file",
398-
body=maybe_transform(
399-
{
400-
"file_input_stream": file_input_stream,
401-
"path": path,
402-
},
403-
devbox_upload_file_params.DevboxUploadFileParams,
404-
),
411+
body=maybe_transform(body, devbox_upload_file_params.DevboxUploadFileParams),
412+
files=files,
405413
options=make_request_options(
406414
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
407415
),
@@ -781,7 +789,7 @@ async def upload_file(
781789
self,
782790
id: str,
783791
*,
784-
file_input_stream: FileTypes | NotGiven = NOT_GIVEN,
792+
file: FileTypes | NotGiven = NOT_GIVEN,
785793
path: str | NotGiven = NOT_GIVEN,
786794
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
787795
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -804,15 +812,21 @@ async def upload_file(
804812
"""
805813
if not id:
806814
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
815+
body = deepcopy_minimal(
816+
{
817+
"file": file,
818+
"path": path,
819+
}
820+
)
821+
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
822+
# It should be noted that the actual Content-Type header that will be
823+
# sent to the server will contain a `boundary` parameter, e.g.
824+
# multipart/form-data; boundary=---abc--
825+
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
807826
return await self._post(
808827
f"/v1/devboxes/{id}/upload_file",
809-
body=await async_maybe_transform(
810-
{
811-
"file_input_stream": file_input_stream,
812-
"path": path,
813-
},
814-
devbox_upload_file_params.DevboxUploadFileParams,
815-
),
828+
body=await async_maybe_transform(body, devbox_upload_file_params.DevboxUploadFileParams),
829+
files=files,
816830
options=make_request_options(
817831
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
818832
),

src/runloop_api_client/types/devbox_upload_file_params.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22

33
from __future__ import annotations
44

5-
from typing_extensions import Annotated, TypedDict
5+
from typing_extensions import TypedDict
66

77
from .._types import FileTypes
8-
from .._utils import PropertyInfo
98

109
__all__ = ["DevboxUploadFileParams"]
1110

1211

1312
class DevboxUploadFileParams(TypedDict, total=False):
14-
file_input_stream: Annotated[FileTypes, PropertyInfo(alias="fileInputStream")]
13+
file: FileTypes
1514

1615
path: str

tests/api_resources/test_devboxes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ def test_method_upload_file(self, client: Runloop) -> None:
323323
def test_method_upload_file_with_all_params(self, client: Runloop) -> None:
324324
devbox = client.devboxes.upload_file(
325325
id="id",
326-
file_input_stream=b"raw file contents",
326+
file=b"raw file contents",
327327
path="path",
328328
)
329329
assert_matches_type(object, devbox, path=["response"])
@@ -712,7 +712,7 @@ async def test_method_upload_file(self, async_client: AsyncRunloop) -> None:
712712
async def test_method_upload_file_with_all_params(self, async_client: AsyncRunloop) -> None:
713713
devbox = await async_client.devboxes.upload_file(
714714
id="id",
715-
file_input_stream=b"raw file contents",
715+
file=b"raw file contents",
716716
path="path",
717717
)
718718
assert_matches_type(object, devbox, path=["response"])

0 commit comments

Comments
 (0)