Skip to content

Commit ce537bb

Browse files
feat: Add version filter to GET /deployments endpoint
1 parent 3419e33 commit ce537bb

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 101
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-bbc3dbdd0410eb315cfaeb21aad9f85e4a7f92ac55526ebb702a8bee343c2ab7.yml
3-
openapi_spec_hash: 60a5134c45a8f3a217e128d4e3335cae
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-ea5c9cb25c29fa5a8758bbf8732eb306783bb6f13b4df29bf1ad5ad3cb32da1e.yml
3+
openapi_spec_hash: 597031840469b011f5cf22a4d8b9d750
44
config_hash: 147340811dd6fbb9c2d80515a7e31f9a

src/kernel/resources/deployments.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ def list(
156156
self,
157157
*,
158158
app_name: str | Omit = omit,
159+
app_version: str | Omit = omit,
159160
limit: int | Omit = omit,
160161
offset: int | Omit = omit,
161162
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -167,11 +168,13 @@ def list(
167168
) -> SyncOffsetPagination[DeploymentListResponse]:
168169
"""List deployments.
169170
170-
Optionally filter by application name.
171+
Optionally filter by application name and version.
171172
172173
Args:
173174
app_name: Filter results by application name.
174175
176+
app_version: Filter results by application version. Requires app_name to be set.
177+
175178
limit: Limit the number of deployments to return.
176179
177180
offset: Offset the number of deployments to return.
@@ -195,6 +198,7 @@ def list(
195198
query=maybe_transform(
196199
{
197200
"app_name": app_name,
201+
"app_version": app_version,
198202
"limit": limit,
199203
"offset": offset,
200204
},
@@ -415,6 +419,7 @@ def list(
415419
self,
416420
*,
417421
app_name: str | Omit = omit,
422+
app_version: str | Omit = omit,
418423
limit: int | Omit = omit,
419424
offset: int | Omit = omit,
420425
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -426,11 +431,13 @@ def list(
426431
) -> AsyncPaginator[DeploymentListResponse, AsyncOffsetPagination[DeploymentListResponse]]:
427432
"""List deployments.
428433
429-
Optionally filter by application name.
434+
Optionally filter by application name and version.
430435
431436
Args:
432437
app_name: Filter results by application name.
433438
439+
app_version: Filter results by application version. Requires app_name to be set.
440+
434441
limit: Limit the number of deployments to return.
435442
436443
offset: Offset the number of deployments to return.
@@ -454,6 +461,7 @@ def list(
454461
query=maybe_transform(
455462
{
456463
"app_name": app_name,
464+
"app_version": app_version,
457465
"limit": limit,
458466
"offset": offset,
459467
},

src/kernel/types/deployment_list_params.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ class DeploymentListParams(TypedDict, total=False):
1111
app_name: str
1212
"""Filter results by application name."""
1313

14+
app_version: str
15+
"""Filter results by application version. Requires app_name to be set."""
16+
1417
limit: int
1518
"""Limit the number of deployments to return."""
1619

tests/api_resources/test_deployments.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ def test_method_list(self, client: Kernel) -> None:
127127
def test_method_list_with_all_params(self, client: Kernel) -> None:
128128
deployment = client.deployments.list(
129129
app_name="app_name",
130+
app_version="app_version",
130131
limit=1,
131132
offset=0,
132133
)
@@ -357,6 +358,7 @@ async def test_method_list(self, async_client: AsyncKernel) -> None:
357358
async def test_method_list_with_all_params(self, async_client: AsyncKernel) -> None:
358359
deployment = await async_client.deployments.list(
359360
app_name="app_name",
361+
app_version="app_version",
360362
limit=1,
361363
offset=0,
362364
)

0 commit comments

Comments
 (0)