Skip to content

Commit 440aa7e

Browse files
feat(api): update via SDK Studio (#270)
1 parent adb1a4b commit 440aa7e

File tree

12 files changed

+433
-1
lines changed

12 files changed

+433
-1
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
configured_endpoints: 9
1+
configured_endpoints: 10

api.md

+14
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,17 @@ from openlayer.types.inference_pipelines import TestResultListResponse
8787
Methods:
8888

8989
- <code title="get /inference-pipelines/{inferencePipelineId}/results">client.inference_pipelines.test_results.<a href="./src/openlayer/resources/inference_pipelines/test_results.py">list</a>(inference_pipeline_id, \*\*<a href="src/openlayer/types/inference_pipelines/test_result_list_params.py">params</a>) -> <a href="./src/openlayer/types/inference_pipelines/test_result_list_response.py">TestResultListResponse</a></code>
90+
91+
# Storage
92+
93+
## PresignedURL
94+
95+
Types:
96+
97+
```python
98+
from openlayer.types.storage import PresignedURLCreateResponse
99+
```
100+
101+
Methods:
102+
103+
- <code title="post /storage/presigned-url">client.storage.presigned_url.<a href="./src/openlayer/resources/storage/presigned_url.py">create</a>(\*\*<a href="src/openlayer/types/storage/presigned_url_create_params.py">params</a>) -> <a href="./src/openlayer/types/storage/presigned_url_create_response.py">PresignedURLCreateResponse</a></code>

src/openlayer/_client.py

+8
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class Openlayer(SyncAPIClient):
5050
projects: resources.ProjectsResource
5151
commits: resources.CommitsResource
5252
inference_pipelines: resources.InferencePipelinesResource
53+
storage: resources.StorageResource
5354
with_raw_response: OpenlayerWithRawResponse
5455
with_streaming_response: OpenlayerWithStreamedResponse
5556

@@ -106,6 +107,7 @@ def __init__(
106107
self.projects = resources.ProjectsResource(self)
107108
self.commits = resources.CommitsResource(self)
108109
self.inference_pipelines = resources.InferencePipelinesResource(self)
110+
self.storage = resources.StorageResource(self)
109111
self.with_raw_response = OpenlayerWithRawResponse(self)
110112
self.with_streaming_response = OpenlayerWithStreamedResponse(self)
111113

@@ -231,6 +233,7 @@ class AsyncOpenlayer(AsyncAPIClient):
231233
projects: resources.AsyncProjectsResource
232234
commits: resources.AsyncCommitsResource
233235
inference_pipelines: resources.AsyncInferencePipelinesResource
236+
storage: resources.AsyncStorageResource
234237
with_raw_response: AsyncOpenlayerWithRawResponse
235238
with_streaming_response: AsyncOpenlayerWithStreamedResponse
236239

@@ -287,6 +290,7 @@ def __init__(
287290
self.projects = resources.AsyncProjectsResource(self)
288291
self.commits = resources.AsyncCommitsResource(self)
289292
self.inference_pipelines = resources.AsyncInferencePipelinesResource(self)
293+
self.storage = resources.AsyncStorageResource(self)
290294
self.with_raw_response = AsyncOpenlayerWithRawResponse(self)
291295
self.with_streaming_response = AsyncOpenlayerWithStreamedResponse(self)
292296

@@ -413,20 +417,23 @@ def __init__(self, client: Openlayer) -> None:
413417
self.projects = resources.ProjectsResourceWithRawResponse(client.projects)
414418
self.commits = resources.CommitsResourceWithRawResponse(client.commits)
415419
self.inference_pipelines = resources.InferencePipelinesResourceWithRawResponse(client.inference_pipelines)
420+
self.storage = resources.StorageResourceWithRawResponse(client.storage)
416421

417422

418423
class AsyncOpenlayerWithRawResponse:
419424
def __init__(self, client: AsyncOpenlayer) -> None:
420425
self.projects = resources.AsyncProjectsResourceWithRawResponse(client.projects)
421426
self.commits = resources.AsyncCommitsResourceWithRawResponse(client.commits)
422427
self.inference_pipelines = resources.AsyncInferencePipelinesResourceWithRawResponse(client.inference_pipelines)
428+
self.storage = resources.AsyncStorageResourceWithRawResponse(client.storage)
423429

424430

425431
class OpenlayerWithStreamedResponse:
426432
def __init__(self, client: Openlayer) -> None:
427433
self.projects = resources.ProjectsResourceWithStreamingResponse(client.projects)
428434
self.commits = resources.CommitsResourceWithStreamingResponse(client.commits)
429435
self.inference_pipelines = resources.InferencePipelinesResourceWithStreamingResponse(client.inference_pipelines)
436+
self.storage = resources.StorageResourceWithStreamingResponse(client.storage)
430437

431438

432439
class AsyncOpenlayerWithStreamedResponse:
@@ -436,6 +443,7 @@ def __init__(self, client: AsyncOpenlayer) -> None:
436443
self.inference_pipelines = resources.AsyncInferencePipelinesResourceWithStreamingResponse(
437444
client.inference_pipelines
438445
)
446+
self.storage = resources.AsyncStorageResourceWithStreamingResponse(client.storage)
439447

440448

441449
Client = Openlayer

src/openlayer/resources/__init__.py

+14
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88
CommitsResourceWithStreamingResponse,
99
AsyncCommitsResourceWithStreamingResponse,
1010
)
11+
from .storage import (
12+
StorageResource,
13+
AsyncStorageResource,
14+
StorageResourceWithRawResponse,
15+
AsyncStorageResourceWithRawResponse,
16+
StorageResourceWithStreamingResponse,
17+
AsyncStorageResourceWithStreamingResponse,
18+
)
1119
from .projects import (
1220
ProjectsResource,
1321
AsyncProjectsResource,
@@ -44,4 +52,10 @@
4452
"AsyncInferencePipelinesResourceWithRawResponse",
4553
"InferencePipelinesResourceWithStreamingResponse",
4654
"AsyncInferencePipelinesResourceWithStreamingResponse",
55+
"StorageResource",
56+
"AsyncStorageResource",
57+
"StorageResourceWithRawResponse",
58+
"AsyncStorageResourceWithRawResponse",
59+
"StorageResourceWithStreamingResponse",
60+
"AsyncStorageResourceWithStreamingResponse",
4761
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from .storage import (
4+
StorageResource,
5+
AsyncStorageResource,
6+
StorageResourceWithRawResponse,
7+
AsyncStorageResourceWithRawResponse,
8+
StorageResourceWithStreamingResponse,
9+
AsyncStorageResourceWithStreamingResponse,
10+
)
11+
from .presigned_url import (
12+
PresignedURLResource,
13+
AsyncPresignedURLResource,
14+
PresignedURLResourceWithRawResponse,
15+
AsyncPresignedURLResourceWithRawResponse,
16+
PresignedURLResourceWithStreamingResponse,
17+
AsyncPresignedURLResourceWithStreamingResponse,
18+
)
19+
20+
__all__ = [
21+
"PresignedURLResource",
22+
"AsyncPresignedURLResource",
23+
"PresignedURLResourceWithRawResponse",
24+
"AsyncPresignedURLResourceWithRawResponse",
25+
"PresignedURLResourceWithStreamingResponse",
26+
"AsyncPresignedURLResourceWithStreamingResponse",
27+
"StorageResource",
28+
"AsyncStorageResource",
29+
"StorageResourceWithRawResponse",
30+
"AsyncStorageResourceWithRawResponse",
31+
"StorageResourceWithStreamingResponse",
32+
"AsyncStorageResourceWithStreamingResponse",
33+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
import httpx
6+
7+
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
8+
from ..._utils import (
9+
maybe_transform,
10+
async_maybe_transform,
11+
)
12+
from ..._compat import cached_property
13+
from ..._resource import SyncAPIResource, AsyncAPIResource
14+
from ..._response import (
15+
to_raw_response_wrapper,
16+
to_streamed_response_wrapper,
17+
async_to_raw_response_wrapper,
18+
async_to_streamed_response_wrapper,
19+
)
20+
from ..._base_client import make_request_options
21+
from ...types.storage import presigned_url_create_params
22+
from ...types.storage.presigned_url_create_response import PresignedURLCreateResponse
23+
24+
__all__ = ["PresignedURLResource", "AsyncPresignedURLResource"]
25+
26+
27+
class PresignedURLResource(SyncAPIResource):
28+
@cached_property
29+
def with_raw_response(self) -> PresignedURLResourceWithRawResponse:
30+
return PresignedURLResourceWithRawResponse(self)
31+
32+
@cached_property
33+
def with_streaming_response(self) -> PresignedURLResourceWithStreamingResponse:
34+
return PresignedURLResourceWithStreamingResponse(self)
35+
36+
def create(
37+
self,
38+
*,
39+
object_name: str,
40+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
41+
# The extra values given here take precedence over values defined on the client or passed to this method.
42+
extra_headers: Headers | None = None,
43+
extra_query: Query | None = None,
44+
extra_body: Body | None = None,
45+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
46+
) -> PresignedURLCreateResponse:
47+
"""
48+
Retrieve a presigned url to post storage artifacts.
49+
50+
Args:
51+
object_name: The name of the object.
52+
53+
extra_headers: Send extra headers
54+
55+
extra_query: Add additional query parameters to the request
56+
57+
extra_body: Add additional JSON properties to the request
58+
59+
timeout: Override the client-level default timeout for this request, in seconds
60+
"""
61+
return self._post(
62+
"/storage/presigned-url",
63+
options=make_request_options(
64+
extra_headers=extra_headers,
65+
extra_query=extra_query,
66+
extra_body=extra_body,
67+
timeout=timeout,
68+
query=maybe_transform(
69+
{"object_name": object_name}, presigned_url_create_params.PresignedURLCreateParams
70+
),
71+
),
72+
cast_to=PresignedURLCreateResponse,
73+
)
74+
75+
76+
class AsyncPresignedURLResource(AsyncAPIResource):
77+
@cached_property
78+
def with_raw_response(self) -> AsyncPresignedURLResourceWithRawResponse:
79+
return AsyncPresignedURLResourceWithRawResponse(self)
80+
81+
@cached_property
82+
def with_streaming_response(self) -> AsyncPresignedURLResourceWithStreamingResponse:
83+
return AsyncPresignedURLResourceWithStreamingResponse(self)
84+
85+
async def create(
86+
self,
87+
*,
88+
object_name: str,
89+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
90+
# The extra values given here take precedence over values defined on the client or passed to this method.
91+
extra_headers: Headers | None = None,
92+
extra_query: Query | None = None,
93+
extra_body: Body | None = None,
94+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
95+
) -> PresignedURLCreateResponse:
96+
"""
97+
Retrieve a presigned url to post storage artifacts.
98+
99+
Args:
100+
object_name: The name of the object.
101+
102+
extra_headers: Send extra headers
103+
104+
extra_query: Add additional query parameters to the request
105+
106+
extra_body: Add additional JSON properties to the request
107+
108+
timeout: Override the client-level default timeout for this request, in seconds
109+
"""
110+
return await self._post(
111+
"/storage/presigned-url",
112+
options=make_request_options(
113+
extra_headers=extra_headers,
114+
extra_query=extra_query,
115+
extra_body=extra_body,
116+
timeout=timeout,
117+
query=await async_maybe_transform(
118+
{"object_name": object_name}, presigned_url_create_params.PresignedURLCreateParams
119+
),
120+
),
121+
cast_to=PresignedURLCreateResponse,
122+
)
123+
124+
125+
class PresignedURLResourceWithRawResponse:
126+
def __init__(self, presigned_url: PresignedURLResource) -> None:
127+
self._presigned_url = presigned_url
128+
129+
self.create = to_raw_response_wrapper(
130+
presigned_url.create,
131+
)
132+
133+
134+
class AsyncPresignedURLResourceWithRawResponse:
135+
def __init__(self, presigned_url: AsyncPresignedURLResource) -> None:
136+
self._presigned_url = presigned_url
137+
138+
self.create = async_to_raw_response_wrapper(
139+
presigned_url.create,
140+
)
141+
142+
143+
class PresignedURLResourceWithStreamingResponse:
144+
def __init__(self, presigned_url: PresignedURLResource) -> None:
145+
self._presigned_url = presigned_url
146+
147+
self.create = to_streamed_response_wrapper(
148+
presigned_url.create,
149+
)
150+
151+
152+
class AsyncPresignedURLResourceWithStreamingResponse:
153+
def __init__(self, presigned_url: AsyncPresignedURLResource) -> None:
154+
self._presigned_url = presigned_url
155+
156+
self.create = async_to_streamed_response_wrapper(
157+
presigned_url.create,
158+
)
+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from ..._compat import cached_property
6+
from ..._resource import SyncAPIResource, AsyncAPIResource
7+
from .presigned_url import (
8+
PresignedURLResource,
9+
AsyncPresignedURLResource,
10+
PresignedURLResourceWithRawResponse,
11+
AsyncPresignedURLResourceWithRawResponse,
12+
PresignedURLResourceWithStreamingResponse,
13+
AsyncPresignedURLResourceWithStreamingResponse,
14+
)
15+
16+
__all__ = ["StorageResource", "AsyncStorageResource"]
17+
18+
19+
class StorageResource(SyncAPIResource):
20+
@cached_property
21+
def presigned_url(self) -> PresignedURLResource:
22+
return PresignedURLResource(self._client)
23+
24+
@cached_property
25+
def with_raw_response(self) -> StorageResourceWithRawResponse:
26+
return StorageResourceWithRawResponse(self)
27+
28+
@cached_property
29+
def with_streaming_response(self) -> StorageResourceWithStreamingResponse:
30+
return StorageResourceWithStreamingResponse(self)
31+
32+
33+
class AsyncStorageResource(AsyncAPIResource):
34+
@cached_property
35+
def presigned_url(self) -> AsyncPresignedURLResource:
36+
return AsyncPresignedURLResource(self._client)
37+
38+
@cached_property
39+
def with_raw_response(self) -> AsyncStorageResourceWithRawResponse:
40+
return AsyncStorageResourceWithRawResponse(self)
41+
42+
@cached_property
43+
def with_streaming_response(self) -> AsyncStorageResourceWithStreamingResponse:
44+
return AsyncStorageResourceWithStreamingResponse(self)
45+
46+
47+
class StorageResourceWithRawResponse:
48+
def __init__(self, storage: StorageResource) -> None:
49+
self._storage = storage
50+
51+
@cached_property
52+
def presigned_url(self) -> PresignedURLResourceWithRawResponse:
53+
return PresignedURLResourceWithRawResponse(self._storage.presigned_url)
54+
55+
56+
class AsyncStorageResourceWithRawResponse:
57+
def __init__(self, storage: AsyncStorageResource) -> None:
58+
self._storage = storage
59+
60+
@cached_property
61+
def presigned_url(self) -> AsyncPresignedURLResourceWithRawResponse:
62+
return AsyncPresignedURLResourceWithRawResponse(self._storage.presigned_url)
63+
64+
65+
class StorageResourceWithStreamingResponse:
66+
def __init__(self, storage: StorageResource) -> None:
67+
self._storage = storage
68+
69+
@cached_property
70+
def presigned_url(self) -> PresignedURLResourceWithStreamingResponse:
71+
return PresignedURLResourceWithStreamingResponse(self._storage.presigned_url)
72+
73+
74+
class AsyncStorageResourceWithStreamingResponse:
75+
def __init__(self, storage: AsyncStorageResource) -> None:
76+
self._storage = storage
77+
78+
@cached_property
79+
def presigned_url(self) -> AsyncPresignedURLResourceWithStreamingResponse:
80+
return AsyncPresignedURLResourceWithStreamingResponse(self._storage.presigned_url)
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from .presigned_url_create_params import PresignedURLCreateParams as PresignedURLCreateParams
6+
from .presigned_url_create_response import PresignedURLCreateResponse as PresignedURLCreateResponse

0 commit comments

Comments
 (0)