Skip to content

Commit f08afc1

Browse files
feat(api): api update
1 parent 32906a5 commit f08afc1

File tree

9 files changed

+58
-15
lines changed

9 files changed

+58
-15
lines changed

.release-please-manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.1.0-alpha.17"
2+
".": "0.1.0-alpha.18"
33
}

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
configured_endpoints: 43
2-
openapi_spec_hash: b7beefbd38b4fcdd191cdb81a18a023b
2+
openapi_spec_hash: 51dd9bdb04307116617d3eefe3237755
33
config_hash: 5e459b33c53ffa6e554087a779bdb790

api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ Methods:
153153
- <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>
154154
- <code title="delete /api/projects/{project_id}">client.projects.<a href="./src/codex/resources/projects/projects.py">delete</a>(project_id) -> None</code>
155155
- <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>
156-
- <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>
156+
- <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>
157157
- <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>
158158

159159
## AccessKeys

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "codex-sdk"
3-
version = "0.1.0-alpha.17"
3+
version = "0.1.0-alpha.18"
44
description = "The official Python library for the Codex API"
55
dynamic = ["readme"]
66
license = "MIT"

src/codex/_version.py

+1-1
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__ = "codex"
4-
__version__ = "0.1.0-alpha.17" # x-release-please-version
4+
__version__ = "0.1.0-alpha.18" # x-release-please-version

src/codex/resources/projects/projects.py

+15-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
project_list_params,
1212
project_create_params,
1313
project_update_params,
14+
project_increment_queries_params,
1415
project_retrieve_analytics_params,
1516
)
1617
from .entries import (
@@ -331,6 +332,7 @@ def increment_queries(
331332
self,
332333
project_id: str,
333334
*,
335+
count: int | NotGiven = NOT_GIVEN,
334336
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
335337
# The extra values given here take precedence over values defined on the client or passed to this method.
336338
extra_headers: Headers | None = None,
@@ -355,7 +357,11 @@ def increment_queries(
355357
return self._post(
356358
f"/api/projects/{project_id}/increment_queries",
357359
options=make_request_options(
358-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
360+
extra_headers=extra_headers,
361+
extra_query=extra_query,
362+
extra_body=extra_body,
363+
timeout=timeout,
364+
query=maybe_transform({"count": count}, project_increment_queries_params.ProjectIncrementQueriesParams),
359365
),
360366
cast_to=object,
361367
)
@@ -685,6 +691,7 @@ async def increment_queries(
685691
self,
686692
project_id: str,
687693
*,
694+
count: int | NotGiven = NOT_GIVEN,
688695
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
689696
# The extra values given here take precedence over values defined on the client or passed to this method.
690697
extra_headers: Headers | None = None,
@@ -709,7 +716,13 @@ async def increment_queries(
709716
return await self._post(
710717
f"/api/projects/{project_id}/increment_queries",
711718
options=make_request_options(
712-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
719+
extra_headers=extra_headers,
720+
extra_query=extra_query,
721+
extra_body=extra_body,
722+
timeout=timeout,
723+
query=await async_maybe_transform(
724+
{"count": count}, project_increment_queries_params.ProjectIncrementQueriesParams
725+
),
713726
),
714727
cast_to=object,
715728
)

src/codex/types/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from .project_retrieve_response import ProjectRetrieveResponse as ProjectRetrieveResponse
1616
from .organization_schema_public import OrganizationSchemaPublic as OrganizationSchemaPublic
1717
from .user_activate_account_params import UserActivateAccountParams as UserActivateAccountParams
18+
from .project_increment_queries_params import ProjectIncrementQueriesParams as ProjectIncrementQueriesParams
1819
from .project_retrieve_analytics_params import ProjectRetrieveAnalyticsParams as ProjectRetrieveAnalyticsParams
1920
from .organization_list_members_response import OrganizationListMembersResponse as OrganizationListMembersResponse
2021
from .project_retrieve_analytics_response import ProjectRetrieveAnalyticsResponse as ProjectRetrieveAnalyticsResponse
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import TypedDict
6+
7+
__all__ = ["ProjectIncrementQueriesParams"]
8+
9+
10+
class ProjectIncrementQueriesParams(TypedDict, total=False):
11+
count: int

tests/api_resources/test_projects.py

+26-8
Original file line numberDiff line numberDiff line change
@@ -322,15 +322,24 @@ def test_path_params_export(self, client: Codex) -> None:
322322
@parametrize
323323
def test_method_increment_queries(self, client: Codex) -> None:
324324
project = client.projects.increment_queries(
325-
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
325+
project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
326+
)
327+
assert_matches_type(object, project, path=["response"])
328+
329+
@pytest.mark.skip()
330+
@parametrize
331+
def test_method_increment_queries_with_all_params(self, client: Codex) -> None:
332+
project = client.projects.increment_queries(
333+
project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
334+
count=0,
326335
)
327336
assert_matches_type(object, project, path=["response"])
328337

329338
@pytest.mark.skip()
330339
@parametrize
331340
def test_raw_response_increment_queries(self, client: Codex) -> None:
332341
response = client.projects.with_raw_response.increment_queries(
333-
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
342+
project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
334343
)
335344

336345
assert response.is_closed is True
@@ -342,7 +351,7 @@ def test_raw_response_increment_queries(self, client: Codex) -> None:
342351
@parametrize
343352
def test_streaming_response_increment_queries(self, client: Codex) -> None:
344353
with client.projects.with_streaming_response.increment_queries(
345-
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
354+
project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
346355
) as response:
347356
assert not response.is_closed
348357
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -357,7 +366,7 @@ def test_streaming_response_increment_queries(self, client: Codex) -> None:
357366
def test_path_params_increment_queries(self, client: Codex) -> None:
358367
with pytest.raises(ValueError, match=r"Expected a non-empty value for `project_id` but received ''"):
359368
client.projects.with_raw_response.increment_queries(
360-
"",
369+
project_id="",
361370
)
362371

363372
@pytest.mark.skip()
@@ -716,15 +725,24 @@ async def test_path_params_export(self, async_client: AsyncCodex) -> None:
716725
@parametrize
717726
async def test_method_increment_queries(self, async_client: AsyncCodex) -> None:
718727
project = await async_client.projects.increment_queries(
719-
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
728+
project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
729+
)
730+
assert_matches_type(object, project, path=["response"])
731+
732+
@pytest.mark.skip()
733+
@parametrize
734+
async def test_method_increment_queries_with_all_params(self, async_client: AsyncCodex) -> None:
735+
project = await async_client.projects.increment_queries(
736+
project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
737+
count=0,
720738
)
721739
assert_matches_type(object, project, path=["response"])
722740

723741
@pytest.mark.skip()
724742
@parametrize
725743
async def test_raw_response_increment_queries(self, async_client: AsyncCodex) -> None:
726744
response = await async_client.projects.with_raw_response.increment_queries(
727-
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
745+
project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
728746
)
729747

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

757775
@pytest.mark.skip()

0 commit comments

Comments
 (0)