diff --git a/.release-please-manifest.json b/.release-please-manifest.json index e2f2c074..3cf71e62 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.17" + ".": "0.1.0-alpha.18" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 7a2f56a6..4a4a129e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,3 +1,3 @@ configured_endpoints: 43 -openapi_spec_hash: b7beefbd38b4fcdd191cdb81a18a023b +openapi_spec_hash: 51dd9bdb04307116617d3eefe3237755 config_hash: 5e459b33c53ffa6e554087a779bdb790 diff --git a/api.md b/api.md index f240632f..3bd2cf4f 100644 --- a/api.md +++ b/api.md @@ -153,7 +153,7 @@ Methods: - client.projects.list(\*\*params) -> ProjectListResponse - client.projects.delete(project_id) -> None - client.projects.export(project_id) -> object -- client.projects.increment_queries(project_id) -> object +- client.projects.increment_queries(project_id, \*\*params) -> object - client.projects.retrieve_analytics(project_id, \*\*params) -> ProjectRetrieveAnalyticsResponse ## AccessKeys diff --git a/pyproject.toml b/pyproject.toml index 24f75152..ff2faf37 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/src/codex/_version.py b/src/codex/_version.py index 264d49e0..29c60372 100644 --- a/src/codex/_version.py +++ b/src/codex/_version.py @@ -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 diff --git a/src/codex/resources/projects/projects.py b/src/codex/resources/projects/projects.py index bd50a684..7c676b6d 100644 --- a/src/codex/resources/projects/projects.py +++ b/src/codex/resources/projects/projects.py @@ -11,6 +11,7 @@ project_list_params, project_create_params, project_update_params, + project_increment_queries_params, project_retrieve_analytics_params, ) from .entries import ( @@ -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, @@ -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, ) @@ -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, @@ -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, ) diff --git a/src/codex/types/__init__.py b/src/codex/types/__init__.py index 53d1ab6b..7f18b9c1 100644 --- a/src/codex/types/__init__.py +++ b/src/codex/types/__init__.py @@ -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 diff --git a/src/codex/types/project_increment_queries_params.py b/src/codex/types/project_increment_queries_params.py new file mode 100644 index 00000000..f6043a76 --- /dev/null +++ b/src/codex/types/project_increment_queries_params.py @@ -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 diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index 772a7b29..40f40eb7 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -322,7 +322,16 @@ 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"]) @@ -330,7 +339,7 @@ def test_method_increment_queries(self, client: Codex) -> None: @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 @@ -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" @@ -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() @@ -716,7 +725,16 @@ 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"]) @@ -724,7 +742,7 @@ async def test_method_increment_queries(self, async_client: AsyncCodex) -> None: @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 @@ -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" @@ -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()