Skip to content

Commit 5d8545f

Browse files
feat(api): add project_creation_defaults to organizations policies
1 parent 3a521b2 commit 5d8545f

8 files changed

Lines changed: 68 additions & 3 deletions

File tree

.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-163329b61609d5c35f782faa460b99ad014584f1f0746d863c5612d6ee6e2c4b.yml
3-
openapi_spec_hash: 97bfee064dda4a0e940140c91fec5206
4-
config_hash: e7d6e90c037f5d495ae913f3806471fd
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod/gitpod-b9c1a7558d4dda4b0e58729d1c14b130d19262615d63ce6c78340daeca76188e.yml
3+
openapi_spec_hash: a91da1453dbfb8aceccb085665b3b21d
4+
config_hash: 9052d3b03d620cf6871184b15487e020

api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,7 @@ from gitpod.types.organizations import (
507507
CustomSecurityAgent,
508508
KernelControlsAction,
509509
OrganizationPolicies,
510+
ProjectCreationDefaults,
510511
SecurityAgentPolicy,
511512
VetoExecPolicy,
512513
PolicyRetrieveResponse,

src/gitpod/resources/organizations/policies.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ def update(
115115
members_create_projects: Optional[bool] | Omit = omit,
116116
members_require_projects: Optional[bool] | Omit = omit,
117117
port_sharing_disabled: Optional[bool] | Omit = omit,
118+
project_creation_defaults: Optional[policy_update_params.ProjectCreationDefaults] | Omit = omit,
118119
require_custom_domain_access: Optional[bool] | Omit = omit,
119120
restrict_account_creation_to_scim: Optional[bool] | Omit = omit,
120121
security_agent_policy: Optional[policy_update_params.SecurityAgentPolicy] | Omit = omit,
@@ -218,6 +219,9 @@ def update(
218219
in the organization. System ports (VS Code Browser, agents) are always exempt
219220
from this policy.
220221
222+
project_creation_defaults: project_creation_defaults contains updates to default settings applied to newly
223+
created projects.
224+
221225
require_custom_domain_access: require_custom_domain_access controls whether users must access via custom
222226
domain when one is configured. When true, access via app.gitpod.io is blocked.
223227
@@ -257,6 +261,7 @@ def update(
257261
"members_create_projects": members_create_projects,
258262
"members_require_projects": members_require_projects,
259263
"port_sharing_disabled": port_sharing_disabled,
264+
"project_creation_defaults": project_creation_defaults,
260265
"require_custom_domain_access": require_custom_domain_access,
261266
"restrict_account_creation_to_scim": restrict_account_creation_to_scim,
262267
"security_agent_policy": security_agent_policy,
@@ -362,6 +367,7 @@ async def update(
362367
members_create_projects: Optional[bool] | Omit = omit,
363368
members_require_projects: Optional[bool] | Omit = omit,
364369
port_sharing_disabled: Optional[bool] | Omit = omit,
370+
project_creation_defaults: Optional[policy_update_params.ProjectCreationDefaults] | Omit = omit,
365371
require_custom_domain_access: Optional[bool] | Omit = omit,
366372
restrict_account_creation_to_scim: Optional[bool] | Omit = omit,
367373
security_agent_policy: Optional[policy_update_params.SecurityAgentPolicy] | Omit = omit,
@@ -465,6 +471,9 @@ async def update(
465471
in the organization. System ports (VS Code Browser, agents) are always exempt
466472
from this policy.
467473
474+
project_creation_defaults: project_creation_defaults contains updates to default settings applied to newly
475+
created projects.
476+
468477
require_custom_domain_access: require_custom_domain_access controls whether users must access via custom
469478
domain when one is configured. When true, access via app.gitpod.io is blocked.
470479
@@ -504,6 +513,7 @@ async def update(
504513
"members_create_projects": members_create_projects,
505514
"members_require_projects": members_require_projects,
506515
"port_sharing_disabled": port_sharing_disabled,
516+
"project_creation_defaults": project_creation_defaults,
507517
"require_custom_domain_access": require_custom_domain_access,
508518
"restrict_account_creation_to_scim": restrict_account_creation_to_scim,
509519
"security_agent_policy": security_agent_policy,

src/gitpod/types/organizations/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from .policy_retrieve_response import PolicyRetrieveResponse as PolicyRetrieveResponse
2828
from .domain_verification_state import DomainVerificationState as DomainVerificationState
2929
from .invite_get_summary_params import InviteGetSummaryParams as InviteGetSummaryParams
30+
from .project_creation_defaults import ProjectCreationDefaults as ProjectCreationDefaults
3031
from .conversation_sharing_policy import ConversationSharingPolicy as ConversationSharingPolicy
3132
from .custom_domain_create_params import CustomDomainCreateParams as CustomDomainCreateParams
3233
from .custom_domain_delete_params import CustomDomainDeleteParams as CustomDomainDeleteParams

src/gitpod/types/organizations/organization_policies.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from .agent_policy import AgentPolicy
99
from .veto_exec_policy import VetoExecPolicy
1010
from .security_agent_policy import SecurityAgentPolicy
11+
from .project_creation_defaults import ProjectCreationDefaults
1112

1213
__all__ = ["OrganizationPolicies", "EditorVersionRestrictions"]
1314

@@ -132,6 +133,14 @@ class OrganizationPolicies(BaseModel):
132133
```
133134
"""
134135

136+
project_creation_defaults: Optional[ProjectCreationDefaults] = FieldInfo(
137+
alias="projectCreationDefaults", default=None
138+
)
139+
"""
140+
project_creation_defaults contains default settings applied to newly created
141+
projects.
142+
"""
143+
135144
security_agent_policy: Optional[SecurityAgentPolicy] = FieldInfo(alias="securityAgentPolicy", default=None)
136145
"""
137146
security_agent_policy contains security agent configuration for the

src/gitpod/types/organizations/policy_update_params.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"PolicyUpdateParams",
1616
"AgentPolicy",
1717
"EditorVersionRestrictions",
18+
"ProjectCreationDefaults",
1819
"SecurityAgentPolicy",
1920
"SecurityAgentPolicyCrowdstrike",
2021
]
@@ -123,6 +124,14 @@ class PolicyUpdateParams(TypedDict, total=False):
123124
from this policy.
124125
"""
125126

127+
project_creation_defaults: Annotated[
128+
Optional[ProjectCreationDefaults], PropertyInfo(alias="projectCreationDefaults")
129+
]
130+
"""
131+
project_creation_defaults contains updates to default settings applied to newly
132+
created projects.
133+
"""
134+
126135
require_custom_domain_access: Annotated[Optional[bool], PropertyInfo(alias="requireCustomDomainAccess")]
127136
"""
128137
require_custom_domain_access controls whether users must access via custom
@@ -195,6 +204,18 @@ class EditorVersionRestrictions(TypedDict, total=False):
195204
"""
196205

197206

207+
class ProjectCreationDefaults(TypedDict, total=False):
208+
"""
209+
project_creation_defaults contains updates to default settings applied to newly created projects.
210+
"""
211+
212+
insights_enabled: Annotated[Optional[bool], PropertyInfo(alias="insightsEnabled")]
213+
"""
214+
insights_enabled controls whether Insights (co-author attribution) is
215+
automatically enabled on newly created projects.
216+
"""
217+
218+
198219
class SecurityAgentPolicyCrowdstrike(TypedDict, total=False):
199220
"""crowdstrike contains CrowdStrike Falcon configuration updates"""
200221

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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__ = ["ProjectCreationDefaults"]
10+
11+
12+
class ProjectCreationDefaults(BaseModel):
13+
"""
14+
ProjectCreationDefaults contains default settings applied to newly created projects.
15+
"""
16+
17+
insights_enabled: Optional[bool] = FieldInfo(alias="insightsEnabled", default=None)
18+
"""
19+
insights_enabled controls whether Insights (co-author attribution) is
20+
automatically enabled on newly created projects.
21+
"""

tests/api_resources/organizations/test_policies.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None:
8888
members_create_projects=True,
8989
members_require_projects=True,
9090
port_sharing_disabled=True,
91+
project_creation_defaults={"insights_enabled": True},
9192
require_custom_domain_access=True,
9293
restrict_account_creation_to_scim=True,
9394
security_agent_policy={
@@ -208,6 +209,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) ->
208209
members_create_projects=True,
209210
members_require_projects=True,
210211
port_sharing_disabled=True,
212+
project_creation_defaults={"insights_enabled": True},
211213
require_custom_domain_access=True,
212214
restrict_account_creation_to_scim=True,
213215
security_agent_policy={

0 commit comments

Comments
 (0)