Skip to content

Commit 5102f24

Browse files
feat: Stabilize project lifecycle error codes
1 parent c3f4571 commit 5102f24

4 files changed

Lines changed: 82 additions & 18 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: 127
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-32a5ef4f5def9dde3ed7acc2b6159b143194e224ceaad2dbbbcb766cac90602e.yml
3-
openapi_spec_hash: 3f514f770bb352d98bd3dbcf865a077f
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-7b03462454d6fa8390eaebc1b411d3e160501bf96abb93b75d38dfc382d4ce51.yml
3+
openapi_spec_hash: ba55400aafb4759cc06ec139fe528dfc
44
config_hash: 77ee715aa17061166f9a02b264a21b8d

src/kernel/_client.py

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,11 @@ def credentials(self) -> CredentialsResource:
266266

267267
@cached_property
268268
def projects(self) -> ProjectsResource:
269-
"""Create and manage projects for resource isolation within an organization."""
269+
"""
270+
Create and manage projects for resource isolation within an organization.
271+
When projects are disabled for the organization, project operations return
272+
`404` with code `projects_disabled`.
273+
"""
270274
from .resources.projects import ProjectsResource
271275

272276
return ProjectsResource(self)
@@ -618,7 +622,11 @@ def credentials(self) -> AsyncCredentialsResource:
618622

619623
@cached_property
620624
def projects(self) -> AsyncProjectsResource:
621-
"""Create and manage projects for resource isolation within an organization."""
625+
"""
626+
Create and manage projects for resource isolation within an organization.
627+
When projects are disabled for the organization, project operations return
628+
`404` with code `projects_disabled`.
629+
"""
622630
from .resources.projects import AsyncProjectsResource
623631

624632
return AsyncProjectsResource(self)
@@ -878,7 +886,11 @@ def credentials(self) -> credentials.CredentialsResourceWithRawResponse:
878886

879887
@cached_property
880888
def projects(self) -> projects.ProjectsResourceWithRawResponse:
881-
"""Create and manage projects for resource isolation within an organization."""
889+
"""
890+
Create and manage projects for resource isolation within an organization.
891+
When projects are disabled for the organization, project operations return
892+
`404` with code `projects_disabled`.
893+
"""
882894
from .resources.projects import ProjectsResourceWithRawResponse
883895

884896
return ProjectsResourceWithRawResponse(self._client.projects)
@@ -988,7 +1000,11 @@ def credentials(self) -> credentials.AsyncCredentialsResourceWithRawResponse:
9881000

9891001
@cached_property
9901002
def projects(self) -> projects.AsyncProjectsResourceWithRawResponse:
991-
"""Create and manage projects for resource isolation within an organization."""
1003+
"""
1004+
Create and manage projects for resource isolation within an organization.
1005+
When projects are disabled for the organization, project operations return
1006+
`404` with code `projects_disabled`.
1007+
"""
9921008
from .resources.projects import AsyncProjectsResourceWithRawResponse
9931009

9941010
return AsyncProjectsResourceWithRawResponse(self._client.projects)
@@ -1098,7 +1114,11 @@ def credentials(self) -> credentials.CredentialsResourceWithStreamingResponse:
10981114

10991115
@cached_property
11001116
def projects(self) -> projects.ProjectsResourceWithStreamingResponse:
1101-
"""Create and manage projects for resource isolation within an organization."""
1117+
"""
1118+
Create and manage projects for resource isolation within an organization.
1119+
When projects are disabled for the organization, project operations return
1120+
`404` with code `projects_disabled`.
1121+
"""
11021122
from .resources.projects import ProjectsResourceWithStreamingResponse
11031123

11041124
return ProjectsResourceWithStreamingResponse(self._client.projects)
@@ -1208,7 +1228,11 @@ def credentials(self) -> credentials.AsyncCredentialsResourceWithStreamingRespon
12081228

12091229
@cached_property
12101230
def projects(self) -> projects.AsyncProjectsResourceWithStreamingResponse:
1211-
"""Create and manage projects for resource isolation within an organization."""
1231+
"""
1232+
Create and manage projects for resource isolation within an organization.
1233+
When projects are disabled for the organization, project operations return
1234+
`404` with code `projects_disabled`.
1235+
"""
12121236
from .resources.projects import AsyncProjectsResourceWithStreamingResponse
12131237

12141238
return AsyncProjectsResourceWithStreamingResponse(self._client.projects)

src/kernel/resources/projects/limits.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@
2424

2525

2626
class LimitsResource(SyncAPIResource):
27-
"""Create and manage projects for resource isolation within an organization."""
27+
"""
28+
Create and manage projects for resource isolation within an organization.
29+
When projects are disabled for the organization, project operations return
30+
`404` with code `projects_disabled`.
31+
"""
2832

2933
@cached_property
3034
def with_raw_response(self) -> LimitsResourceWithRawResponse:
@@ -140,7 +144,11 @@ def update(
140144

141145

142146
class AsyncLimitsResource(AsyncAPIResource):
143-
"""Create and manage projects for resource isolation within an organization."""
147+
"""
148+
Create and manage projects for resource isolation within an organization.
149+
When projects are disabled for the organization, project operations return
150+
`404` with code `projects_disabled`.
151+
"""
144152

145153
@cached_property
146154
def with_raw_response(self) -> AsyncLimitsResourceWithRawResponse:

src/kernel/resources/projects/projects.py

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,19 @@
3333

3434

3535
class ProjectsResource(SyncAPIResource):
36-
"""Create and manage projects for resource isolation within an organization."""
36+
"""
37+
Create and manage projects for resource isolation within an organization.
38+
When projects are disabled for the organization, project operations return
39+
`404` with code `projects_disabled`.
40+
"""
3741

3842
@cached_property
3943
def limits(self) -> LimitsResource:
40-
"""Create and manage projects for resource isolation within an organization."""
44+
"""
45+
Create and manage projects for resource isolation within an organization.
46+
When projects are disabled for the organization, project operations return
47+
`404` with code `projects_disabled`.
48+
"""
4149
return LimitsResource(self._client)
4250

4351
@cached_property
@@ -266,11 +274,19 @@ def delete(
266274

267275

268276
class AsyncProjectsResource(AsyncAPIResource):
269-
"""Create and manage projects for resource isolation within an organization."""
277+
"""
278+
Create and manage projects for resource isolation within an organization.
279+
When projects are disabled for the organization, project operations return
280+
`404` with code `projects_disabled`.
281+
"""
270282

271283
@cached_property
272284
def limits(self) -> AsyncLimitsResource:
273-
"""Create and manage projects for resource isolation within an organization."""
285+
"""
286+
Create and manage projects for resource isolation within an organization.
287+
When projects are disabled for the organization, project operations return
288+
`404` with code `projects_disabled`.
289+
"""
274290
return AsyncLimitsResource(self._client)
275291

276292
@cached_property
@@ -520,7 +536,11 @@ def __init__(self, projects: ProjectsResource) -> None:
520536

521537
@cached_property
522538
def limits(self) -> LimitsResourceWithRawResponse:
523-
"""Create and manage projects for resource isolation within an organization."""
539+
"""
540+
Create and manage projects for resource isolation within an organization.
541+
When projects are disabled for the organization, project operations return
542+
`404` with code `projects_disabled`.
543+
"""
524544
return LimitsResourceWithRawResponse(self._projects.limits)
525545

526546

@@ -546,7 +566,11 @@ def __init__(self, projects: AsyncProjectsResource) -> None:
546566

547567
@cached_property
548568
def limits(self) -> AsyncLimitsResourceWithRawResponse:
549-
"""Create and manage projects for resource isolation within an organization."""
569+
"""
570+
Create and manage projects for resource isolation within an organization.
571+
When projects are disabled for the organization, project operations return
572+
`404` with code `projects_disabled`.
573+
"""
550574
return AsyncLimitsResourceWithRawResponse(self._projects.limits)
551575

552576

@@ -572,7 +596,11 @@ def __init__(self, projects: ProjectsResource) -> None:
572596

573597
@cached_property
574598
def limits(self) -> LimitsResourceWithStreamingResponse:
575-
"""Create and manage projects for resource isolation within an organization."""
599+
"""
600+
Create and manage projects for resource isolation within an organization.
601+
When projects are disabled for the organization, project operations return
602+
`404` with code `projects_disabled`.
603+
"""
576604
return LimitsResourceWithStreamingResponse(self._projects.limits)
577605

578606

@@ -598,5 +626,9 @@ def __init__(self, projects: AsyncProjectsResource) -> None:
598626

599627
@cached_property
600628
def limits(self) -> AsyncLimitsResourceWithStreamingResponse:
601-
"""Create and manage projects for resource isolation within an organization."""
629+
"""
630+
Create and manage projects for resource isolation within an organization.
631+
When projects are disabled for the organization, project operations return
632+
`404` with code `projects_disabled`.
633+
"""
602634
return AsyncLimitsResourceWithStreamingResponse(self._projects.limits)

0 commit comments

Comments
 (0)