Skip to content

Commit b5d43cc

Browse files
feat(api): add filters to ListPrebuilds for inventory page
1 parent 2cf3454 commit b5d43cc

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
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: 172
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-7a8e71d8c69a12f718bf1357225cab2970088b6b35f2980569ae4f459cb235a3.yml
3-
openapi_spec_hash: 5bc62dbddf307449c2ae1f43503725fd
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-37c2e5cd0ac1442c376f5744c957f93ef39c3baf64b5443b99296a937f79889b.yml
3+
openapi_spec_hash: e4e981e4d61a227ca326eb776e81c6d0
44
config_hash: dad4ee53c894c682895d6d045c4c2105

src/gitpod/types/prebuild_list_params.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from .._types import SequenceNotStr
99
from .._utils import PropertyInfo
1010
from .prebuild_phase import PrebuildPhase
11+
from .prebuild_trigger import PrebuildTrigger
1112

1213
__all__ = ["PrebuildListParams", "Filter", "Pagination"]
1314

@@ -27,12 +28,21 @@ class PrebuildListParams(TypedDict, total=False):
2728
class Filter(TypedDict, total=False):
2829
"""filter contains the filter options for listing prebuilds"""
2930

31+
creator_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="creatorIds")]
32+
"""creator_ids filters prebuilds by who created them"""
33+
34+
executor_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="executorIds")]
35+
"""executor_ids filters prebuilds by whose credentials were used to run them"""
36+
3037
phases: List[PrebuildPhase]
3138
"""phases filters prebuilds by their current phase"""
3239

3340
project_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="projectIds")]
3441
"""project_ids filters prebuilds to specific projects"""
3542

43+
triggered_by: Annotated[List[PrebuildTrigger], PropertyInfo(alias="triggeredBy")]
44+
"""triggered_by filters prebuilds by how they were triggered"""
45+
3646

3747
class Pagination(TypedDict, total=False):
3848
"""pagination contains the pagination options for listing prebuilds"""

tests/api_resources/test_prebuilds.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,11 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None:
122122
token="token",
123123
page_size=0,
124124
filter={
125+
"creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
126+
"executor_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
125127
"phases": ["PREBUILD_PHASE_UNSPECIFIED"],
126128
"project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
129+
"triggered_by": ["PREBUILD_TRIGGER_UNSPECIFIED"],
127130
},
128131
pagination={
129132
"token": "token",
@@ -360,8 +363,11 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N
360363
token="token",
361364
page_size=0,
362365
filter={
366+
"creator_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
367+
"executor_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
363368
"phases": ["PREBUILD_PHASE_UNSPECIFIED"],
364369
"project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
370+
"triggered_by": ["PREBUILD_TRIGGER_UNSPECIFIED"],
365371
},
366372
pagination={
367373
"token": "token",

0 commit comments

Comments
 (0)