Skip to content

Commit 3c95ecc

Browse files
feat(api): add session_id parameter to environments.create_from_project
1 parent 97caa20 commit 3c95ecc

4 files changed

Lines changed: 20 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-9af1d2d8008f6a755a5e8ae29151cd102c698c9fce494b74dd9163a6e48edf4e.yml
3-
openapi_spec_hash: 111508e126ff88904bcb739bc6ceaabd
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-055db8fdb0c818654b041a70752ac1e2b8d3625244c81463c722cfd860f684e2.yml
3+
openapi_spec_hash: 7e9ed18957abb39e539f50a9ca3adc73
44
config_hash: 91b2982c67083dfc3f65e5e27d94e0aa

src/gitpod/resources/environments/environments.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,7 @@ def create_from_project(
566566
*,
567567
name: Optional[str] | Omit = omit,
568568
project_id: str | Omit = omit,
569+
session_id: str | Omit = omit,
569570
spec: EnvironmentSpecParam | Omit = omit,
570571
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
571572
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -610,6 +611,9 @@ def create_from_project(
610611
name: name is a user-defined identifier for the environment. If not specified, the
611612
system will generate a name.
612613
614+
session_id: session_id is the ID of the session this environment belongs to. If empty, a new
615+
session is created implicitly.
616+
613617
spec: Spec is the configuration of the environment that's required for the runner to
614618
start the environment Configuration already defined in the Project will override
615619
parts of the spec, if set
@@ -628,6 +632,7 @@ def create_from_project(
628632
{
629633
"name": name,
630634
"project_id": project_id,
635+
"session_id": session_id,
631636
"spec": spec,
632637
},
633638
environment_create_from_project_params.EnvironmentCreateFromProjectParams,
@@ -1400,6 +1405,7 @@ async def create_from_project(
14001405
*,
14011406
name: Optional[str] | Omit = omit,
14021407
project_id: str | Omit = omit,
1408+
session_id: str | Omit = omit,
14031409
spec: EnvironmentSpecParam | Omit = omit,
14041410
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
14051411
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -1444,6 +1450,9 @@ async def create_from_project(
14441450
name: name is a user-defined identifier for the environment. If not specified, the
14451451
system will generate a name.
14461452
1453+
session_id: session_id is the ID of the session this environment belongs to. If empty, a new
1454+
session is created implicitly.
1455+
14471456
spec: Spec is the configuration of the environment that's required for the runner to
14481457
start the environment Configuration already defined in the Project will override
14491458
parts of the spec, if set
@@ -1462,6 +1471,7 @@ async def create_from_project(
14621471
{
14631472
"name": name,
14641473
"project_id": project_id,
1474+
"session_id": session_id,
14651475
"spec": spec,
14661476
},
14671477
environment_create_from_project_params.EnvironmentCreateFromProjectParams,

src/gitpod/types/environment_create_from_project_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ class EnvironmentCreateFromProjectParams(TypedDict, total=False):
2020

2121
project_id: Annotated[str, PropertyInfo(alias="projectId")]
2222

23+
session_id: Annotated[str, PropertyInfo(alias="sessionId")]
24+
"""
25+
session_id is the ID of the session this environment belongs to. If empty, a new
26+
session is created implicitly.
27+
"""
28+
2329
spec: EnvironmentSpecParam
2430
"""
2531
Spec is the configuration of the environment that's required for the runner to

tests/api_resources/test_environments.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,7 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non
411411
environment = client.environments.create_from_project(
412412
name="name",
413413
project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047",
414+
session_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
414415
spec={
415416
"admission": "ADMISSION_LEVEL_UNSPECIFIED",
416417
"automations_file": {
@@ -1100,6 +1101,7 @@ async def test_method_create_from_project_with_all_params(self, async_client: As
11001101
environment = await async_client.environments.create_from_project(
11011102
name="name",
11021103
project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047",
1104+
session_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
11031105
spec={
11041106
"admission": "ADMISSION_LEVEL_UNSPECIFIED",
11051107
"automations_file": {

0 commit comments

Comments
 (0)