Skip to content

Commit ed0b337

Browse files
feat(api): api update
1 parent 3f85757 commit ed0b337

File tree

4 files changed

+16
-28
lines changed

4 files changed

+16
-28
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
configured_endpoints: 42
2-
openapi_spec_hash: 71ff1de391293cdfb6dcb761ed89210d
2+
openapi_spec_hash: 684572da9b97ec2c9acf3ea698c7ce12
33
config_hash: 2d88a0a41f5faca603ff2789a116d988

src/codex/resources/projects/projects.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,11 @@ def update(
208208
def list(
209209
self,
210210
*,
211-
organization_id: str,
212211
include_entry_counts: bool | NotGiven = NOT_GIVEN,
213212
limit: int | NotGiven = NOT_GIVEN,
214213
offset: int | NotGiven = NOT_GIVEN,
215214
order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
215+
organization_id: str | NotGiven = NOT_GIVEN,
216216
query: Optional[str] | NotGiven = NOT_GIVEN,
217217
sort: Literal["created_at", "updated_at"] | NotGiven = NOT_GIVEN,
218218
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -243,11 +243,11 @@ def list(
243243
timeout=timeout,
244244
query=maybe_transform(
245245
{
246-
"organization_id": organization_id,
247246
"include_entry_counts": include_entry_counts,
248247
"limit": limit,
249248
"offset": offset,
250249
"order": order,
250+
"organization_id": organization_id,
251251
"query": query,
252252
"sort": sort,
253253
},
@@ -513,11 +513,11 @@ async def update(
513513
async def list(
514514
self,
515515
*,
516-
organization_id: str,
517516
include_entry_counts: bool | NotGiven = NOT_GIVEN,
518517
limit: int | NotGiven = NOT_GIVEN,
519518
offset: int | NotGiven = NOT_GIVEN,
520519
order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
520+
organization_id: str | NotGiven = NOT_GIVEN,
521521
query: Optional[str] | NotGiven = NOT_GIVEN,
522522
sort: Literal["created_at", "updated_at"] | NotGiven = NOT_GIVEN,
523523
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -548,11 +548,11 @@ async def list(
548548
timeout=timeout,
549549
query=await async_maybe_transform(
550550
{
551-
"organization_id": organization_id,
552551
"include_entry_counts": include_entry_counts,
553552
"limit": limit,
554553
"offset": offset,
555554
"order": order,
555+
"organization_id": organization_id,
556556
"query": query,
557557
"sort": sort,
558558
},

src/codex/types/project_list_params.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33
from __future__ import annotations
44

55
from typing import Optional
6-
from typing_extensions import Literal, Required, TypedDict
6+
from typing_extensions import Literal, TypedDict
77

88
__all__ = ["ProjectListParams"]
99

1010

1111
class ProjectListParams(TypedDict, total=False):
12-
organization_id: Required[str]
13-
1412
include_entry_counts: bool
1513

1614
limit: int
@@ -19,6 +17,8 @@ class ProjectListParams(TypedDict, total=False):
1917

2018
order: Literal["asc", "desc"]
2119

20+
organization_id: str
21+
2222
query: Optional[str]
2323

2424
sort: Literal["created_at", "updated_at"]

tests/api_resources/test_projects.py

+8-20
Original file line numberDiff line numberDiff line change
@@ -194,20 +194,18 @@ def test_path_params_update(self, client: Codex) -> None:
194194
@pytest.mark.skip()
195195
@parametrize
196196
def test_method_list(self, client: Codex) -> None:
197-
project = client.projects.list(
198-
organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
199-
)
197+
project = client.projects.list()
200198
assert_matches_type(ProjectListResponse, project, path=["response"])
201199

202200
@pytest.mark.skip()
203201
@parametrize
204202
def test_method_list_with_all_params(self, client: Codex) -> None:
205203
project = client.projects.list(
206-
organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
207204
include_entry_counts=True,
208205
limit=0,
209206
offset=0,
210207
order="asc",
208+
organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
211209
query="query",
212210
sort="created_at",
213211
)
@@ -216,9 +214,7 @@ def test_method_list_with_all_params(self, client: Codex) -> None:
216214
@pytest.mark.skip()
217215
@parametrize
218216
def test_raw_response_list(self, client: Codex) -> None:
219-
response = client.projects.with_raw_response.list(
220-
organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
221-
)
217+
response = client.projects.with_raw_response.list()
222218

223219
assert response.is_closed is True
224220
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -228,9 +224,7 @@ def test_raw_response_list(self, client: Codex) -> None:
228224
@pytest.mark.skip()
229225
@parametrize
230226
def test_streaming_response_list(self, client: Codex) -> None:
231-
with client.projects.with_streaming_response.list(
232-
organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
233-
) as response:
227+
with client.projects.with_streaming_response.list() as response:
234228
assert not response.is_closed
235229
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
236230

@@ -542,20 +536,18 @@ async def test_path_params_update(self, async_client: AsyncCodex) -> None:
542536
@pytest.mark.skip()
543537
@parametrize
544538
async def test_method_list(self, async_client: AsyncCodex) -> None:
545-
project = await async_client.projects.list(
546-
organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
547-
)
539+
project = await async_client.projects.list()
548540
assert_matches_type(ProjectListResponse, project, path=["response"])
549541

550542
@pytest.mark.skip()
551543
@parametrize
552544
async def test_method_list_with_all_params(self, async_client: AsyncCodex) -> None:
553545
project = await async_client.projects.list(
554-
organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
555546
include_entry_counts=True,
556547
limit=0,
557548
offset=0,
558549
order="asc",
550+
organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
559551
query="query",
560552
sort="created_at",
561553
)
@@ -564,9 +556,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCodex) -> No
564556
@pytest.mark.skip()
565557
@parametrize
566558
async def test_raw_response_list(self, async_client: AsyncCodex) -> None:
567-
response = await async_client.projects.with_raw_response.list(
568-
organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
569-
)
559+
response = await async_client.projects.with_raw_response.list()
570560

571561
assert response.is_closed is True
572562
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -576,9 +566,7 @@ async def test_raw_response_list(self, async_client: AsyncCodex) -> None:
576566
@pytest.mark.skip()
577567
@parametrize
578568
async def test_streaming_response_list(self, async_client: AsyncCodex) -> None:
579-
async with async_client.projects.with_streaming_response.list(
580-
organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
581-
) as response:
569+
async with async_client.projects.with_streaming_response.list() as response:
582570
assert not response.is_closed
583571
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
584572

0 commit comments

Comments
 (0)