Skip to content

NOTICE: Stainless generated code has conflicted with your custom code #115

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

Closed
Closed
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.1.0-alpha.17"
".": "0.1.0-alpha.18"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
configured_endpoints: 43
openapi_spec_hash: b7beefbd38b4fcdd191cdb81a18a023b
openapi_spec_hash: 51dd9bdb04307116617d3eefe3237755
config_hash: 5e459b33c53ffa6e554087a779bdb790
2 changes: 1 addition & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ Methods:
- <code title="get /api/projects/">client.projects.<a href="./src/codex/resources/projects/projects.py">list</a>(\*\*<a href="src/codex/types/project_list_params.py">params</a>) -> <a href="./src/codex/types/project_list_response.py">ProjectListResponse</a></code>
- <code title="delete /api/projects/{project_id}">client.projects.<a href="./src/codex/resources/projects/projects.py">delete</a>(project_id) -> None</code>
- <code title="get /api/projects/{project_id}/export">client.projects.<a href="./src/codex/resources/projects/projects.py">export</a>(project_id) -> <a href="./src/codex/types/project_export_response.py">object</a></code>
- <code title="post /api/projects/{project_id}/increment_queries">client.projects.<a href="./src/codex/resources/projects/projects.py">increment_queries</a>(project_id) -> <a href="./src/codex/types/project_increment_queries_response.py">object</a></code>
- <code title="post /api/projects/{project_id}/increment_queries">client.projects.<a href="./src/codex/resources/projects/projects.py">increment_queries</a>(project_id, \*\*<a href="src/codex/types/project_increment_queries_params.py">params</a>) -> <a href="./src/codex/types/project_increment_queries_response.py">object</a></code>
- <code title="get /api/projects/{project_id}/analytics/">client.projects.<a href="./src/codex/resources/projects/projects.py">retrieve_analytics</a>(project_id, \*\*<a href="src/codex/types/project_retrieve_analytics_params.py">params</a>) -> <a href="./src/codex/types/project_retrieve_analytics_response.py">ProjectRetrieveAnalyticsResponse</a></code>

## AccessKeys
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 = "codex-sdk"
version = "0.1.0-alpha.17"
version = "0.1.0-alpha.18"
description = "The official Python library for the Codex API"
dynamic = ["readme"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion src/codex/_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__ = "codex"
__version__ = "0.1.0-alpha.17" # x-release-please-version
__version__ = "0.1.0-alpha.18" # x-release-please-version
17 changes: 15 additions & 2 deletions src/codex/resources/projects/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
project_list_params,
project_create_params,
project_update_params,
project_increment_queries_params,
project_retrieve_analytics_params,
)
from .entries import (
Expand Down Expand Up @@ -331,6 +332,7 @@ def increment_queries(
self,
project_id: str,
*,
count: int | NotGiven = NOT_GIVEN,
# 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,
Expand All @@ -355,7 +357,11 @@ def increment_queries(
return self._post(
f"/api/projects/{project_id}/increment_queries",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform({"count": count}, project_increment_queries_params.ProjectIncrementQueriesParams),
),
cast_to=object,
)
Expand Down Expand Up @@ -685,6 +691,7 @@ async def increment_queries(
self,
project_id: str,
*,
count: int | NotGiven = NOT_GIVEN,
# 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,
Expand All @@ -709,7 +716,13 @@ async def increment_queries(
return await self._post(
f"/api/projects/{project_id}/increment_queries",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=await async_maybe_transform(
{"count": count}, project_increment_queries_params.ProjectIncrementQueriesParams
),
),
cast_to=object,
)
Expand Down
1 change: 1 addition & 0 deletions src/codex/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from .project_retrieve_response import ProjectRetrieveResponse as ProjectRetrieveResponse
from .organization_schema_public import OrganizationSchemaPublic as OrganizationSchemaPublic
from .user_activate_account_params import UserActivateAccountParams as UserActivateAccountParams
from .project_increment_queries_params import ProjectIncrementQueriesParams as ProjectIncrementQueriesParams
from .project_retrieve_analytics_params import ProjectRetrieveAnalyticsParams as ProjectRetrieveAnalyticsParams
from .organization_list_members_response import OrganizationListMembersResponse as OrganizationListMembersResponse
from .project_retrieve_analytics_response import ProjectRetrieveAnalyticsResponse as ProjectRetrieveAnalyticsResponse
Expand Down
11 changes: 11 additions & 0 deletions src/codex/types/project_increment_queries_params.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing_extensions import TypedDict

__all__ = ["ProjectIncrementQueriesParams"]


class ProjectIncrementQueriesParams(TypedDict, total=False):
count: int
34 changes: 26 additions & 8 deletions tests/api_resources/test_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,15 +322,24 @@ def test_path_params_export(self, client: Codex) -> None:
@parametrize
def test_method_increment_queries(self, client: Codex) -> None:
project = client.projects.increment_queries(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
assert_matches_type(object, project, path=["response"])

@pytest.mark.skip()
@parametrize
def test_method_increment_queries_with_all_params(self, client: Codex) -> None:
project = client.projects.increment_queries(
project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
count=0,
)
assert_matches_type(object, project, path=["response"])

@pytest.mark.skip()
@parametrize
def test_raw_response_increment_queries(self, client: Codex) -> None:
response = client.projects.with_raw_response.increment_queries(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)

assert response.is_closed is True
Expand All @@ -342,7 +351,7 @@ def test_raw_response_increment_queries(self, client: Codex) -> None:
@parametrize
def test_streaming_response_increment_queries(self, client: Codex) -> None:
with client.projects.with_streaming_response.increment_queries(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand All @@ -357,7 +366,7 @@ def test_streaming_response_increment_queries(self, client: Codex) -> None:
def test_path_params_increment_queries(self, client: Codex) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `project_id` but received ''"):
client.projects.with_raw_response.increment_queries(
"",
project_id="",
)

@pytest.mark.skip()
Expand Down Expand Up @@ -716,15 +725,24 @@ async def test_path_params_export(self, async_client: AsyncCodex) -> None:
@parametrize
async def test_method_increment_queries(self, async_client: AsyncCodex) -> None:
project = await async_client.projects.increment_queries(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
assert_matches_type(object, project, path=["response"])

@pytest.mark.skip()
@parametrize
async def test_method_increment_queries_with_all_params(self, async_client: AsyncCodex) -> None:
project = await async_client.projects.increment_queries(
project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
count=0,
)
assert_matches_type(object, project, path=["response"])

@pytest.mark.skip()
@parametrize
async def test_raw_response_increment_queries(self, async_client: AsyncCodex) -> None:
response = await async_client.projects.with_raw_response.increment_queries(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)

assert response.is_closed is True
Expand All @@ -736,7 +754,7 @@ async def test_raw_response_increment_queries(self, async_client: AsyncCodex) ->
@parametrize
async def test_streaming_response_increment_queries(self, async_client: AsyncCodex) -> None:
async with async_client.projects.with_streaming_response.increment_queries(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand All @@ -751,7 +769,7 @@ async def test_streaming_response_increment_queries(self, async_client: AsyncCod
async def test_path_params_increment_queries(self, async_client: AsyncCodex) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `project_id` but received ''"):
await async_client.projects.with_raw_response.increment_queries(
"",
project_id="",
)

@pytest.mark.skip()
Expand Down