Skip to content

Commit bbf9719

Browse files
feat(api): add session_ids filter to agents/environments list methods
1 parent 83d8cd3 commit bbf9719

5 files changed

Lines changed: 18 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: 193
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-eb2a06fb4bcfb9dc85e08216cdaad259453be5d03dd6cdd0562e147d33a8ff31.yml
3-
openapi_spec_hash: 0d278e84539c7e554d6218666aa3bf41
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-dc11159f8832715e5e2f90bd30be75023f98924c9b347ee58140426d98a66451.yml
3+
openapi_spec_hash: 20be193759f39a790f961ff6be44cd22
44
config_hash: 1e3edbeecb529f712bfaac1b561d91d5

src/gitpod/types/agent_list_executions_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ class Filter(TypedDict, total=False):
4141
Literal["AGENT_EXECUTION_ROLE_UNSPECIFIED", "AGENT_EXECUTION_ROLE_DEFAULT", "AGENT_EXECUTION_ROLE_WORKFLOW"]
4242
]
4343

44+
session_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="sessionIds")]
45+
"""
46+
session_ids filters the response to only executions belonging to the specified
47+
sessions
48+
"""
49+
4450
status_phases: Annotated[
4551
List[
4652
Literal["PHASE_UNSPECIFIED", "PHASE_PENDING", "PHASE_RUNNING", "PHASE_WAITING_FOR_INPUT", "PHASE_STOPPED"]

src/gitpod/types/environment_list_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ class Filter(TypedDict, total=False):
6969
Kinds
7070
"""
7171

72+
session_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="sessionIds")]
73+
"""
74+
session_ids filters the response to only environments belonging to the specified
75+
sessions
76+
"""
77+
7278
status_phases: Annotated[List[EnvironmentPhase], PropertyInfo(alias="statusPhases")]
7379
"""
7480
actual_phases is a list of phases the environment must be in for it to be

tests/api_resources/test_agents.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ def test_method_list_executions_with_all_params(self, client: Gitpod) -> None:
197197
"environment_ids": ["string"],
198198
"project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
199199
"roles": ["AGENT_EXECUTION_ROLE_UNSPECIFIED"],
200+
"session_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
200201
"status_phases": ["PHASE_UNSPECIFIED"],
201202
},
202203
pagination={
@@ -735,6 +736,7 @@ async def test_method_list_executions_with_all_params(self, async_client: AsyncG
735736
"environment_ids": ["string"],
736737
"project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
737738
"roles": ["AGENT_EXECUTION_ROLE_UNSPECIFIED"],
739+
"session_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
738740
"status_phases": ["PHASE_UNSPECIFIED"],
739741
},
740742
pagination={

tests/api_resources/test_environments.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None:
296296
"roles": ["ENVIRONMENT_ROLE_UNSPECIFIED"],
297297
"runner_ids": ["e6aa9c54-89d3-42c1-ac31-bd8d8f1concentrate"],
298298
"runner_kinds": ["RUNNER_KIND_UNSPECIFIED"],
299+
"session_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
299300
"status_phases": ["ENVIRONMENT_PHASE_UNSPECIFIED"],
300301
},
301302
pagination={
@@ -984,6 +985,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N
984985
"roles": ["ENVIRONMENT_ROLE_UNSPECIFIED"],
985986
"runner_ids": ["e6aa9c54-89d3-42c1-ac31-bd8d8f1concentrate"],
986987
"runner_kinds": ["RUNNER_KIND_UNSPECIFIED"],
988+
"session_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
987989
"status_phases": ["ENVIRONMENT_PHASE_UNSPECIFIED"],
988990
},
989991
pagination={

0 commit comments

Comments
 (0)