Skip to content
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 .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.14.0"
".": "0.14.1"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
configured_endpoints: 25
openapi_spec_hash: 4eff18b3478c98a9b257ac27fdeb6b49
config_hash: b415187e3925c414fb2597cdd0a11859
configured_endpoints: 26
openapi_spec_hash: 6f6cb98b7755d18274dd51e857508336
config_hash: cc9a32249c08143687799eb8de187d6a
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## 0.14.1 (2026-01-12)

Full Changelog: [v0.14.0...v0.14.1](https://github.com/openlayer-ai/openlayer-python/compare/v0.14.0...v0.14.1)

### Chores

* **closes OPEN-8576:** expose delete project endpoint ([be1251f](https://github.com/openlayer-ai/openlayer-python/commit/be1251fc75bf67a46f55f1e999993d92c2c75e7b))

## 0.14.0 (2026-01-09)

Full Changelog: [v0.13.1...v0.14.0](https://github.com/openlayer-ai/openlayer-python/compare/v0.13.1...v0.14.0)
Expand Down
1 change: 1 addition & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Methods:

- <code title="post /projects">client.projects.<a href="./src/openlayer/resources/projects/projects.py">create</a>(\*\*<a href="src/openlayer/types/project_create_params.py">params</a>) -> <a href="./src/openlayer/types/project_create_response.py">ProjectCreateResponse</a></code>
- <code title="get /projects">client.projects.<a href="./src/openlayer/resources/projects/projects.py">list</a>(\*\*<a href="src/openlayer/types/project_list_params.py">params</a>) -> <a href="./src/openlayer/types/project_list_response.py">ProjectListResponse</a></code>
- <code title="delete /projects/{projectId}">client.projects.<a href="./src/openlayer/resources/projects/projects.py">delete</a>(project_id) -> None</code>

## Commits

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "openlayer"
version = "0.14.0"
version = "0.14.1"
description = "The official Python library for the openlayer API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/openlayer/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "openlayer"
__version__ = "0.14.0" # x-release-please-version
__version__ = "0.14.1" # x-release-please-version
82 changes: 81 additions & 1 deletion src/openlayer/resources/projects/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
CommitsResourceWithStreamingResponse,
AsyncCommitsResourceWithStreamingResponse,
)
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given
from ..._utils import maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
Expand Down Expand Up @@ -183,6 +183,40 @@ def list(
cast_to=ProjectListResponse,
)

def delete(
self,
project_id: 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,
) -> None:
"""
Delete a project by its ID.

Args:
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
"""
if not project_id:
raise ValueError(f"Expected a non-empty value for `project_id` but received {project_id!r}")
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
return self._delete(
f"/projects/{project_id}",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=NoneType,
)


class AsyncProjectsResource(AsyncAPIResource):
@cached_property
Expand Down Expand Up @@ -318,6 +352,40 @@ async def list(
cast_to=ProjectListResponse,
)

async def delete(
self,
project_id: 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,
) -> None:
"""
Delete a project by its ID.

Args:
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
"""
if not project_id:
raise ValueError(f"Expected a non-empty value for `project_id` but received {project_id!r}")
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
return await self._delete(
f"/projects/{project_id}",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=NoneType,
)


class ProjectsResourceWithRawResponse:
def __init__(self, projects: ProjectsResource) -> None:
Expand All @@ -329,6 +397,9 @@ def __init__(self, projects: ProjectsResource) -> None:
self.list = to_raw_response_wrapper(
projects.list,
)
self.delete = to_raw_response_wrapper(
projects.delete,
)

@cached_property
def commits(self) -> CommitsResourceWithRawResponse:
Expand All @@ -353,6 +424,9 @@ def __init__(self, projects: AsyncProjectsResource) -> None:
self.list = async_to_raw_response_wrapper(
projects.list,
)
self.delete = async_to_raw_response_wrapper(
projects.delete,
)

@cached_property
def commits(self) -> AsyncCommitsResourceWithRawResponse:
Expand All @@ -377,6 +451,9 @@ def __init__(self, projects: ProjectsResource) -> None:
self.list = to_streamed_response_wrapper(
projects.list,
)
self.delete = to_streamed_response_wrapper(
projects.delete,
)

@cached_property
def commits(self) -> CommitsResourceWithStreamingResponse:
Expand All @@ -401,6 +478,9 @@ def __init__(self, projects: AsyncProjectsResource) -> None:
self.list = async_to_streamed_response_wrapper(
projects.list,
)
self.delete = async_to_streamed_response_wrapper(
projects.delete,
)

@cached_property
def commits(self) -> AsyncCommitsResourceWithStreamingResponse:
Expand Down
76 changes: 76 additions & 0 deletions tests/api_resources/test_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,44 @@ def test_streaming_response_list(self, client: Openlayer) -> None:

assert cast(Any, response.is_closed) is True

@parametrize
def test_method_delete(self, client: Openlayer) -> None:
project = client.projects.delete(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
assert project is None

@parametrize
def test_raw_response_delete(self, client: Openlayer) -> None:
response = client.projects.with_raw_response.delete(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)

assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
project = response.parse()
assert project is None

@parametrize
def test_streaming_response_delete(self, client: Openlayer) -> None:
with client.projects.with_streaming_response.delete(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

project = response.parse()
assert project is None

assert cast(Any, response.is_closed) is True

@parametrize
def test_path_params_delete(self, client: Openlayer) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `project_id` but received ''"):
client.projects.with_raw_response.delete(
"",
)


class TestAsyncProjects:
parametrize = pytest.mark.parametrize(
Expand Down Expand Up @@ -178,3 +216,41 @@ async def test_streaming_response_list(self, async_client: AsyncOpenlayer) -> No
assert_matches_type(ProjectListResponse, project, path=["response"])

assert cast(Any, response.is_closed) is True

@parametrize
async def test_method_delete(self, async_client: AsyncOpenlayer) -> None:
project = await async_client.projects.delete(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
assert project is None

@parametrize
async def test_raw_response_delete(self, async_client: AsyncOpenlayer) -> None:
response = await async_client.projects.with_raw_response.delete(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)

assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
project = await response.parse()
assert project is None

@parametrize
async def test_streaming_response_delete(self, async_client: AsyncOpenlayer) -> None:
async with async_client.projects.with_streaming_response.delete(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

project = await response.parse()
assert project is None

assert cast(Any, response.is_closed) is True

@parametrize
async def test_path_params_delete(self, async_client: AsyncOpenlayer) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `project_id` but received ''"):
await async_client.projects.with_raw_response.delete(
"",
)