Skip to content

Commit 212b6b2

Browse files
feat(api): add default environment class IDs to project creation defaults
1 parent 2c60de5 commit 212b6b2

12 files changed

Lines changed: 391 additions & 4 deletions

.stats.yml

Lines changed: 3 additions & 3 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/gitpod-5ac004b5a80428cfe45268c3b83656d94bc6299d8f555fd85c3a24bad05440f0.yml
3-
openapi_spec_hash: 569ad9b3dc326479f44f529eb4fb59df
4-
config_hash: e1b12d78a2f5fcb3b3e05f8186474a27
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod/gitpod-fed94ac0dbf98aa97a3119c8a06afc4e1e310d7fa79dd43fdcfff16c5275add7.yml
3+
openapi_spec_hash: f284d7c5b9e827cee9db4cc8f372afe3
4+
config_hash: 42ab337a8769c4e3bf2745ef1fbce0d6

api.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,10 @@ from gitpod.types.organizations import (
553553
CustomAgentEnvMapping,
554554
CustomSecurityAgent,
555555
OrganizationPolicies,
556+
ProjectCreationDefaultEnvironmentClass,
557+
ProjectCreationDefaultEnvironmentClassWarmPool,
558+
ProjectCreationDefaults,
559+
ProjectCreationDefaultsPrebuilds,
556560
SecurityAgentPolicy,
557561
VetoExecPolicy,
558562
PolicyRetrieveResponse,

src/gitpod/types/organizations/__init__.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,30 @@
6262
from .domain_verification_create_response import DomainVerificationCreateResponse as DomainVerificationCreateResponse
6363
from .domain_verification_retrieve_params import DomainVerificationRetrieveParams as DomainVerificationRetrieveParams
6464
from .domain_verification_verify_response import DomainVerificationVerifyResponse as DomainVerificationVerifyResponse
65+
from .project_creation_defaults_prebuilds import ProjectCreationDefaultsPrebuilds as ProjectCreationDefaultsPrebuilds
6566
from .sso_configuration_retrieve_response import SSOConfigurationRetrieveResponse as SSOConfigurationRetrieveResponse
6667
from .scim_configuration_retrieve_response import ScimConfigurationRetrieveResponse as ScimConfigurationRetrieveResponse
6768
from .domain_verification_retrieve_response import (
6869
DomainVerificationRetrieveResponse as DomainVerificationRetrieveResponse,
6970
)
71+
from .project_creation_defaults_prebuilds_param import (
72+
ProjectCreationDefaultsPrebuildsParam as ProjectCreationDefaultsPrebuildsParam,
73+
)
74+
from .project_creation_default_environment_class import (
75+
ProjectCreationDefaultEnvironmentClass as ProjectCreationDefaultEnvironmentClass,
76+
)
7077
from .scim_configuration_regenerate_token_params import (
7178
ScimConfigurationRegenerateTokenParams as ScimConfigurationRegenerateTokenParams,
7279
)
7380
from .scim_configuration_regenerate_token_response import (
7481
ScimConfigurationRegenerateTokenResponse as ScimConfigurationRegenerateTokenResponse,
7582
)
83+
from .project_creation_default_environment_class_param import (
84+
ProjectCreationDefaultEnvironmentClassParam as ProjectCreationDefaultEnvironmentClassParam,
85+
)
86+
from .project_creation_default_environment_class_warm_pool import (
87+
ProjectCreationDefaultEnvironmentClassWarmPool as ProjectCreationDefaultEnvironmentClassWarmPool,
88+
)
89+
from .project_creation_default_environment_class_warm_pool_param import (
90+
ProjectCreationDefaultEnvironmentClassWarmPoolParam as ProjectCreationDefaultEnvironmentClassWarmPoolParam,
91+
)

src/gitpod/types/organizations/policy_update_params.py

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Dict, List, Optional
5+
from typing import Dict, Iterable, Optional
66
from typing_extensions import Required, Annotated, TypedDict
77

88
from ..._types import SequenceNotStr
@@ -14,6 +14,8 @@
1414
from ..shared.codex_service_tier import CodexServiceTier
1515
from .conversation_sharing_policy import ConversationSharingPolicy
1616
from ..shared.codex_reasoning_effort import CodexReasoningEffort
17+
from .project_creation_defaults_prebuilds_param import ProjectCreationDefaultsPrebuildsParam
18+
from .project_creation_default_environment_class_param import ProjectCreationDefaultEnvironmentClassParam
1719

1820
__all__ = [
1921
"PolicyUpdateParams",
@@ -256,6 +258,33 @@ class EditorVersionRestrictions(TypedDict, total=False):
256258
"""
257259

258260

261+
class ProjectCreationDefaults(TypedDict, total=False):
262+
"""
263+
project_creation_defaults contains updates to default settings applied to newly created projects.
264+
"""
265+
266+
environment_classes: Annotated[
267+
Iterable[ProjectCreationDefaultEnvironmentClassParam], PropertyInfo(alias="environmentClasses")
268+
]
269+
"""
270+
environment_classes replaces the full list of default environment classes and
271+
their per-class settings. Send an empty list to clear defaults.
272+
"""
273+
274+
insights_enabled: Annotated[Optional[bool], PropertyInfo(alias="insightsEnabled")]
275+
"""
276+
insights_enabled controls whether Insights (co-author attribution) is
277+
automatically enabled on newly created projects.
278+
"""
279+
280+
prebuilds: Optional[ProjectCreationDefaultsPrebuildsParam]
281+
"""
282+
prebuilds configures default prebuild settings for newly created projects. Set
283+
to enable/update prebuild defaults. Prebuilds are disabled by default when this
284+
field is absent.
285+
"""
286+
287+
259288
class SecurityAgentPolicyCrowdstrike(TypedDict, total=False):
260289
"""crowdstrike contains CrowdStrike Falcon configuration updates"""
261290

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import Optional
4+
5+
from pydantic import Field as FieldInfo
6+
7+
from ..._models import BaseModel
8+
from .project_creation_default_environment_class_warm_pool import ProjectCreationDefaultEnvironmentClassWarmPool
9+
10+
__all__ = ["ProjectCreationDefaultEnvironmentClass"]
11+
12+
13+
class ProjectCreationDefaultEnvironmentClass(BaseModel):
14+
"""
15+
ProjectCreationDefaultEnvironmentClass configures a single environment class
16+
in the project creation defaults.
17+
"""
18+
19+
environment_class_id: Optional[str] = FieldInfo(alias="environmentClassId", default=None)
20+
"""environment_class_id is the ID of the environment class."""
21+
22+
order: Optional[int] = None
23+
"""order is the priority of this entry (lower = higher priority)."""
24+
25+
prebuild: Optional[bool] = None
26+
"""
27+
prebuild controls whether prebuilds are enabled for this environment class on
28+
newly created projects.
29+
"""
30+
31+
warm_pool: Optional[ProjectCreationDefaultEnvironmentClassWarmPool] = FieldInfo(alias="warmPool", default=None)
32+
"""
33+
warm_pool configures the warm pool for this environment class on newly created
34+
projects. Only meaningful when prebuild is true.
35+
"""
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import Annotated, TypedDict
6+
7+
from ..._utils import PropertyInfo
8+
from .project_creation_default_environment_class_warm_pool_param import (
9+
ProjectCreationDefaultEnvironmentClassWarmPoolParam,
10+
)
11+
12+
__all__ = ["ProjectCreationDefaultEnvironmentClassParam"]
13+
14+
15+
class ProjectCreationDefaultEnvironmentClassParam(TypedDict, total=False):
16+
"""
17+
ProjectCreationDefaultEnvironmentClass configures a single environment class
18+
in the project creation defaults.
19+
"""
20+
21+
environment_class_id: Annotated[str, PropertyInfo(alias="environmentClassId")]
22+
"""environment_class_id is the ID of the environment class."""
23+
24+
order: int
25+
"""order is the priority of this entry (lower = higher priority)."""
26+
27+
prebuild: bool
28+
"""
29+
prebuild controls whether prebuilds are enabled for this environment class on
30+
newly created projects.
31+
"""
32+
33+
warm_pool: Annotated[ProjectCreationDefaultEnvironmentClassWarmPoolParam, PropertyInfo(alias="warmPool")]
34+
"""
35+
warm_pool configures the warm pool for this environment class on newly created
36+
projects. Only meaningful when prebuild is true.
37+
"""
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import Optional
4+
5+
from pydantic import Field as FieldInfo
6+
7+
from ..._models import BaseModel
8+
9+
__all__ = ["ProjectCreationDefaultEnvironmentClassWarmPool"]
10+
11+
12+
class ProjectCreationDefaultEnvironmentClassWarmPool(BaseModel):
13+
"""
14+
ProjectCreationDefaultEnvironmentClassWarmPool configures warm pool defaults
15+
for an environment class in the project creation defaults.
16+
"""
17+
18+
enabled: Optional[bool] = None
19+
"""enabled controls whether a warm pool is created for this environment class."""
20+
21+
max_size: Optional[int] = FieldInfo(alias="maxSize", default=None)
22+
"""max_size is the maximum number of warm instances.
23+
24+
Must be >= min_size and <= 20.
25+
"""
26+
27+
min_size: Optional[int] = FieldInfo(alias="minSize", default=None)
28+
"""min_size is the minimum number of warm instances. Must be >= 0 and <= max_size."""
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import Annotated, TypedDict
6+
7+
from ..._utils import PropertyInfo
8+
9+
__all__ = ["ProjectCreationDefaultEnvironmentClassWarmPoolParam"]
10+
11+
12+
class ProjectCreationDefaultEnvironmentClassWarmPoolParam(TypedDict, total=False):
13+
"""
14+
ProjectCreationDefaultEnvironmentClassWarmPool configures warm pool defaults
15+
for an environment class in the project creation defaults.
16+
"""
17+
18+
enabled: bool
19+
"""enabled controls whether a warm pool is created for this environment class."""
20+
21+
max_size: Annotated[int, PropertyInfo(alias="maxSize")]
22+
"""max_size is the maximum number of warm instances.
23+
24+
Must be >= min_size and <= 20.
25+
"""
26+
27+
min_size: Annotated[int, PropertyInfo(alias="minSize")]
28+
"""min_size is the minimum number of warm instances. Must be >= 0 and <= max_size."""
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import List, Optional
4+
5+
from pydantic import Field as FieldInfo
6+
7+
from ..._models import BaseModel
8+
from .project_creation_defaults_prebuilds import ProjectCreationDefaultsPrebuilds
9+
from .project_creation_default_environment_class import ProjectCreationDefaultEnvironmentClass
10+
11+
__all__ = ["ProjectCreationDefaults"]
12+
13+
14+
class ProjectCreationDefaults(BaseModel):
15+
"""
16+
ProjectCreationDefaults contains default settings applied to newly created projects.
17+
"""
18+
19+
environment_classes: Optional[List[ProjectCreationDefaultEnvironmentClass]] = FieldInfo(
20+
alias="environmentClasses", default=None
21+
)
22+
"""
23+
environment_classes specifies default environment classes and their per-class
24+
settings (order, prebuild, warm pool) for newly created projects. Each entry
25+
must reference an existing, enabled, non-local-runner environment class in the
26+
organization.
27+
"""
28+
29+
insights_enabled: Optional[bool] = FieldInfo(alias="insightsEnabled", default=None)
30+
"""
31+
insights_enabled controls whether Insights (co-author attribution) is
32+
automatically enabled on newly created projects.
33+
"""
34+
35+
prebuilds: Optional[ProjectCreationDefaultsPrebuilds] = None
36+
"""
37+
prebuilds configures default prebuild settings for newly created projects. When
38+
set, prebuilds can be enabled per environment class via the environment_classes
39+
entries. When absent, prebuilds are not enabled by default.
40+
"""
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import Optional
4+
5+
from pydantic import Field as FieldInfo
6+
7+
from ..._models import BaseModel
8+
from ..shared.subject import Subject
9+
10+
__all__ = ["ProjectCreationDefaultsPrebuilds", "Trigger", "TriggerDailySchedule"]
11+
12+
13+
class TriggerDailySchedule(BaseModel):
14+
"""
15+
daily_schedule triggers a prebuild once per day at the specified hour (UTC).
16+
The actual start time may vary slightly to distribute system load.
17+
"""
18+
19+
hour_utc: Optional[int] = FieldInfo(alias="hourUtc", default=None)
20+
"""
21+
hour_utc is the hour of day (0-23) in UTC when the prebuild should start. The
22+
actual start time may be adjusted by a few minutes to balance system load.
23+
"""
24+
25+
26+
class Trigger(BaseModel):
27+
"""trigger defines when prebuilds should be created on newly created projects."""
28+
29+
daily_schedule: TriggerDailySchedule = FieldInfo(alias="dailySchedule")
30+
"""
31+
daily_schedule triggers a prebuild once per day at the specified hour (UTC). The
32+
actual start time may vary slightly to distribute system load.
33+
"""
34+
35+
36+
class ProjectCreationDefaultsPrebuilds(BaseModel):
37+
"""
38+
ProjectCreationDefaultsPrebuilds configures default prebuild settings.
39+
Presence of this message means prebuilds can be enabled for the default environment classes.
40+
"""
41+
42+
enable_jetbrains_warmup: Optional[bool] = FieldInfo(alias="enableJetbrainsWarmup", default=None)
43+
"""
44+
enable_jetbrains_warmup controls whether JetBrains IDE warmup runs during
45+
prebuilds on newly created projects.
46+
"""
47+
48+
prebuild_executor: Optional[Subject] = FieldInfo(alias="prebuildExecutor", default=None)
49+
"""
50+
prebuild_executor is the service account used to run prebuilds on newly created
51+
projects. Must be a service account (not a user).
52+
"""
53+
54+
timeout: Optional[str] = None
55+
"""
56+
timeout is the maximum duration allowed for a prebuild to complete. If not
57+
specified, defaults to 1 hour. Must be between 5 minutes and 2 hours.
58+
"""
59+
60+
trigger: Optional[Trigger] = None
61+
"""trigger defines when prebuilds should be created on newly created projects."""

0 commit comments

Comments
 (0)