Skip to content

Commit 19ce45f

Browse files
feat(api): add acknowledge_token param to environments.start method
1 parent c10fa2e commit 19ce45f

4 files changed

Lines changed: 33 additions & 4 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: 175
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-d7f548d9bd50aca802b55ace7e9194d8dbe4a96a1258abcc4786cb00094b6802.yml
3-
openapi_spec_hash: d29ac6bb840f1dcfec0ab4b7e1235060
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-b501e4da71906d7d2cfb49ff85c4d1316592623392cf00cb535938b7844f469b.yml
3+
openapi_spec_hash: 5b1bd959ae6f6a909b3d00acbb49ea78
44
config_hash: 343503f34d4ea5e1d46f58f24519a796

‎src/gitpod/resources/environments/environments.py‎

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,7 @@ def mark_active(
748748
def start(
749749
self,
750750
*,
751+
acknowledge_token: str | Omit = omit,
751752
environment_id: str | Omit = omit,
752753
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
753754
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -774,6 +775,10 @@ def start(
774775
```
775776
776777
Args:
778+
acknowledge_token: acknowledge_token is the HMAC token from a previous
779+
EnvironmentMaxLifetimeEnforcementDetails response, allowing the user to start an
780+
environment past its max lifetime in warn mode.
781+
777782
environment_id: environment_id specifies which environment should be started.
778783
779784
extra_headers: Send extra headers
@@ -786,7 +791,13 @@ def start(
786791
"""
787792
return self._post(
788793
"/gitpod.v1.EnvironmentService/StartEnvironment",
789-
body=maybe_transform({"environment_id": environment_id}, environment_start_params.EnvironmentStartParams),
794+
body=maybe_transform(
795+
{
796+
"acknowledge_token": acknowledge_token,
797+
"environment_id": environment_id,
798+
},
799+
environment_start_params.EnvironmentStartParams,
800+
),
790801
options=make_request_options(
791802
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
792803
),
@@ -1577,6 +1588,7 @@ async def mark_active(
15771588
async def start(
15781589
self,
15791590
*,
1591+
acknowledge_token: str | Omit = omit,
15801592
environment_id: str | Omit = omit,
15811593
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
15821594
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -1603,6 +1615,10 @@ async def start(
16031615
```
16041616
16051617
Args:
1618+
acknowledge_token: acknowledge_token is the HMAC token from a previous
1619+
EnvironmentMaxLifetimeEnforcementDetails response, allowing the user to start an
1620+
environment past its max lifetime in warn mode.
1621+
16061622
environment_id: environment_id specifies which environment should be started.
16071623
16081624
extra_headers: Send extra headers
@@ -1616,7 +1632,11 @@ async def start(
16161632
return await self._post(
16171633
"/gitpod.v1.EnvironmentService/StartEnvironment",
16181634
body=await async_maybe_transform(
1619-
{"environment_id": environment_id}, environment_start_params.EnvironmentStartParams
1635+
{
1636+
"acknowledge_token": acknowledge_token,
1637+
"environment_id": environment_id,
1638+
},
1639+
environment_start_params.EnvironmentStartParams,
16201640
),
16211641
options=make_request_options(
16221642
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout

‎src/gitpod/types/environment_start_params.py‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,12 @@
1010

1111

1212
class EnvironmentStartParams(TypedDict, total=False):
13+
acknowledge_token: Annotated[str, PropertyInfo(alias="acknowledgeToken")]
14+
"""
15+
acknowledge_token is the HMAC token from a previous
16+
EnvironmentMaxLifetimeEnforcementDetails response, allowing the user to start an
17+
environment past its max lifetime in warn mode.
18+
"""
19+
1320
environment_id: Annotated[str, PropertyInfo(alias="environmentId")]
1421
"""environment_id specifies which environment should be started."""

‎tests/api_resources/test_environments.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,7 @@ def test_method_start(self, client: Gitpod) -> None:
609609
@parametrize
610610
def test_method_start_with_all_params(self, client: Gitpod) -> None:
611611
environment = client.environments.start(
612+
acknowledge_token="acknowledgeToken",
612613
environment_id="07e03a28-65a5-4d98-b532-8ea67b188048",
613614
)
614615
assert_matches_type(object, environment, path=["response"])
@@ -1296,6 +1297,7 @@ async def test_method_start(self, async_client: AsyncGitpod) -> None:
12961297
@parametrize
12971298
async def test_method_start_with_all_params(self, async_client: AsyncGitpod) -> None:
12981299
environment = await async_client.environments.start(
1300+
acknowledge_token="acknowledgeToken",
12991301
environment_id="07e03a28-65a5-4d98-b532-8ea67b188048",
13001302
)
13011303
assert_matches_type(object, environment, path=["response"])

0 commit comments

Comments
 (0)