Skip to content

Commit 5a4e222

Browse files
feat(api): add recommended editors configuration to project settings
1 parent c1223c3 commit 5a4e222

File tree

9 files changed

+96
-3
lines changed

9 files changed

+96
-3
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 160
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-665d1d0e7f0040c5fbbb664487724af4ecc58d3c702e8099ceef4a05ba589369.yml
3-
openapi_spec_hash: 3688253b79ec0cf6d41ff586d71e9f07
4-
config_hash: 8e1b089e9f5af438fd56b523014af4f2
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-6f686822d27e00f05b67afc31efefd873ce20db2be25174500da54a30f650875.yml
3+
openapi_spec_hash: 24bd6ab0ff2eed7121942da895863810
4+
config_hash: 06c6c8640b0bb0692f8f2361c6660f8a

api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,7 @@ from gitpod.types import (
498498
ProjectMetadata,
499499
ProjectPhase,
500500
ProjectPrebuildConfiguration,
501+
RecommendedEditors,
501502
ProjectCreateResponse,
502503
ProjectRetrieveResponse,
503504
ProjectUpdateResponse,

src/gitpod/resources/projects/projects.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
from ...types.project_create_response import ProjectCreateResponse
4747
from ...types.project_update_response import ProjectUpdateResponse
4848
from ...types.project_retrieve_response import ProjectRetrieveResponse
49+
from ...types.recommended_editors_param import RecommendedEditorsParam
4950
from ...types.environment_initializer_param import EnvironmentInitializerParam
5051
from ...types.project_prebuild_configuration_param import ProjectPrebuildConfigurationParam
5152
from ...types.project_create_from_environment_response import ProjectCreateFromEnvironmentResponse
@@ -244,6 +245,7 @@ def update(
244245
name: Optional[str] | Omit = omit,
245246
prebuild_configuration: Optional[ProjectPrebuildConfigurationParam] | Omit = omit,
246247
project_id: str | Omit = omit,
248+
recommended_editors: Optional[RecommendedEditorsParam] | Omit = omit,
247249
technical_description: Optional[str] | Omit = omit,
248250
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
249251
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -313,6 +315,10 @@ def update(
313315
314316
project_id: project_id specifies the project identifier
315317
318+
recommended_editors: recommended_editors specifies the editors recommended for this project. If not
319+
provided, the existing recommended editors are not modified. To clear all
320+
recommended editors, set to an empty RecommendedEditors message.
321+
316322
technical_description: technical_description is a detailed technical description of the project This
317323
field is not returned by default in GetProject or ListProjects responses 8KB max
318324
@@ -334,6 +340,7 @@ def update(
334340
"name": name,
335341
"prebuild_configuration": prebuild_configuration,
336342
"project_id": project_id,
343+
"recommended_editors": recommended_editors,
337344
"technical_description": technical_description,
338345
},
339346
project_update_params.ProjectUpdateParams,
@@ -716,6 +723,7 @@ async def update(
716723
name: Optional[str] | Omit = omit,
717724
prebuild_configuration: Optional[ProjectPrebuildConfigurationParam] | Omit = omit,
718725
project_id: str | Omit = omit,
726+
recommended_editors: Optional[RecommendedEditorsParam] | Omit = omit,
719727
technical_description: Optional[str] | Omit = omit,
720728
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
721729
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -785,6 +793,10 @@ async def update(
785793
786794
project_id: project_id specifies the project identifier
787795
796+
recommended_editors: recommended_editors specifies the editors recommended for this project. If not
797+
provided, the existing recommended editors are not modified. To clear all
798+
recommended editors, set to an empty RecommendedEditors message.
799+
788800
technical_description: technical_description is a detailed technical description of the project This
789801
field is not returned by default in GetProject or ListProjects responses 8KB max
790802
@@ -806,6 +818,7 @@ async def update(
806818
"name": name,
807819
"prebuild_configuration": prebuild_configuration,
808820
"project_id": project_id,
821+
"recommended_editors": recommended_editors,
809822
"technical_description": technical_description,
810823
},
811824
project_update_params.ProjectUpdateParams,

src/gitpod/types/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
from .organization_member import OrganizationMember as OrganizationMember
9595
from .prebuild_spec_param import PrebuildSpecParam as PrebuildSpecParam
9696
from .project_list_params import ProjectListParams as ProjectListParams
97+
from .recommended_editors import RecommendedEditors as RecommendedEditors
9798
from .environment_metadata import EnvironmentMetadata as EnvironmentMetadata
9899
from .event_watch_response import EventWatchResponse as EventWatchResponse
99100
from .exception_info_param import ExceptionInfoParam as ExceptionInfoParam
@@ -154,6 +155,7 @@
154155
from .exception_mechanism_param import ExceptionMechanismParam as ExceptionMechanismParam
155156
from .organization_leave_params import OrganizationLeaveParams as OrganizationLeaveParams
156157
from .project_retrieve_response import ProjectRetrieveResponse as ProjectRetrieveResponse
158+
from .recommended_editors_param import RecommendedEditorsParam as RecommendedEditorsParam
157159
from .secret_get_value_response import SecretGetValueResponse as SecretGetValueResponse
158160
from .user_set_suspended_params import UserSetSuspendedParams as UserSetSuspendedParams
159161
from .agent_create_prompt_params import AgentCreatePromptParams as AgentCreatePromptParams

src/gitpod/types/project.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from .project_phase import ProjectPhase
99
from .shared.subject import Subject
1010
from .project_metadata import ProjectMetadata
11+
from .recommended_editors import RecommendedEditors
1112
from .environment_initializer import EnvironmentInitializer
1213
from .project_prebuild_configuration import ProjectPrebuildConfiguration
1314
from .shared.project_environment_class import ProjectEnvironmentClass
@@ -64,6 +65,9 @@ class Project(BaseModel):
6465
)
6566
"""prebuild_configuration defines how prebuilds are created for this project."""
6667

68+
recommended_editors: Optional[RecommendedEditors] = FieldInfo(alias="recommendedEditors", default=None)
69+
"""recommended_editors specifies the editors recommended for this project."""
70+
6771
technical_description: Optional[str] = FieldInfo(alias="technicalDescription", default=None)
6872
"""
6973
technical_description is a detailed technical description of the project This

src/gitpod/types/project_update_params.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from typing_extensions import Annotated, TypedDict
77

88
from .._utils import PropertyInfo
9+
from .recommended_editors_param import RecommendedEditorsParam
910
from .environment_initializer_param import EnvironmentInitializerParam
1011
from .project_prebuild_configuration_param import ProjectPrebuildConfigurationParam
1112

@@ -50,6 +51,13 @@ class ProjectUpdateParams(TypedDict, total=False):
5051
project_id: Annotated[str, PropertyInfo(alias="projectId")]
5152
"""project_id specifies the project identifier"""
5253

54+
recommended_editors: Annotated[Optional[RecommendedEditorsParam], PropertyInfo(alias="recommendedEditors")]
55+
"""
56+
recommended_editors specifies the editors recommended for this project. If not
57+
provided, the existing recommended editors are not modified. To clear all
58+
recommended editors, set to an empty RecommendedEditors message.
59+
"""
60+
5361
technical_description: Annotated[Optional[str], PropertyInfo(alias="technicalDescription")]
5462
"""
5563
technical_description is a detailed technical description of the project This
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import Dict, List, Optional
4+
5+
from .._models import BaseModel
6+
7+
__all__ = ["RecommendedEditors", "Editors"]
8+
9+
10+
class Editors(BaseModel):
11+
"""EditorVersions contains the recommended versions for an editor."""
12+
13+
versions: Optional[List[str]] = None
14+
"""
15+
versions is the list of recommended versions for this editor. If empty, all
16+
available versions are recommended. Examples for JetBrains: ["2025.1", "2024.3"]
17+
"""
18+
19+
20+
class RecommendedEditors(BaseModel):
21+
"""RecommendedEditors contains the map of recommended editors and their versions."""
22+
23+
editors: Optional[Dict[str, Editors]] = None
24+
"""
25+
editors maps editor aliases to their recommended versions. Key is the editor
26+
alias (e.g., "intellij", "goland", "vscode"). Value contains the list of
27+
recommended versions for that editor. If versions list is empty, all available
28+
versions are recommended. Example: {"intellij": {versions: ["2025.1",
29+
"2024.3"]}, "goland": {}}
30+
"""
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing import Dict
6+
from typing_extensions import TypedDict
7+
8+
from .._types import SequenceNotStr
9+
10+
__all__ = ["RecommendedEditorsParam", "Editors"]
11+
12+
13+
class Editors(TypedDict, total=False):
14+
"""EditorVersions contains the recommended versions for an editor."""
15+
16+
versions: SequenceNotStr[str]
17+
"""
18+
versions is the list of recommended versions for this editor. If empty, all
19+
available versions are recommended. Examples for JetBrains: ["2025.1", "2024.3"]
20+
"""
21+
22+
23+
class RecommendedEditorsParam(TypedDict, total=False):
24+
"""RecommendedEditors contains the map of recommended editors and their versions."""
25+
26+
editors: Dict[str, Editors]
27+
"""
28+
editors maps editor aliases to their recommended versions. Key is the editor
29+
alias (e.g., "intellij", "goland", "vscode"). Value contains the list of
30+
recommended versions for that editor. If versions list is empty, all available
31+
versions are recommended. Example: {"intellij": {versions: ["2025.1",
32+
"2024.3"]}, "goland": {}}
33+
"""

tests/api_resources/test_projects.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None:
169169
"trigger": {"daily_schedule": {"hour_utc": 2}},
170170
},
171171
project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047",
172+
recommended_editors={"editors": {"foo": {"versions": ["string"]}}},
172173
technical_description="technicalDescription",
173174
)
174175
assert_matches_type(ProjectUpdateResponse, project, path=["response"])
@@ -466,6 +467,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) ->
466467
"trigger": {"daily_schedule": {"hour_utc": 2}},
467468
},
468469
project_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047",
470+
recommended_editors={"editors": {"foo": {"versions": ["string"]}}},
469471
technical_description="technicalDescription",
470472
)
471473
assert_matches_type(ProjectUpdateResponse, project, path=["response"])

0 commit comments

Comments
 (0)