Skip to content

feat(api): update via SDK Studio #270

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 9
configured_endpoints: 10
14 changes: 14 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,17 @@ from openlayer.types.inference_pipelines import TestResultListResponse
Methods:

- <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>

# Storage

## PresignedURL

Types:

```python
from openlayer.types.storage import PresignedURLCreateResponse
```

Methods:

- <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>
8 changes: 8 additions & 0 deletions src/openlayer/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class Openlayer(SyncAPIClient):
projects: resources.ProjectsResource
commits: resources.CommitsResource
inference_pipelines: resources.InferencePipelinesResource
storage: resources.StorageResource
with_raw_response: OpenlayerWithRawResponse
with_streaming_response: OpenlayerWithStreamedResponse

Expand Down Expand Up @@ -106,6 +107,7 @@ def __init__(
self.projects = resources.ProjectsResource(self)
self.commits = resources.CommitsResource(self)
self.inference_pipelines = resources.InferencePipelinesResource(self)
self.storage = resources.StorageResource(self)
self.with_raw_response = OpenlayerWithRawResponse(self)
self.with_streaming_response = OpenlayerWithStreamedResponse(self)

Expand Down Expand Up @@ -231,6 +233,7 @@ class AsyncOpenlayer(AsyncAPIClient):
projects: resources.AsyncProjectsResource
commits: resources.AsyncCommitsResource
inference_pipelines: resources.AsyncInferencePipelinesResource
storage: resources.AsyncStorageResource
with_raw_response: AsyncOpenlayerWithRawResponse
with_streaming_response: AsyncOpenlayerWithStreamedResponse

Expand Down Expand Up @@ -287,6 +290,7 @@ def __init__(
self.projects = resources.AsyncProjectsResource(self)
self.commits = resources.AsyncCommitsResource(self)
self.inference_pipelines = resources.AsyncInferencePipelinesResource(self)
self.storage = resources.AsyncStorageResource(self)
self.with_raw_response = AsyncOpenlayerWithRawResponse(self)
self.with_streaming_response = AsyncOpenlayerWithStreamedResponse(self)

Expand Down Expand Up @@ -413,20 +417,23 @@ def __init__(self, client: Openlayer) -> None:
self.projects = resources.ProjectsResourceWithRawResponse(client.projects)
self.commits = resources.CommitsResourceWithRawResponse(client.commits)
self.inference_pipelines = resources.InferencePipelinesResourceWithRawResponse(client.inference_pipelines)
self.storage = resources.StorageResourceWithRawResponse(client.storage)


class AsyncOpenlayerWithRawResponse:
def __init__(self, client: AsyncOpenlayer) -> None:
self.projects = resources.AsyncProjectsResourceWithRawResponse(client.projects)
self.commits = resources.AsyncCommitsResourceWithRawResponse(client.commits)
self.inference_pipelines = resources.AsyncInferencePipelinesResourceWithRawResponse(client.inference_pipelines)
self.storage = resources.AsyncStorageResourceWithRawResponse(client.storage)


class OpenlayerWithStreamedResponse:
def __init__(self, client: Openlayer) -> None:
self.projects = resources.ProjectsResourceWithStreamingResponse(client.projects)
self.commits = resources.CommitsResourceWithStreamingResponse(client.commits)
self.inference_pipelines = resources.InferencePipelinesResourceWithStreamingResponse(client.inference_pipelines)
self.storage = resources.StorageResourceWithStreamingResponse(client.storage)


class AsyncOpenlayerWithStreamedResponse:
Expand All @@ -436,6 +443,7 @@ def __init__(self, client: AsyncOpenlayer) -> None:
self.inference_pipelines = resources.AsyncInferencePipelinesResourceWithStreamingResponse(
client.inference_pipelines
)
self.storage = resources.AsyncStorageResourceWithStreamingResponse(client.storage)


Client = Openlayer
Expand Down
14 changes: 14 additions & 0 deletions src/openlayer/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
CommitsResourceWithStreamingResponse,
AsyncCommitsResourceWithStreamingResponse,
)
from .storage import (
StorageResource,
AsyncStorageResource,
StorageResourceWithRawResponse,
AsyncStorageResourceWithRawResponse,
StorageResourceWithStreamingResponse,
AsyncStorageResourceWithStreamingResponse,
)
from .projects import (
ProjectsResource,
AsyncProjectsResource,
Expand Down Expand Up @@ -44,4 +52,10 @@
"AsyncInferencePipelinesResourceWithRawResponse",
"InferencePipelinesResourceWithStreamingResponse",
"AsyncInferencePipelinesResourceWithStreamingResponse",
"StorageResource",
"AsyncStorageResource",
"StorageResourceWithRawResponse",
"AsyncStorageResourceWithRawResponse",
"StorageResourceWithStreamingResponse",
"AsyncStorageResourceWithStreamingResponse",
]
33 changes: 33 additions & 0 deletions src/openlayer/resources/storage/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from .storage import (
StorageResource,
AsyncStorageResource,
StorageResourceWithRawResponse,
AsyncStorageResourceWithRawResponse,
StorageResourceWithStreamingResponse,
AsyncStorageResourceWithStreamingResponse,
)
from .presigned_url import (
PresignedURLResource,
AsyncPresignedURLResource,
PresignedURLResourceWithRawResponse,
AsyncPresignedURLResourceWithRawResponse,
PresignedURLResourceWithStreamingResponse,
AsyncPresignedURLResourceWithStreamingResponse,
)

__all__ = [
"PresignedURLResource",
"AsyncPresignedURLResource",
"PresignedURLResourceWithRawResponse",
"AsyncPresignedURLResourceWithRawResponse",
"PresignedURLResourceWithStreamingResponse",
"AsyncPresignedURLResourceWithStreamingResponse",
"StorageResource",
"AsyncStorageResource",
"StorageResourceWithRawResponse",
"AsyncStorageResourceWithRawResponse",
"StorageResourceWithStreamingResponse",
"AsyncStorageResourceWithStreamingResponse",
]
158 changes: 158 additions & 0 deletions src/openlayer/resources/storage/presigned_url.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

import httpx

from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._utils import (
maybe_transform,
async_maybe_transform,
)
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
to_raw_response_wrapper,
to_streamed_response_wrapper,
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
from ..._base_client import make_request_options
from ...types.storage import presigned_url_create_params
from ...types.storage.presigned_url_create_response import PresignedURLCreateResponse

__all__ = ["PresignedURLResource", "AsyncPresignedURLResource"]


class PresignedURLResource(SyncAPIResource):
@cached_property
def with_raw_response(self) -> PresignedURLResourceWithRawResponse:
return PresignedURLResourceWithRawResponse(self)

@cached_property
def with_streaming_response(self) -> PresignedURLResourceWithStreamingResponse:
return PresignedURLResourceWithStreamingResponse(self)

def create(
self,
*,
object_name: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> PresignedURLCreateResponse:
"""
Retrieve a presigned url to post storage artifacts.

Args:
object_name: The name of the object.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
return self._post(
"/storage/presigned-url",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform(
{"object_name": object_name}, presigned_url_create_params.PresignedURLCreateParams
),
),
cast_to=PresignedURLCreateResponse,
)


class AsyncPresignedURLResource(AsyncAPIResource):
@cached_property
def with_raw_response(self) -> AsyncPresignedURLResourceWithRawResponse:
return AsyncPresignedURLResourceWithRawResponse(self)

@cached_property
def with_streaming_response(self) -> AsyncPresignedURLResourceWithStreamingResponse:
return AsyncPresignedURLResourceWithStreamingResponse(self)

async def create(
self,
*,
object_name: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> PresignedURLCreateResponse:
"""
Retrieve a presigned url to post storage artifacts.

Args:
object_name: The name of the object.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
return await self._post(
"/storage/presigned-url",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=await async_maybe_transform(
{"object_name": object_name}, presigned_url_create_params.PresignedURLCreateParams
),
),
cast_to=PresignedURLCreateResponse,
)


class PresignedURLResourceWithRawResponse:
def __init__(self, presigned_url: PresignedURLResource) -> None:
self._presigned_url = presigned_url

self.create = to_raw_response_wrapper(
presigned_url.create,
)


class AsyncPresignedURLResourceWithRawResponse:
def __init__(self, presigned_url: AsyncPresignedURLResource) -> None:
self._presigned_url = presigned_url

self.create = async_to_raw_response_wrapper(
presigned_url.create,
)


class PresignedURLResourceWithStreamingResponse:
def __init__(self, presigned_url: PresignedURLResource) -> None:
self._presigned_url = presigned_url

self.create = to_streamed_response_wrapper(
presigned_url.create,
)


class AsyncPresignedURLResourceWithStreamingResponse:
def __init__(self, presigned_url: AsyncPresignedURLResource) -> None:
self._presigned_url = presigned_url

self.create = async_to_streamed_response_wrapper(
presigned_url.create,
)
80 changes: 80 additions & 0 deletions src/openlayer/resources/storage/storage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from .presigned_url import (
PresignedURLResource,
AsyncPresignedURLResource,
PresignedURLResourceWithRawResponse,
AsyncPresignedURLResourceWithRawResponse,
PresignedURLResourceWithStreamingResponse,
AsyncPresignedURLResourceWithStreamingResponse,
)

__all__ = ["StorageResource", "AsyncStorageResource"]


class StorageResource(SyncAPIResource):
@cached_property
def presigned_url(self) -> PresignedURLResource:
return PresignedURLResource(self._client)

@cached_property
def with_raw_response(self) -> StorageResourceWithRawResponse:
return StorageResourceWithRawResponse(self)

@cached_property
def with_streaming_response(self) -> StorageResourceWithStreamingResponse:
return StorageResourceWithStreamingResponse(self)


class AsyncStorageResource(AsyncAPIResource):
@cached_property
def presigned_url(self) -> AsyncPresignedURLResource:
return AsyncPresignedURLResource(self._client)

@cached_property
def with_raw_response(self) -> AsyncStorageResourceWithRawResponse:
return AsyncStorageResourceWithRawResponse(self)

@cached_property
def with_streaming_response(self) -> AsyncStorageResourceWithStreamingResponse:
return AsyncStorageResourceWithStreamingResponse(self)


class StorageResourceWithRawResponse:
def __init__(self, storage: StorageResource) -> None:
self._storage = storage

@cached_property
def presigned_url(self) -> PresignedURLResourceWithRawResponse:
return PresignedURLResourceWithRawResponse(self._storage.presigned_url)


class AsyncStorageResourceWithRawResponse:
def __init__(self, storage: AsyncStorageResource) -> None:
self._storage = storage

@cached_property
def presigned_url(self) -> AsyncPresignedURLResourceWithRawResponse:
return AsyncPresignedURLResourceWithRawResponse(self._storage.presigned_url)


class StorageResourceWithStreamingResponse:
def __init__(self, storage: StorageResource) -> None:
self._storage = storage

@cached_property
def presigned_url(self) -> PresignedURLResourceWithStreamingResponse:
return PresignedURLResourceWithStreamingResponse(self._storage.presigned_url)


class AsyncStorageResourceWithStreamingResponse:
def __init__(self, storage: AsyncStorageResource) -> None:
self._storage = storage

@cached_property
def presigned_url(self) -> AsyncPresignedURLResourceWithStreamingResponse:
return AsyncPresignedURLResourceWithStreamingResponse(self._storage.presigned_url)
6 changes: 6 additions & 0 deletions src/openlayer/types/storage/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from .presigned_url_create_params import PresignedURLCreateParams as PresignedURLCreateParams
from .presigned_url_create_response import PresignedURLCreateResponse as PresignedURLCreateResponse
Loading