Skip to content

Commit 530d80c

Browse files
feat(api): manual updates
1 parent 2717e93 commit 530d80c

File tree

10 files changed

+146
-22
lines changed

10 files changed

+146
-22
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: 116
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-d854bc81e0a99171716893e6790a87ba350bb6fc778f8e3244abdd47d5c252c3.yml
3-
openapi_spec_hash: 5189220e4712a7b0cdd35beba2ebb47d
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-2e6ddfc9da00e33fcf13baf0b67012b97f051fa986658ff114fde989e56caa94.yml
3+
openapi_spec_hash: 5af02ea2008312d609394e548756e761
44
config_hash: 60929489bdc1eaf979e7ef74fdd17b94

src/gitpod/resources/secrets.py

Lines changed: 64 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,38 @@ def list(
176176
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
177177
) -> SyncSecretsPage[Secret]:
178178
"""
179-
ListSecrets
179+
Lists secrets
180+
181+
Use this method to:
182+
183+
- View all project secrets
184+
- View all user secrets
185+
186+
### Examples
187+
188+
- List project secrets:
189+
190+
Shows all secrets for a project.
191+
192+
```yaml
193+
filter:
194+
scope:
195+
projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047"
196+
pagination:
197+
pageSize: 20
198+
```
199+
200+
- List user secrets:
201+
202+
Shows all secrets for a user.
203+
204+
```yaml
205+
filter:
206+
scope:
207+
userId: "123e4567-e89b-12d3-a456-426614174000"
208+
pagination:
209+
pageSize: 20
210+
```
180211
181212
Args:
182213
pagination: pagination contains the pagination options for listing environments
@@ -515,7 +546,38 @@ def list(
515546
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
516547
) -> AsyncPaginator[Secret, AsyncSecretsPage[Secret]]:
517548
"""
518-
ListSecrets
549+
Lists secrets
550+
551+
Use this method to:
552+
553+
- View all project secrets
554+
- View all user secrets
555+
556+
### Examples
557+
558+
- List project secrets:
559+
560+
Shows all secrets for a project.
561+
562+
```yaml
563+
filter:
564+
scope:
565+
projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047"
566+
pagination:
567+
pageSize: 20
568+
```
569+
570+
- List user secrets:
571+
572+
Shows all secrets for a user.
573+
574+
```yaml
575+
filter:
576+
scope:
577+
userId: "123e4567-e89b-12d3-a456-426614174000"
578+
pagination:
579+
pageSize: 20
580+
```
519581
520582
Args:
521583
pagination: pagination contains the pagination options for listing environments

src/gitpod/resources/usage.py

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,29 @@ def list_environment_sessions(
5757
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
5858
) -> SyncSessionsPage[EnvironmentSession]:
5959
"""
60-
Lists environment sessions within a specified date range.
60+
Lists completed environment sessions within a specified date range.
6161
62-
Returns a list of environment sessions that were active within the specified
63-
date range.
62+
Returns a list of environment sessions that were completed within the specified
63+
date range. Currently running sessions are not included.
64+
65+
Use this method to:
66+
67+
- View environment sessions
68+
- Filter by project
69+
- Monitor session activity
70+
- Create custom usage reports
71+
72+
### Example
73+
74+
```yaml
75+
filter:
76+
projectId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
77+
dateRange:
78+
startTime: "2024-01-01T00:00:00Z"
79+
endTime: "2024-01-02T00:00:00Z"
80+
pagination:
81+
pageSize: 100
82+
```
6483
6584
Args:
6685
filter: Filter options.
@@ -138,10 +157,29 @@ def list_environment_sessions(
138157
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
139158
) -> AsyncPaginator[EnvironmentSession, AsyncSessionsPage[EnvironmentSession]]:
140159
"""
141-
Lists environment sessions within a specified date range.
160+
Lists completed environment sessions within a specified date range.
161+
162+
Returns a list of environment sessions that were completed within the specified
163+
date range. Currently running sessions are not included.
164+
165+
Use this method to:
166+
167+
- View environment sessions
168+
- Filter by project
169+
- Monitor session activity
170+
- Create custom usage reports
171+
172+
### Example
142173
143-
Returns a list of environment sessions that were active within the specified
144-
date range.
174+
```yaml
175+
filter:
176+
projectId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
177+
dateRange:
178+
startTime: "2024-01-01T00:00:00Z"
179+
endTime: "2024-01-02T00:00:00Z"
180+
pagination:
181+
pageSize: 100
182+
```
145183
146184
Args:
147185
filter: Filter options.

src/gitpod/types/environment_session.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class EnvironmentSession(BaseModel):
2424
"""Environment ID associated with the session."""
2525

2626
project_id: Optional[str] = FieldInfo(alias="projectId", default=None)
27-
"""Project ID associated with the session."""
27+
"""Project ID associated with the session (if available)."""
2828

2929
runner_id: Optional[str] = FieldInfo(alias="runnerId", default=None)
3030
"""Runner ID associated with the session."""
@@ -33,4 +33,4 @@ class EnvironmentSession(BaseModel):
3333
"""Time when the session was stopped."""
3434

3535
user_id: Optional[str] = FieldInfo(alias="userId", default=None)
36-
"""User ID who created the session."""
36+
"""User ID that created the session."""

src/gitpod/types/runner_configuration.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ class RunnerConfiguration(BaseModel):
1616
auto_update: Optional[bool] = FieldInfo(alias="autoUpdate", default=None)
1717
"""auto_update indicates whether the runner should automatically update itself."""
1818

19+
devcontainer_image_cache_enabled: Optional[bool] = FieldInfo(alias="devcontainerImageCacheEnabled", default=None)
20+
"""
21+
devcontainer_image_cache_enabled controls whether the devcontainer build cache
22+
is enabled for this runner. Only takes effect on supported runners, currently
23+
only AWS EC2 runners.
24+
"""
25+
1926
log_level: Optional[LogLevel] = FieldInfo(alias="logLevel", default=None)
2027
"""log_level is the log level for the runner"""
2128

src/gitpod/types/runner_configuration_param.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ class RunnerConfigurationParam(TypedDict, total=False):
1616
auto_update: Annotated[bool, PropertyInfo(alias="autoUpdate")]
1717
"""auto_update indicates whether the runner should automatically update itself."""
1818

19+
devcontainer_image_cache_enabled: Annotated[bool, PropertyInfo(alias="devcontainerImageCacheEnabled")]
20+
"""
21+
devcontainer_image_cache_enabled controls whether the devcontainer build cache
22+
is enabled for this runner. Only takes effect on supported runners, currently
23+
only AWS EC2 runners.
24+
"""
25+
1926
log_level: Annotated[LogLevel, PropertyInfo(alias="logLevel")]
2027
"""log_level is the log level for the runner"""
2128

src/gitpod/types/runner_update_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ class SpecConfiguration(TypedDict, total=False):
4444
auto_update: Annotated[Optional[bool], PropertyInfo(alias="autoUpdate")]
4545
"""auto_update indicates whether the runner should automatically update itself."""
4646

47+
devcontainer_image_cache_enabled: Annotated[Optional[bool], PropertyInfo(alias="devcontainerImageCacheEnabled")]
48+
"""
49+
devcontainer_image_cache_enabled controls whether the shared devcontainer build
50+
cache is enabled for this runner.
51+
"""
52+
4753
log_level: Annotated[Optional[LogLevel], PropertyInfo(alias="logLevel")]
4854
"""log_level is the log level for the runner"""
4955

tests/api_resources/test_runners.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None:
4141
spec={
4242
"configuration": {
4343
"auto_update": True,
44+
"devcontainer_image_cache_enabled": True,
4445
"log_level": "LOG_LEVEL_UNSPECIFIED",
4546
"metrics": {
4647
"enabled": True,
@@ -129,6 +130,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None:
129130
spec={
130131
"configuration": {
131132
"auto_update": True,
133+
"devcontainer_image_cache_enabled": True,
132134
"log_level": "LOG_LEVEL_UNSPECIFIED",
133135
"metrics": {
134136
"enabled": True,
@@ -378,6 +380,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) ->
378380
spec={
379381
"configuration": {
380382
"auto_update": True,
383+
"devcontainer_image_cache_enabled": True,
381384
"log_level": "LOG_LEVEL_UNSPECIFIED",
382385
"metrics": {
383386
"enabled": True,
@@ -466,6 +469,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) ->
466469
spec={
467470
"configuration": {
468471
"auto_update": True,
472+
"devcontainer_image_cache_enabled": True,
469473
"log_level": "LOG_LEVEL_UNSPECIFIED",
470474
"metrics": {
471475
"enabled": True,

tests/api_resources/test_secrets.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ def test_method_list_with_all_params(self, client: Gitpod) -> None:
8282
filter={
8383
"project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
8484
"scope": {
85-
"project_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
85+
"project_id": "b0e12f6c-4c67-429d-a4a6-d9838b5da047",
8686
"user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
8787
},
8888
},
8989
pagination={
9090
"token": "token",
91-
"page_size": 100,
91+
"page_size": 20,
9292
},
9393
)
9494
assert_matches_type(SyncSecretsPage[Secret], secret, path=["response"])
@@ -288,13 +288,13 @@ async def test_method_list_with_all_params(self, async_client: AsyncGitpod) -> N
288288
filter={
289289
"project_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
290290
"scope": {
291-
"project_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
291+
"project_id": "b0e12f6c-4c67-429d-a4a6-d9838b5da047",
292292
"user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
293293
},
294294
},
295295
pagination={
296296
"token": "token",
297-
"page_size": 100,
297+
"page_size": 20,
298298
},
299299
)
300300
assert_matches_type(AsyncSecretsPage[Secret], secret, path=["response"])

tests/api_resources/test_usage.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ def test_method_list_environment_sessions_with_all_params(self, client: Gitpod)
3333
page_size=0,
3434
filter={
3535
"date_range": {
36-
"end_time": parse_datetime("2019-12-27T18:11:19.117Z"),
37-
"start_time": parse_datetime("2019-12-27T18:11:19.117Z"),
36+
"end_time": parse_datetime("2024-01-02T00:00:00Z"),
37+
"start_time": parse_datetime("2024-01-01T00:00:00Z"),
3838
},
39-
"project_id": "projectId",
39+
"project_id": "d2c94c27-3b76-4a42-b88c-95a85e392c68",
4040
},
4141
pagination={
4242
"token": "token",
@@ -85,10 +85,10 @@ async def test_method_list_environment_sessions_with_all_params(self, async_clie
8585
page_size=0,
8686
filter={
8787
"date_range": {
88-
"end_time": parse_datetime("2019-12-27T18:11:19.117Z"),
89-
"start_time": parse_datetime("2019-12-27T18:11:19.117Z"),
88+
"end_time": parse_datetime("2024-01-02T00:00:00Z"),
89+
"start_time": parse_datetime("2024-01-01T00:00:00Z"),
9090
},
91-
"project_id": "projectId",
91+
"project_id": "d2c94c27-3b76-4a42-b88c-95a85e392c68",
9292
},
9393
pagination={
9494
"token": "token",

0 commit comments

Comments
 (0)