Skip to content

Commit 51c4f79

Browse files
feat(api): server-side search on GET /projects
1 parent 120de63 commit 51c4f79

4 files changed

Lines changed: 15 additions & 2 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 112
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-718b49461ceaa1d6cac7854c29dfef9036a83f6632e756c9d1ecf31fd77c57f6.yml
3-
openapi_spec_hash: f3d12a3a0a5e9ce711fb1c571ee36f9c
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-86e061884d273a27064593a0de3a4ba366a12a1001181741addb4f781be18ec9.yml
3+
openapi_spec_hash: e0a4ddf4a3302599376756127099488c
44
config_hash: 08d55086449943a8fec212b870061a3f

src/kernel/resources/projects/projects.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ def list(
179179
*,
180180
limit: int | Omit = omit,
181181
offset: int | Omit = omit,
182+
query: str | Omit = omit,
182183
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
183184
# The extra values given here take precedence over values defined on the client or passed to this method.
184185
extra_headers: Headers | None = None,
@@ -194,6 +195,8 @@ def list(
194195
195196
offset: Number of results to skip
196197
198+
query: Case-insensitive substring match against project name
199+
197200
extra_headers: Send extra headers
198201
199202
extra_query: Add additional query parameters to the request
@@ -214,6 +217,7 @@ def list(
214217
{
215218
"limit": limit,
216219
"offset": offset,
220+
"query": query,
217221
},
218222
project_list_params.ProjectListParams,
219223
),
@@ -404,6 +408,7 @@ def list(
404408
*,
405409
limit: int | Omit = omit,
406410
offset: int | Omit = omit,
411+
query: str | Omit = omit,
407412
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
408413
# The extra values given here take precedence over values defined on the client or passed to this method.
409414
extra_headers: Headers | None = None,
@@ -419,6 +424,8 @@ def list(
419424
420425
offset: Number of results to skip
421426
427+
query: Case-insensitive substring match against project name
428+
422429
extra_headers: Send extra headers
423430
424431
extra_query: Add additional query parameters to the request
@@ -439,6 +446,7 @@ def list(
439446
{
440447
"limit": limit,
441448
"offset": offset,
449+
"query": query,
442450
},
443451
project_list_params.ProjectListParams,
444452
),

src/kernel/types/project_list_params.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ class ProjectListParams(TypedDict, total=False):
1313

1414
offset: int
1515
"""Number of results to skip"""
16+
17+
query: str
18+
"""Case-insensitive substring match against project name"""

tests/api_resources/test_projects.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ def test_method_list_with_all_params(self, client: Kernel) -> None:
158158
project = client.projects.list(
159159
limit=100,
160160
offset=0,
161+
query="query",
161162
)
162163
assert_matches_type(SyncOffsetPagination[Project], project, path=["response"])
163164

@@ -371,6 +372,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncKernel) -> N
371372
project = await async_client.projects.list(
372373
limit=100,
373374
offset=0,
375+
query="query",
374376
)
375377
assert_matches_type(AsyncOffsetPagination[Project], project, path=["response"])
376378

0 commit comments

Comments
 (0)